fix(cli): Use correct CLI command for auth login references - #13
Conversation
Replace bare `taskless auth login` with the proper package-manager-aware invocation. CLI error messages now dynamically detect the invoking package manager via npm_config_user_agent. Skills default to npx with a note to prefer the project's package manager. Closes #12 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates user-facing auth login references to avoid assuming a globally-installed taskless binary, improving usability in agent/ephemeral environments by defaulting to npx @taskless/cli@latest and making CLI error messages suggest the invoking package manager.
Changes:
- Added a new
getCliPrefix()utility that detects the invoking package manager vianpm_config_user_agentand uses it in CLI error messages. - Updated skills and
tskl/*command docs to default tonpx @taskless/cli@latest, with guidance on using lockfile-indicated package managers. - Updated static CLI help text (
rules-create.txt,rules-improve.txt) to referencenpx @taskless/cli@latest auth login.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/taskless-logout/SKILL.md | Switches example invocations to npx and adds package-manager guidance. |
| skills/taskless-login/SKILL.md | Switches example invocations to npx and adds package-manager guidance. |
| skills/taskless-info/SKILL.md | Switches example invocations to npx and adds package-manager guidance. |
| skills/taskless-improve-rule/SKILL.md | Updates multiple CLI invocations and auth remediation guidance to npx. |
| skills/taskless-improve-rule-anonymous/SKILL.md | Switches verify/delete examples to npx and adds package-manager guidance. |
| skills/taskless-delete-rule/SKILL.md | Switches help/delete examples to npx and adds package-manager guidance. |
| skills/taskless-create-rule/SKILL.md | Switches create/meta/auth remediation examples to npx and adds package-manager guidance. |
| skills/taskless-create-rule-anonymous/SKILL.md | Switches verify/schema examples to npx and adds package-manager guidance. |
| skills/taskless-check/SKILL.md | Switches check/init examples to npx and adds package-manager guidance. |
| packages/cli/src/util/package-manager.ts | Introduces getCliPrefix() for dynamic, package-manager-specific command suggestions. |
| packages/cli/src/help/rules-improve.txt | Replaces bare taskless auth login prerequisite with npx @taskless/cli@latest auth login. |
| packages/cli/src/help/rules-create.txt | Replaces bare taskless auth login prerequisite with npx @taskless/cli@latest auth login. |
| packages/cli/src/auth/token.ts | Updates legacy-auth warning to use getCliPrefix()-based login instruction. |
| packages/cli/src/auth/identity.ts | Updates auth-required / missing-orgId errors to use getCliPrefix()-based login instruction. |
| packages/cli/src/api/rules.ts | Updates API error guidance strings to use getCliPrefix()-based login instruction. |
| commands/tskl/rule.md | Switches documented invocations to npx and adds package-manager guidance. |
| commands/tskl/logout.md | Switches documented invocations to npx and adds package-manager guidance. |
| commands/tskl/login.md | Switches documented invocations to npx and adds package-manager guidance. |
| commands/tskl/info.md | Switches documented invocations to npx and adds package-manager guidance. |
| commands/tskl/improve.md | Switches documented invocations to npx and adds package-manager guidance. |
| commands/tskl/check.md | Switches documented invocations to npx and adds package-manager guidance. |
| .changeset/fix-auth-login-command.md | Adds a changeset describing the user-facing command reference updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fall back to npx for Yarn Classic (v1.x) since it lacks yarn dlx - Clarify skill package manager notes with "(Yarn Berry/2+ only)" - Narrow changeset description to match actual scope - Add unit tests for getCliPrefix() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
packages/cli/src/help/rules-create.txt:12
- The prerequisites now recommend running via
npx @taskless/cli@latest, but the subsequentUsage:andExamples:sections still showtaskless rules create ..., which continues to assume a globally-installedtasklessbinary. Consider updating those usage/examples to use the same runner (or otherwise clarify thattasklessis only available when installed globally).
Prerequisites:
Run `npx @taskless/cli@latest auth login` to authenticate first.
Your repository must have a GitHub origin remote.
Usage:
taskless rules create --from <file> [options]
packages/cli/src/help/rules-improve.txt:12
- The prerequisites now recommend running via
npx @taskless/cli@latest, but theUsage:andExamples:sections still showtaskless rules improve ..., which assumes a globally-installedtasklessbinary. Consider updating those usage/examples to match the recommended invocation (or explicitly document the difference).
Prerequisites:
Run `npx @taskless/cli@latest auth login` to authenticate first.
Your repository must have a GitHub origin remote.
Usage:
taskless rules improve --from <file> [options]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
All user-facing references to
taskless auth loginassumed the CLI wasinstalled globally, which is unlikely in agent environments. Agents would
waste tokens attempting commands that don't exist, then self-correct.
CLI error messages now dynamically detect the invoking package manager
via
npm_config_user_agent(pnpm dlx,yarn dlx,bunx) and fall backto
npx. This is handled by a newgetCliPrefix()utility used inidentity.ts,token.ts, andrules.ts.Skills and commands now default to
npx @taskless/cli@latest(the mostuniversal runner) and include a package manager detection note instructing
agents to prefer the project's lockfile-indicated manager.
Static help text files (
rules-create.txt,rules-improve.txt) usenpxsince they can't be dynamic.
Fixes #12