Skip to content

Add --headless mode for automated installs - #55

Draft
nrodd wants to merge 1 commit into
static-snippet-installfrom
headless-mode
Draft

nrodd wants to merge 1 commit into
static-snippet-installfrom
headless-mode

Conversation

@nrodd

@nrodd nrodd commented Oct 8, 2026

Copy link
Copy Markdown
Member

Stacked on #54. Review that first; this PR shows only the headless diff and should be retargeted to main once #54 merges.

Summary

Adds a no-prompt mode for automation, such as CI or a hosted install that runs the wizard inside a customer's repo with credentials it already holds.

  • --headless configures the codebase only:
    • installs the snippet statically when the framework is recognized
    • hands CSP, identity, analytics linkage and privacy masking to a terminal agent (Claude Code, Codex or Gemini) when one is installed
    • skips login, plugin setup, the demo and the clipboard
    • writes .subtext/install-result.json; exits 0 when the snippet is installed, 1 when it isn't, 2 with no credential
  • --org <id> uses the public snippet service without a credential, so telemetry is skipped.
  • --external-agent does the deterministic steps, then writes the remaining agent work to .subtext/agent-prompt.md instead of launching a local agent CLI. This is for a hosted agent (for example an Anthropic Managed Agents session) that runs the wizard itself.
  • Without a TTY, Claude Code progress prints as log lines instead of a spinner.

Test plan

  • npm test (103 passing, including new headless.test.ts: no-credential exit, static install with no prompts, failure without agent, --external-agent with and without a static install, --org without a credential)
  • npm run typecheck
  • Real run with an agent CLI installed
  • Hosted run via the Managed Agents proof of concept

--headless configures the codebase with no prompts: the static snippet
install, then CSP, identity, analytics linkage, and masking through a
terminal agent when one is installed. Writes .subtext/install-result.json
and exits 0 when the snippet is installed.

--org skips auth via the public snippet service. --external-agent writes
the remaining agent work to .subtext/agent-prompt.md for an agent that is
already running (hosted installs) instead of launching a local CLI.

This branch has not been deployed

No deployments
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