Skip to content

fix(init): point at the wizard from a terminal, and say when CI is why it did not start - #721

Merged
aibex-agent[bot] merged 1 commit into
mainfrom
aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-wizard-pointer
Nov 30, 2026
Merged

aibex-agent[bot] merged 1 commit into
mainfrom
aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-wizard-pointer

Conversation

@aibex-agent

@aibex-agent aibex-agent Bot commented Nov 29, 2026

Copy link
Copy Markdown

What

  • init run from a terminal (both streams a TTY, CI unset, no --json) now prints one line: it installs without asking, and the bare command opens the setup wizard. It sits above the telemetry notice, so the uncommitted-install notice and the onboarding trailer keep their places at the end. Agents, scripts and CI never see it.
  • A bare run that skips the wizard because CI is set now says so, naming the value, instead of telling a person already at a terminal to "run from a terminal". The preamble's first line is unchanged.

Why

From #708. A design partner ran npx @taskless/cli in a second project, saw what looked like nothing, then ran init to get the wizard back. init never prompts and nothing named the command that would.

I couldn't reproduce the "nothing happened" part on 0.13.8. In a pseudo-terminal, a bare run starts the wizard in a fresh directory, a fresh git repo, and an already-initialized project. A cancelled wizard has pointed back to the bare command since 0.13.8 (677ce32). The one silent-looking path I found is a terminal with CI set, which this fixes. If the reporter was on an older cached npx copy, 0.13.8+ should behave.

The reporter's other question (does init then the onboarding prompt get to the same place?) is answered by the existing output: init ends with the same Onboard this project with Taskless prompt the wizard does. The wizard additionally lets you choose harnesses and offers the global Claude Code trust entry.

Checks

  • wizardBlocker, the preamble and the hint are unit-tested. A spawned bare run under CI=true asserts the CI wording, and a spawned init asserts no hint (a spawned CLI is never on a TTY).
  • I checked both messages by hand in a pseudo-terminal (script).
  • OpenSpec change wizard-pointer adds two requirements to cli-init and is archived here. Scenarios went from 182 to 186, with none dropped.
  • pnpm typecheck, pnpm lint, pnpm test (3424 passed) all pass.

Fixes #708

@aibex-agent

aibex-agent Bot commented Nov 29, 2026

Copy link
Copy Markdown
Author

@claude /review

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @aibex-agent[bot]'s task in 1m 49s —— View job


Review complete

Review mode: incremental — read 0 prior review thread(s) before reviewing. The .prior-review.json snapshot contained no review threads, no review summaries, and only the triggering @claude /review comment — so this is the first substantive review of this PR; nothing is being treated as already addressed.

  • Read prior review data
  • Fetch PR diff and changed files
  • Read full contents of modified source files (interactive.ts, index.ts, commands/init.ts)
  • Review for correctness, security, performance, tests, clarity
  • Post inline comments for concrete issues
  • Post final summary

Assessment

I verified the new logic end-to-end rather than just reading the diff in isolation:

  • wizardBlocker/shouldLaunchWizard (packages/cli/src/util/interactive.ts:15-37): shouldLaunchWizard is correctly re-expressed as wizardBlocker(...) === undefined, and ci is checked before the TTY pair in both, so the ordering the design doc promises (CI wins) is actually implemented, not just asserted in a comment.
  • index.ts:148-176: the bare-invocation path now shares one context object between shouldLaunchWizard and wizardBlocker, avoiding a second, possibly-inconsistent read of process.stdout.isTTY/process.stdin.isTTY/process.env.CI. The wizardBlocker(context) ?? "no-tty" fallback is unreachable in practice (we only reach that line when shouldLaunchWizard(context) was already false, so wizardBlocker can't be undefined) — harmless, just satisfies the narrower parameter type.
  • init.ts:234-244: confirmed this sits inside the non---json (else) branch of the existing if (json) {...} else {...} split (lines 139/189), so the hint is correctly excluded under --json, and it's placed before TELEMETRY_NOTICE/uncommittedNotice/getOnboardTrailer(), matching the stated ordering requirement.
  • getCliPrefix() (packages/cli/src/util/package-manager.ts:245-255): confirmed it genuinely is launcher-aware (checks TASKLESS_LAUNCHER project launcher first, then falls back to a pinned npx/pnpm-dlx invocation), so getWizardHint(getCliPrefix()) names the command a project's own launcher wrapper would actually resolve to, not just a generic npx string.
  • CI-message wording for the non-TTY+CI case: when CI is set in a real (non-pty) CI runner, nonInteractivePreamble now says "Unset it to use the wizard from a terminal" instead of the old generic "run from a terminal" line. That reads fine even for a true headless CI job — it's forward-looking advice ("do this later, in a terminal, after unsetting CI"), not a claim the reader is currently at one — so this isn't a regression.
  • Test design: the new cli.test.ts case explicitly sets CI=true, so it isn't sensitive to whether the test runner's own ambient CI env var is set; the pre-existing non-TTY test only asserts the generic "non-interactive context detected" string, so it doesn't become flaky under either CI wording. The init-no-interactive.test.ts addition relies on a spawned child never having a TTY, which is correct and matches how the other tests in that file already work around the same constraint.
  • No stale references to the old "run from a terminal" wording were left behind outside historical (already-archived) OpenSpec changes, which are immutable records and correctly untouched.
  • The new/archived OpenSpec requirement text in openspec/specs/cli-init/spec.md and the archive copy match verbatim, and I didn't find a duplicate or conflicting requirement block in the main spec file.

I did not find any correctness, security, or test-coverage issues to raise, so there are no inline comments on this review. The scope matches the stated intent (init's terminal hint, and the CI-aware preamble wording) without extra unrelated changes.

@aibex-agent
aibex-agent Bot force-pushed the aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-wizard-pointer branch from 87d93cb to efb1edb Compare November 30, 2026 00:45
@aibex-agent
aibex-agent Bot merged commit 7a46d5a into main Nov 30, 2026
4 checks passed
@aibex-agent
aibex-agent Bot deleted the aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-wizard-pointer branch November 30, 2026 00:49
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.

npx @taskless/cli does nothing on a second project, and init can't get back into the wizard

1 participant