Skip to content

fix(cli): print remedy commands through getCliPrefix() - #461

Merged
theCodeDrift merged 1 commit into
mainfrom
worktree-455---can-we
Oct 6, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
worktree-455---can-we

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

Messages that tell the user what to run hard-coded taskless as the command. Someone who launched the CLI with npx @taskless/cli or pnpm dlx usually has no taskless on PATH, so the suggested command failed as printed. These now go through getCliPrefix(), the launcher-aware helper the auth and rule-recovery errors already used.

What changed

  • auth (already logged in, not logged in, unverifiable token), check, rule create / improve / meta, onboard (including the post-install trailer), the agent topic index and its errors, feedback send, the install wizard's cancel messages, the non-interactive banner, and the Vale-refusal and missing-fixture notices.
  • commands/feedback.ts, which the issue didn't list, is included.
  • check with no rules now prints rule create --from <file>, naming the flag rule create refuses to start without.

Deliberately unchanged

  • schemas/check.ts:140 is in the published ./schemas entry, where the build forbids host reads, and the launcher is detected from the process.
  • rules/reference.ts:67 lands in the static reference.json.

Neither can know the launcher at runtime. commands/share.ts keeps its intentional npx @taskless/cli.

Tests

Five assertions across three test files pinned the old taskless … wording. They now match (?:npx|pnpm dlx) @taskless/cli@latest …, the same pattern package-manager.test.ts uses. check.test.ts gains an assertion that the no-rules remedy is runnable and includes --from. pnpm typecheck, pnpm lint, and the full CLI suite (2014 tests) pass locally.

Fixes #455

@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@claude

claude Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Claude finished @theCodeDrift's task in 3m 10s —— View job


Review: fix(cli): print remedy commands through getCliPrefix()

Review mode: incremental — read 0 prior review thread(s) before reviewing. .prior-review.json contains no prior inline review threads, reviews, or review-summary comments on this PR (only the @claude /review trigger comment itself), so this is the first review and the whole diff is assessed fresh — nothing is being skipped as "already addressed."

  • Read .prior-review.json
  • Fetch PR diff and metadata
  • Review changed command files
  • Review changed test files
  • Post final review

Summary: This is a clean, mechanical, well-scoped fix. I verified each claim in the PR description against the code:

  • getCliPrefix() (in util/package-manager.ts) is cheap (no I/O, pure reads of process.env/argv), so calling it multiple times per command (e.g. agent.ts) is fine — no caching needed.
  • The three places the PR says are deliberately left with hardcoded taskless wording check out:
    • commands/share.ts:27 — intentional npx @taskless/cli share caption.
    • schemas/check.ts:140 — lives in the published ./schemas entry point, which can't read the process.
    • rules/reference.ts:67 — baked into the static reference.json.
  • check.ts's new "No rules configured" message naming --from <file> matches rule create's actual requirement (commands/rules.ts:270, fail(...) when !args.from) — the remedy is runnable as printed.
  • I searched the rest of packages/cli/src for other hardcoded `taskless <verb> ...` remedy strings in console.log/console.error/fail()/throw call sites and found no other printed-to-user instance that was missed; the remaining hits are JSDoc comments, not user-facing output.
  • Cross-checked the five updated test assertions (agent-extensions.test.ts, anonymous-flag.test.ts, check.test.ts, init-no-interactive.test.ts) against the new source strings — the regexes match what's actually printed, and the test-harness launch path (not under an npx/pnpm-dlx cache) correctly falls through to getCliPrefix()'s documented npx default, which the (?:npx|pnpm dlx) alternation accounts for.
  • Scanned other existing tests that touch adjacent messages (deliver.test.ts's describeMissingFixtures tests, mixed-engine-check.test.ts's Vale-refusal substring check, schemas-export.test.ts) to confirm none of them assert the now-changed literal `taskless ...` suffix — none do, so nothing was silently broken by this change.
  • Import additions follow the direct-import convention from the style guide; no barrel imports introduced.

No correctness, security, or test-coverage issues found. Nothing NEW to flag, and (since this is the first review) nothing prior to reconcile against.

@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @claude — "Review: fix(cli): print remedy commands through getCliPrefix()…"
#461 (comment)

Thanks for checking. The review found no problems, so this round needs no changes.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit 36fa856 into main Oct 6, 2026
8 checks passed
@theCodeDrift
theCodeDrift deleted the worktree-455---can-we branch October 6, 2026 04:24
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.

Error remedies hard-code taskless instead of using getCliPrefix()

1 participant