Skip to content

Shell completions never ask for a login (fixes brew install) - #3

Merged
CodeStaple merged 1 commit into
mainfrom
completion-no-auth
Aug 30, 2026
Merged

CodeStaple merged 1 commit into
mainfrom
completion-no-auth

Conversation

@CodeStaple

Copy link
Copy Markdown
Contributor

brew install taelio/tap/tael fails at its last step: the formula's generate_completions_from_executable runs tael completion bash|zsh|fish, and the CLI refuses with "not logged in" (exit 3). Only cobra's hidden __complete helpers were exempt from the login gate — the user-facing generator was not, and since its subcommands are named bash/zsh/fish, a name check on the leaf never saw it.

The gate now walks up to the completion command directly under the root (cobra adds it at execution time, so it cannot carry the annotation). Everything else still needs a login; a nested command that merely happens to be called completion is not exempt.

Verified: go vet, gofmt, tests green; TAEL_API_TOKEN= tael completion bash prints the script, tael apps without a login still exits 3.

`brew install taelio/tap/tael` failed at the last step: the formula runs
`tael completion bash|zsh|fish` to generate completions, and the CLI
answered "not logged in" (exit 3). Only cobra's hidden __complete helpers
were exempt from the login gate; the user-facing generator was not, and
its shells are named bash/zsh/fish, so a name check on the leaf never
saw it. The gate now walks up to the `completion` command directly under
the root. Everything else still needs a login.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6qrk4NVPAGeac6YuALp1M
@CodeStaple
CodeStaple merged commit 66d5a04 into main Aug 30, 2026
1 check passed
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.

1 participant