flowleap-auth
Skill1 starsChanged 4 months agoMITView on GitHub
Authenticate the FlowLeap CLI — OAuth 2.0 device flow login (user code + verification URL), long-lived fl_pat_ personal API tokens for headless agents, status checks, and targeted logout. Trigger when a FlowLeap command fails with 401/unauthenticated, when setting up credentials for an agent or CI, or when the user asks to log in to FlowLeap or mint, list, or revoke API tokens.
- Reads credentials
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- flowleap-academicSkill
- flowleap-citationSkill
- flowleap-keysSkill
- flowleap-legalSkill
- flowleap-nplSkill
- flowleap-opsSkill
- flowleap-patentSkill
- flowleap-patstat-graphSkill
- flowleap-patstatSkill
- flowleap-sharedSkill
- flowleapSkill
- flowleap-toolsSkill
- flowleap-usptoSkill
- persona-ip-analystSkill
- persona-patent-attorneySkill
- persona-researcherSkill
- persona-startup-founderSkill
- recipe-academic-literature-reviewSkill
- recipe-audit-reportSkill
- recipe-claim-analysisSkill
- recipe-claim-draftingSkill
- recipe-custom-dashboardSkill
- recipe-find-betterSkill
- recipe-freedom-to-operateSkill
- recipe-infringement-chartingSkill
- recipe-invalidity-analysisSkill
- recipe-invention-disclosureSkill
- recipe-maintenance-feesSkill
- recipe-office-action-responseSkill
- recipe-patent-landscapeSkill
- recipe-patent-to-reportSkill
- recipe-prior-art-searchSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
Run flowleap --json auth login in the background and read the first NDJSON line (the device_authorization event).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
FlowLeap Auth
Global flags and configuration: see flowleap-shared.
In a chat client with the FlowLeap connector or in the FlowLeap Patent AI app, call the tools named in the flowleap-shared tool table instead of these commands, and never run a flowleap command there. No tool replaces the auth commands: in a chat client sign-in is the connector's OAuth, and in the FlowLeap Patent AI app the firm administrator or the desktop user sets up the FlowLeap Data sign-in outside the chat.
Commands
Login via OAuth device flow
flowleap auth loginStarts the OAuth 2.0 device flow: the CLI requests a device code from the
backend, prints a user code plus verification URL (and opens the browser),
then polls until the login is approved. The resulting session JWT is stored
in ~/.config/flowleap/credentials.toml (mode 0600). No local callback
server is involved, so it also works when the browser runs on another
machine — open the printed URL and enter the user code there. When stdout is
not a TTY, the browser auto-open and spinner are suppressed automatically.
Structured login for agents (--json)
flowleap --json auth loginWith --json, auth login becomes a blocking process that speaks NDJSON on
stdout — one compact JSON object per line, nothing else. It emits the
device-authorization event immediately, then polls until the human approves
and emits exactly one terminal event before exiting:
{"event":"device_authorization","verification_uri":"https://flowleap.co/device","verification_uri_complete":"https://flowleap.co/device?code=ABCD-1234","user_code":"ABCD-1234","expires_in":900,"interval":5}
{"event":"authorized","stored":true}Terminal events: authorized (exit 0 — the session token is stored, same as
the human flow) or failed with an error description (nonzero exit per the
standard exit-code table — denied, expired, or another error). Structured
mode has no side effects: no browser auto-open, no clipboard copy, no
spinner — the agent decides what to do with the URL.
Agent-mediated sign-in sequence:
- Run
flowleap --json auth loginin the background and read the first NDJSON line (thedevice_authorizationevent). - Relay
verification_urianduser_codeto the human (or openverification_uri_completeyourself when running on the human's own machine). - Await the process's terminal event.
authorizedmeans the session token is stored and authenticated commands work immediately;failedmeans start over. - Session tokens expire. For durability, follow up with
flowleap --json auth create-token --name <name> --storeto mint and store a long-livedfl_pat_personal token.
Login with a personal API token
flowleap auth login --api-key fl_pat_your_token_hereLogin with a session token
flowleap auth login --token eyJhbGci...Personal API tokens (headless/agent use)
flowleap auth create-token --name my-agent --store # mint + store (shown once)
flowleap auth tokens # list tokens
flowleap auth revoke-token <id> # revoke by idPersonal tokens use the fl_pat_… format and are long-lived. Minting
requires an OAuth session — API tokens cannot mint further tokens
(backend-enforced).
Check Status
flowleap auth status
flowleap --json auth statusShows base URL, credential source, default model, and — when the credential works — the user profile. It verifies the credential against the backend rather than reporting that one is merely stored, so an expired token is caught here instead of at the next data command.
Branch on verification.state (or the exit code):
| State | Exit | What to do |
valid | 0 | Proceed. |
rejected | 3 | The credential is expired, revoked, or wrong. A human must re-run flowleap auth login; do not retry. |
absent | 3 | No credential configured — see the login options above. |
unverified | 7 | The backend could not be reached, so validity is unknown. Retry later; do NOT tell the user their credential is invalid. |
verification.checked is true only when a live check reached a verdict.
unverified means no conclusion was reached — treat it as "unknown", never as
a failure of the credential itself.
Logout
flowleap auth logout # clear everything, including patent-data keys
flowleap auth logout --session-only # clear only the OAuth session tokenPlain logout clears all stored credentials, including EPO/USPTO provider
keys. Use --session-only to drop just the browser-session token — useful
when an expired session token is shadowing a still-valid fl_pat_ API key
(the CLI prefers the session token when both are stored).
The CLI self-heals this case: on a 401 with a stored session token, it retries
once with the stored API key and prints a stderr warning suggesting
logout --session-only. The fallback is skipped when the token was passed
explicitly via --token or FLOWLEAP_TOKEN.
Environment Variable Override
Set FLOWLEAP_API_KEY (an fl_pat_… token) or FLOWLEAP_TOKEN to bypass
stored credentials entirely. These take effect without running auth login.
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.

