Technical Reference
gram auth
The auth command authenticates with the platform by opening a browser
window for login. After successful authentication, it creates and saves a
producer API key for the local
profile configuration.
The gram auth command is typically run once during initial setup. The
API key and profile information it creates are stored in
~/.gram/profile.json.
Authenticate from the CLI:
gram authThis command will:
- Open a browser window to the platform authentication page
- Prompt for login credentials
- Create a producer API key in the dashboard
- Save the API key and profile information locally
- Save the project selected in the browser as the default project
If the local profile already contains a valid API key, gram auth refreshes
the profile without opening a browser window.
After authentication, verify the setup with gram whoami.
Subcommands
Section titled “Subcommands”Change the default project context:
gram auth switch --project {project-slug}Completely clear auth information in the local profile to allow a fresh gram auth:
gram auth clearOptions
Section titled “Options”api-url
Section titled “api-url”This option sets the URL of the API server. It’s useful for connecting to custom or self-hosted instances.
gram auth --api-url https://custom.gram.instance [other options]The API server URL can also be set via the GRAM_API_URL environment variable.
dashboard-url
Section titled “dashboard-url”This option sets the URL of the dashboard used for browser-based authentication. If not provided, it defaults to the API server URL.
gram auth --dashboard-url https://custom.gram.instance [other options]The dashboard URL can also be set via the GRAM_SITE_URL environment variable.