The sync command queries all hosts to find where services are actually
running and updates the state file to match reality. Supports --dry-run
to preview changes without modifying state. Useful for initial setup
or after manual changes.
- up: Detects if service is deployed on a different host and
automatically runs down on the old host before up on the new
- down: Removes service from state tracking after successful stop
- Enables seamless service migration by just changing the config
Allows running compose commands on a specific host rather than
the configured host for a service. Used for migration when
stopping a service on the old host before starting on the new.
Tracks which host each service is deployed on in
~/.config/compose-farm/state.yaml. This enables automatic
migration when a service's host assignment changes.
- hello: Simple hello-world container for testing
- nginx: Nginx web server on port 8080
- sdc.yaml: Local config (no SSH needed)
- README with usage instructions
- Tests for config module (Host, Config, load_config)
- Tests for ssh module (local detection, command execution)
- 30 tests, all passing
- pytest-asyncio for async test support
When host address is 'local', 'localhost', '127.0.0.1', or '::1',
commands run locally via subprocess instead of SSH. This is useful
when running sdc from one of the target nodes.
- ruff check + format with ALL rules (ignoring D, ANN, FBT, T201)
- mypy strict mode with pydantic plugin
- Standard pre-commit hooks (trailing whitespace, end-of-file, etc.)
- Fix all type annotations for strict mypy compliance