Sign in with the CLI
Authenticate gma with your GitMyABI account.
gma login signs you in to GitMyABI via GitHub OAuth and saves the session to ~/.gma/config.json. After signing in, the CLI can call the GitMyABI API on your behalf for teams, projects, builds, repos, and ABIs.
Sign in
gma loginThe CLI starts a one-shot loopback HTTP server at http://127.0.0.1:47823/callback and opens GitHub's authorize URL in your browser. The OAuth scopes requested are user:email and read:user. After GitHub redirects back, the CLI exchanges the code with the GitMyABI API and stores the JWT, refresh token, expiry, and user snapshot in the profile.
Flags
--api-url <url>— override the GitMyABI API base URL (also readsGMA_API_URL).--env <tier>— target deployment:productionorstaging. Default is$GMA_ENV, otherwiseproduction.--client-id <id>— override the GitHub OAuth client id.--port <port>— loopback port for the OAuth callback (default47823).--no-browser— print the authorize URL instead of opening it.--profile <name>— profile name (defaultdefault).--registry <url>and--npm-token <token>— store npm publishing credentials alongside the session.--token <token>— save a pre-minted GitMyABI API token instead of running OAuth.--credentials-only— skip OAuth and only persist registry/npm credentials.
gma --login is an alias for gma login.
Inspect the session
gma whoamigma whoami prints the active profile, the path to the config file, and which fields are set: apiUrl, apiToken, registry, npmToken, the session state (signed in, expired, or with a refresh available), and the user identity. Use --profile <name> to target a non-active profile.
Sign out
gma logout--profile <name>— log out a specific profile.--keep— clear the session tokens but keep the saved registry/npm credentials.
By default gma logout calls the backend to invalidate the session and then removes the profile from ~/.gma/config.json; if the backend rejects the call, local cleanup still proceeds.
Profiles and storage
All profiles, the active profile name, and CLI preferences are stored together in ~/.gma/config.json. The file is created with mode 0600 and the ~/.gma directory with mode 0700. Use --profile <name> to keep multiple sessions side-by-side; the default profile is default.
Related environment variables
See the environment variables reference for the full list. The login flow specifically reads GMA_ENV, GMA_API_URL, GMA_GITHUB_CLIENT_ID, GMA_PRODUCTION_GITHUB_CLIENT_ID, and GMA_STAGING_GITHUB_CLIENT_ID.
Related
- CLI overview
What the gma CLI does and when to use it.
- Install the CLI
Install the gma CLI from npm.
- Environment variables
Environment variables the gma CLI reads.
- Command reference
Concise reference of every gma command and key flags.