Skip to content

feat: add shuttle doctor setup-diagnostics subcommand#20

Merged
jkleinne merged 13 commits into
mainfrom
feat/shuttle-doctor
Jun 3, 2026
Merged

feat: add shuttle doctor setup-diagnostics subcommand#20
jkleinne merged 13 commits into
mainfrom
feat/shuttle-doctor

Conversation

@jkleinne

@jkleinne jkleinne commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a shuttle doctor subcommand that reports environment and config readiness as a ✓/⚠/✗ checklist (rsync/rclone presence and versions, config validity, whether each configured rclone remote exists in rclone listremotes, and filter-file existence), catching a mismatch between a config remote name and the user's rclone.conf that previously surfaced only mid-run. It runs locally with no network, never reads or prompts for the rclone password, and exits 2 on any failure (0 on pass or warn) so shuttle doctor && shuttle run works as a precondition gate. Shared rclone filter-file resolution is consolidated into a single config.RcloneFilterFiles used by both the runner and doctor.

jkleinne added 13 commits June 2, 2026 19:51
Defines CheckLevel/CheckResult/Report value types and RenderReport,
the formatted checklist + tally output for shuttle doctor. Reuses
render.go's colorize helper and ANSI constants; adds symbolWarn since
the sync Status type has no warning state.
Add ConfigStatus, Diagnose, and supporting helpers to doctor.go.
Config-load classification is pure logic over the passed-in ConfigStatus
value (no file I/O in the engine). Tool checks use exec.LookPath plus
version probes; absence severity is FAIL when the config uses that
engine, WARN when it does not.
Add remoteChecks, listRcloneRemotes, filterFileChecks, and rcloneFilterFiles
to Diagnose. Compares remote names against listremotes output in-process
(no config value enters argv). Encrypted-config failure yields one-line WARN,
skips per-remote checks, and leaks no credential reference.
Resolves config path at the CLI boundary, loads config, calls
engine.Diagnose, renders the report, and returns errDoctorFailed
(mapped to exit 2) when any check fails. Adds two integration tests
covering the exit-zero and exit-two paths.
@jkleinne jkleinne merged commit 3e3d4f2 into main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant