Authentication
mycli supports two authentication modes:
- Interactive — email magic links via
my cli login, for day-to-day use on a workstation. - Non-interactive —
myc_…API tokens viaMY_API_TOKEN, for CI, scripts, and headless boxes.
Login flow
Section titled “Login flow”my cli login- The CLI prompts for your email address
- A magic link is sent to your inbox via the device auth flow
- Click the link to verify your email
- The CLI receives a JWT token and stores it securely
Token storage
Section titled “Token storage”Auth tokens are stored in your operating system’s keyring (macOS Keychain, Linux Secret Service, Windows Credential Manager). If the keyring is unavailable, tokens fall back to ~/.my/credentials.json.
Check login status
Section titled “Check login status”my cli whoamiShows your user ID and email if logged in.
Check overall status
Section titled “Check overall status”my cli statusShows the API URL, login state, last sync time, and cached command count.
Logout
Section titled “Logout”my cli logoutClears stored credentials from the keyring and local file.
Token refresh
Section titled “Token refresh”Access tokens are short-lived JWTs that the CLI refreshes automatically — both reactively (on a 401) and proactively just before they expire. To keep sessions alive across long idle periods, the CLI also fires a silent refresh roughly once a week whenever you run any my command, and each refresh extends the session by another 30 days. In practice: if you use mycli at least every couple of weeks you should never need to log in again.
API tokens (for CI and scripts)
Section titled “API tokens (for CI and scripts)”API tokens are long-lived bearer credentials prefixed myc_ that bypass the interactive login. They’re the right choice for CI jobs, deploy scripts, and any environment without a browser or inbox.
Create one
Section titled “Create one”my cli token create ci-deploy# Token: myc_3f12c4...# Save this token — it won't be shown again.# Use it with: export MY_API_TOKEN=<token>Common flags:
--expires-in 30d— give the token an expiry (d,h,y).--profile work— scope the token’s catalog reads to a specific profile.
Use one
Section titled “Use one”Export the raw token; the CLI uses it as the Authorization: Bearer … header and skips JWT refresh entirely.
export MY_API_TOKEN=myc_3f12c4...my library install kubernetesmy cli run deploy --env stagingManage them
Section titled “Manage them”my cli token list # see prefix + last-used + expiry (raw secret is never shown)my cli token revoke ci-deploy # prompts unless --forceLimits
Section titled “Limits”- 10 tokens per user. Revoke one before creating an 11th.
- Names ≤ 100 characters.
- Raw token is shown once at creation. It’s stored only as a SHA-256 hash on the server.