You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): print remedy commands through getCliPrefix() - #461
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.
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:
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.
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
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.
Messages that tell the user what to run hard-coded
tasklessas the command. Someone who launched the CLI withnpx @taskless/cliorpnpm dlxusually has notasklessonPATH, so the suggested command failed as printed. These now go throughgetCliPrefix(), 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), theagenttopic 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.checkwith no rules now printsrule create --from <file>, naming the flagrule createrefuses to start without.Deliberately unchanged
schemas/check.ts:140is in the published./schemasentry, where the build forbids host reads, and the launcher is detected from the process.rules/reference.ts:67lands in the staticreference.json.Neither can know the launcher at runtime.
commands/share.tskeeps its intentionalnpx @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 patternpackage-manager.test.tsuses.check.test.tsgains 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