cli-login
Skill4 starsChanged 4 months agoMITView on GitHub
Use when a CLI command fails because its login is missing or expired (gcloud, gh, gws, Microsoft 365) and the user has to sign in -- "necesito loguearme en gcloud", "la sesion de gcloud expiro", "log me in to gcloud", "reauthenticate gcloud".
In this repository42 other files it gives its agents.
- agent-contract-handoffSkill
- agent-creationSkill
- agent-protocolSkill
- agent-responseSkill
- blog-writingSkill
- brief-specSkill
- code-reviewSkill
- code-standardsSkill
- command-executionSkill
- deck-builderSkill
- dispatchSkill
- executionSkill
- fast-queriesSkill
- gaia-auditSkill
- gaia-checkSkill
- gaia-patternsSkill
- gaia-plannerSkill
- gaia-releaseSkill
- gaia-researchSkill
- gaia-verifySkill
- ghostwritingSkill
- git-conventionsSkill
- gmail-policySkill
- gmail-triageSkill
- gws-setupSkill
- human-registerSkill
- investigationSkill
- memorySkill
- orchestrator-present-approvalSkill
- pending-approvalsSkill
- remindersSkill
- security-tiersSkill
- session-channelsSkill
- session-reflectionSkill
- skill-creationSkill
- subagent-request-approvalSkill
- technical-explanationSkill
- technical-writingSkill
- ticket-writingSkill
- verification-oracleSkill
- verification-rubricSkill
- visual-verifySkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Already held: When gcloud already stores a credential for the account it re-uses it and prints no link.
- Very specific: line 36
Expired or stale: If commands with --account <email> still fail after already_signed_in, renew with gaia login start gcloud --account …
- Very specific: line 52
Wrong account: If he signs in with another account, gcloud refuses it with "the received credentials were for account [...]" and status …
- Very specific: line 66
Not wired yet. gh auth login makes the new account the active one, so adding a GitHub account goes through an isolated gh config directory …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLI Login
A login is the one step only the user can take: he opens a link in his own browser and signs in with his password manager or passkey. The agent's part is to start a login that needs no terminal, put the link in front of him, and confirm afterwards that the session exists. No password and no token passes through the agent, and the user's active account never changes unless he asks.
Why the obvious ways fail
- A login that waits for pasted input hangs.
gcloud auth login --no-launch-browserand--no-browserread a code from the terminal; a dispatched agent has none. - A background task can die before the click. The host may stop an agent's background task when the turn ends, and the localhost listener that would receive the browser's answer dies with it.
- A plain login switches the active account.
gcloud auth loginactivates the new account for every session on the machine, so it asks for a signature;--no-activateadds the account without switching.
Procedure (gcloud)
- Start it detached.
gaia login start gcloud --account <email>runsgcloud auth login <email> --no-activatein its own session and prints JSON withlogin_id,state: pendingandurl. It runs free: it cannot switch the account.- Already held. When gcloud already stores a credential for the account
it re-uses it and prints no link; the start exits 0 with
state: already_signed_inand nourl, andgaia login statusreports the same. Nothing to click: continue the task. - Expired or stale. If commands with
--account <email>still fail afteralready_signed_in, renew withgaia login start gcloud --account <email> --force. It runsgcloud auth login <email> --no-activate --force, returns a fresh link, and is free for the same reason: it never activates the account.
- Already held. When gcloud already stores a credential for the account
it re-uses it and prints no link; the start exits 0 with
- Close the turn on the link. Close
NEEDS_INPUT. Put theurlin yourconclusionfor the orchestrator, which hands it to the user as a link with one line: open it, sign in, and reply when done. Say it must be opened in a browser profile, or an incognito window, that holds only the target account: each link allows exactly one sign-in attempt, because gcloud stops listening after the browser's first answer. Record thelogin_idinkey_outputs. - On resume, confirm.
gaia login status <login_id>reportspending,completeorfailed.completemeans gcloud exited cleanly andgcloud auth listshows the account. Then continue the task with--account <email>on the commands that need it. - Wrong account. If he signs in with another account, gcloud refuses it
with "the received credentials were for account [...]" and status goes to
failed. The link is spent; recover with a freshgaia login start gcloud --account <email> --force. - On
failedor a refused start, report it. A start that reports the copy-code flow means gcloud found no browser it could launch; that machine needs the live interop check, not a retry.
The link redirects to http://localhost:<port>. Windows forwards localhost into
WSL, so the browser on Windows reaches the listener whether or not WSL interop
is enabled. The login stops on its own after 10 minutes.
Other CLIs
Not wired yet. gh auth login makes the new account the active one, so adding
a GitHub account goes through an isolated gh config directory (next slice). gws
and Microsoft 365 follow the same start, link, confirm cycle once their
launchers exist.
Anti-patterns
- Running the login in a background Bash task and waiting. The host can
stop it before the user clicks; use
gaia login start. - Reading
~/.config/gcloudto check the session. That path is read-refused;gaia login statusandgcloud auth listare the checks. - Activating the account to make later commands shorter. Pass
--accountper command instead.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

