All clean. Here's what I implemented for issue #79:
New file: machine/subcommands/check.py - The check subcommand that validates config against the provider API.
Checks performed:
- API authentication - Makes a read-only
list_ssh_keys()call to verify the token is valid. If this fails, remaining checks are skipped since they'd all fail too. - SSH key - Verifies the configured SSH key exists at the provider.
- DNS zone - Verifies the configured DNS zone exists in the provider's domain list (skipped if not configured).
- Project - Verifies the configured project exists at the provider (skipped if not configured or not supported by the provider).
- Region - Validates the configured region using the provider's validation.
- Image - Validates the configured image using the provider's validation.
Output format:
Checking config for provider: DigitalOcean
PASS: API authentication
PASS: SSH key (my-key)
PASS: DNS zone (example.com)
FAIL: Project (missing-project)
PASS: Region (NYC1)
PASS: Image (ubuntu-24-04-x64)
Some checks failed.
Exits with code 1 if any check fails, 0 if all pass. Would you like me to commit this?