Skip to content

feat: agent-friendly non-interactive CLI (-y/--yes) + logs/hosts fixes - #13

Merged
graphicfox merged 3 commits into
masterfrom
feat/agent-friendly-cli
Jul 17, 2026
Merged

feat: agent-friendly non-interactive CLI (-y/--yes) + logs/hosts fixes#13
graphicfox merged 3 commits into
masterfrom
feat/agent-friendly-cli

Conversation

@graphicfox

Copy link
Copy Markdown
Contributor

4.1.0 — agent-friendliness + two bug fixes

Makes the CLI drivable non-interactively (scripts / AI agents) and fixes two defects found while auditing where an agent could get stuck.

Features

  • -y, --yes added to every command that otherwise blocks on a confirmation prompt: down, stop-all, test, import, export, open (join up/restart which already had it). The flag is wired to DockerApp.acceptDefaults, so re-init prompts during initialize() are bypassed too. open -y auto-starts a stopped app (queues up -y) before opening.
  • README gains a non-interactive / AI-agent section; lab help --json already surfaces the new flags automatically.

Fixes

  • Hosts conflict is now recoverable: declining the hosts-overwrite prompt rejects with a UserError instead of calling process.exit() with no code — callers/agents get a real diagnostic instead of a silently dead process.
  • lab logs no longer runs twice: removed a duplicate execSync in attachToLogs.

Not covered (documented, need environment/human, not a -y thing)

Writing /etc/hosts needs sudo/elevation; Doppler-based apps need a pre-authenticated Doppler CLI. Follow/watch modes (up -f, logs -f, shell, sync) never return by design.

Versioning

feat: → minor → 4.1.0 on merge (previous release: 4.0.1). Squash-merge so the release action sees the conventional commit (a plain merge commit would hide it).

Verification

npm run build ✅ · npm test ✅ (25 suites / 44 tests, incl. new non-interactive tests asserting no prompt is shown).

🤖 Generated with Claude Code

Kim Martini and others added 3 commits July 17, 2026 13:57
Adds a -y/--yes flag (wired to DockerApp.acceptDefaults) to every command that
otherwise blocks on a confirmation prompt: down, stop-all, test, import, export
and open. With -y the command proceeds with the prompt defaults without asking,
so the CLI can be driven non-interactively by scripts and AI agents. `open -y`
additionally auto-starts a stopped app (queuing `up -y`) before opening it.

Documents the flags in the README (incl. an explicit non-interactive/agent
section noting that sudo hosts writes and Doppler auth still need a human/
pre-auth), and covers the behaviour with tests asserting no prompt is shown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- DockerAppInit: on declining the hosts-file overwrite prompt, reject with a
  UserError instead of calling process.exit() with no code — callers and agents
  now get a diagnostic they can handle instead of a silently dead process.
- DockerCompose.attachToLogs: remove a duplicate execSync so `lab logs` runs
  (and prints) once instead of twice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@graphicfox
graphicfox merged commit 83cb5af into master Jul 17, 2026
1 check 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