automagent login / logout / whoami
Authenticate with the Automagent Hub
Usage
$ automagent login [options]
Options
| Flag | Description | Default |
|---|---|---|
--hub-url <url> | Hub URL | https://hub.automagent.dev |
How it works
- Starts a temporary local HTTP server to receive the OAuth callback
- Opens your browser to the Hub’s GitHub authentication page
- After you authorize, the Hub redirects back to the local server with a token
- Credentials (token, username, Hub URL) are saved to
~/.automagent/credentials.jsonwith restricted permissions (mode0600)
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
| Flag | Description | Default |
|---|---|---|
--check | Validate token against the hub | Off |
--hub-url <url> | Hub URL (used with --check) | https://hub.automagent.dev |
--insecure | Allow insecure HTTP connections | Off |
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
- automagent push — Publish agents (requires authentication)
- automagent pull — Download agents