Sign in with the CLI

Authenticate gma with your GitMyABI account.

CLI

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 login

The 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 reads GMA_API_URL).
  • --env <tier> — target deployment: production or staging. Default is $GMA_ENV, otherwise production.
  • --client-id <id> — override the GitHub OAuth client id.
  • --port <port> — loopback port for the OAuth callback (default 47823).
  • --no-browser — print the authorize URL instead of opening it.
  • --profile <name> — profile name (default default).
  • --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 whoami

gma 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