feat: agent-friendly non-interactive CLI (-y/--yes) + logs/hosts fixes - #13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, --yesadded to every command that otherwise blocks on a confirmation prompt:down,stop-all,test,import,export,open(joinup/restartwhich already had it). The flag is wired toDockerApp.acceptDefaults, so re-init prompts duringinitialize()are bypassed too.open -yauto-starts a stopped app (queuesup -y) before opening.lab help --jsonalready surfaces the new flags automatically.Fixes
UserErrorinstead of callingprocess.exit()with no code — callers/agents get a real diagnostic instead of a silently dead process.lab logsno longer runs twice: removed a duplicateexecSyncinattachToLogs.Not covered (documented, need environment/human, not a
-ything)Writing
/etc/hostsneedssudo/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