Skip to content

cloudfall CLI phase 2: init, add, dashboard build, services inspect on treaty - #7

Merged
romamo merged 1 commit into
mainfrom
treaty-cli-phase2
Oct 2, 2026
Merged

romamo merged 1 commit into
mainfrom
treaty-cli-phase2

Conversation

@romamo

@romamo romamo commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Phase 2 of moving the cloudfall CLI to treaty. Stacked on #6: review that first; this PR's base is treaty-rc10.

Changes

  • init, add ssh-key, add server-type, add server, dashboard build and services inspect run in cloudfall.app; their argparse handlers are gone, their parsers stay so root --help lists them
  • Their data keeps the old keys and gains effect (created, or updated for a rebuilt dashboard): treaty requires it of a command that writes (REQ-C-003)
  • init's git steps take a runner (project.initialize_git), so the command runs git through ctx.run and doctor checks git 2.24; the argparse default stays subprocess
  • Each command declares its timeout (services inspect 600 s for its probes); add and dashboard build take --raw-payload
  • The read-only path test for argparse moved to import render, which still runs there

Exit codes, for callers of these six

6 CONFLICT for an existing resource (was 2), 7 PERMISSION_DENIED for a read-only path (was 1 or 2), 4 PRECONDITION for a non-empty init directory (was 2), 5 NOT_FOUND for a missing key file, 2 ARG_ERROR for a bad id, name or address. The old code is in error.context.code.

Not moved yet

observe, secrets render, import render and import render-api have camelCase keys (exitCode, environmentFile, environmentFiles) that need an output adapter, and an adapter cannot be returned from a command that writes: treaty #183.

treaty issues filed

#183 (adapter on a mutating command), #184 (a write under the project directory cannot be declared as a side effect).

Checks

  • uv run pytest: 456 passed, 1 xfailed (FORCE_COLOR unset)
  • ruff, mypy: clean
  • treaty audit cloudfall.app:app: the #180 false positive and advice only (one-line descriptions refuse newlines on purpose)
  • Smoke run in a fresh directory: init, add ssh-key, add server, config validate, then a repeated add server (exit 6) and a bad id (exit 2)

🤖 Generated with Claude Code

Phase 2 of moving the cloudfall CLI off argparse, for the commands whose
answer fits a dataclass: treaty requires an effect from a command that
writes, and an output adapter cannot carry one yet (treaty #183), so
observe, secrets render and import stay on argparse.

init's git steps take a runner, so the command passes ctx.run and doctor
checks git; add resolves the project without validating it first, as it
did. Each command declares its own timeout, and the evidence options of
services status are shared with dashboard build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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