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
auth: taskless auth -d <dir> fails with "Unknown command", reading the directory as a subcommand #424
taskless auth (the status path) declares -d, --dir, but passing it with a separate value fails:
$ taskless auth -d .
Unknown command `.`
$ taskless auth --dir=.
Logged in as … (…)
Reproduced on 0.12.0-next-0fb5221 (built from main plus #422, which does not touch auth). auth login -d <dir> works, because login is found first and the value never reaches the parent's resolution.
Cause
citty resolves a subcommand from the first raw argument that does not start with -. In auth -d . that argument is ., the flag's value, and . is neither login nor logout, so citty reports an unknown command before auth's own run is reached. --dir=. works only because the value stays inside the flag token.
auth's run has the same assumption. Its "was a subcommand given?" guard (packages/cli/src/commands/auth.ts, rawArgs.some((argument) => !argument.startsWith("-"))) would also read a flag value as a subcommand. So fixing only the citty side would turn the error into silently printing nothing.
Why it matters
auth login state is stored per project (.taskless/.env.local.json), so -d is the natural way to check whether another checkout is logged in. That was the use it failed on here.
Possible fix
agent.ts and check.ts already skip flag values when scanning rawArgs for positionals. The same scanner, or declaring the status path as a subcommand, would cover both halves.
Activity