automagent login / logout / whoami

Authenticate with the Automagent Hub

Usage

$ automagent login [options]

Options

FlagDescriptionDefault
--hub-url <url>Hub URLhttps://hub.automagent.dev

How it works

  1. Starts a temporary local HTTP server to receive the OAuth callback
  2. Opens your browser to the Hub’s GitHub authentication page
  3. After you authorize, the Hub redirects back to the local server with a token
  4. Credentials (token, username, Hub URL) are saved to ~/.automagent/credentials.json with restricted permissions (mode 0600)

The login flow has a 120-second timeout. If the browser doesn’t open automatically, the CLI prints the URL so you can open it manually.

Example

$ automagent login
Opening browser to authenticate...

If the browser doesn't open, visit:
https://hub.automagent.dev/auth/github?cli_port=54321

Logged in as alice

automagent logout

Clear stored credentials.

Usage

$ automagent logout

Deletes ~/.automagent/credentials.json. This is a no-op if you are not logged in.


automagent whoami

Show the currently authenticated user.

Usage

$ automagent whoami [options]

Displays your username and the Hub URL you are authenticated with. If you are not logged in, prints a message suggesting automagent login.

Options

FlagDescriptionDefault
--checkValidate token against the hubOff
--hub-url <url>Hub URL (used with --check)https://hub.automagent.dev
--insecureAllow insecure HTTP connectionsOff

Examples

$ automagent whoami
alice
Hub: https://hub.automagent.dev

Validate your token is still valid:

$ automagent whoami --check
alice
Token is valid.

If the token is invalid or expired, the CLI prints an error and exits with code 1.

See also