Skip to content

feat(init): support fully non-interactive setup via flags#561

Open
I-bangash wants to merge 1 commit into
mattpocock:mainfrom
I-bangash:feat/init-non-interactive-flags
Open

feat(init): support fully non-interactive setup via flags#561
I-bangash wants to merge 1 commit into
mattpocock:mainfrom
I-bangash:feat/init-non-interactive-flags

Conversation

@I-bangash
Copy link
Copy Markdown

@I-bangash I-bangash commented May 6, 2026

Closes #510.

sandcastle init previously had four prompts with no flag overrides, which made it impossible to run in a non-TTY environment (CI, scripts, container builds). This PR adds an override flag for every remaining prompt so init runs end-to-end with stdin closed.

New flags

Flag Values Default
--sandbox-provider docker, podman interactive prompt
--backlog-manager github-issues, beads interactive prompt
--create-label true, false interactive prompt (default: yes)
--build-image true, false interactive prompt (default: yes)

All four flags follow the same Options.text + optional pattern as the existing --template, --agent, and --model flags: omit to be prompted, pass a value to skip the prompt.

When all flags are provided, init skips every clack prompt and runs to completion. Existing interactive behavior is unchanged when flags are omitted.

Validation

  • --sandbox-provider and --backlog-manager reject unknown values with an error listing valid choices.
  • --create-label and --build-image reject values other than true/false with an error listing valid choices.

Non-interactive example

sandcastle init \
  --template blank \
  --agent claude-code \
  --sandbox-provider docker \
  --backlog-manager github-issues \
  --create-label true \
  --build-image true

Exits 0, scaffolds .sandcastle/, no prompts.

Tests

8 new cases in src/cli.test.ts:

  • All new flags appear in init --help; removed flag names do not
  • Invalid --sandbox-provider / --backlog-manager values error with the available list
  • --create-label / --build-image with a non-boolean value error with true, false
  • Fully non-interactive happy path with stdin closed → success
  • --sandbox-provider podman writes a Containerfile (no Dockerfile)
  • --backlog-manager beads skips the GitHub label step regardless of label flag

Verification

  • npm run typecheck passes
  • npm run build passes
  • npx vitest run src/cli.test.ts — 22/22 pass
  • Manual non-interactive run with stdin closed exits 0 and scaffolds correctly
  • Changeset added (patch, per CLAUDE.md's pre-1.0 policy)
  • README's sandcastle init options table updated

Adds --sandbox-provider, --backlog-manager, --create-label, and
--build-image flags to sandcastle init. When all four are provided,
init runs end-to-end without any interactive prompts — required for
CI/non-TTY environments.

All new flags follow the same Options.text + optional pattern as the
existing --template/--agent/--model flags: omit to be prompted, pass a
value to skip the prompt.

--create-label and --build-image accept true or false; any other value
errors with a list of valid choices. --sandbox-provider and
--backlog-manager reject unknown values the same way.

Closes mattpocock#510.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

@I-bangash is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

init: support fully non-interactive setup via flags

1 participant