home-lab/packages/lab-tool/lab/core.scm
Geir Okkenhaug Jerstad 564faaa479 feat: implement modular lab tool structure with working CLI
- Add lab/ module structure (core, machines, deployment, monitoring)
- Add mcp/ server stub for future MCP integration
- Update main.scm to use new modular architecture
- Fix utils/config.scm to export get-current-config function
- Create comprehensive test suite with all modules passing
- Update TODO.md with completed high priority tasks

Key improvements:
- Modular design following K.I.S.S principles
- Working CLI interface for status, machines, deploy commands
- Infrastructure status checking functional
- All module tests passing
- Clean separation of pure/impure functions

CLI now works: ./main.scm status, ./main.scm machines, ./main.scm deploy <machine>
2025-06-16 14:29:00 +02:00

18 lines
669 B
Scheme

;; lab/core.scm - Core infrastructure operations (impure)
(define-module (lab core)
#:use-module (utils config)
#:use-module (utils ssh)
#:use-module (utils logging)
#:export (get-infrastructure-status))
;; Impure function: Get infrastructure status with side effects
(define (get-infrastructure-status)
"Get status of all machines (impure - has logging side effects)"
(log-info "Checking infrastructure status...")
(let ((machines (get-all-machines)))
(map (lambda (machine)
(let ((status (test-ssh-connection machine)))
`((machine . ,machine)
(status . ,(if status 'online 'offline)))))
machines)))