CLI Authentication
The BrainMaps CLI tool supports two methods of authentication:
- Interactive login with email and password
- Token-based authentication using environment variables
Using Environment Variables
For automated or scripted usage, you can authenticate using a token from the environment:
export BRAINMAPS_API_KEY=your_token_here
brainmaps --visualOr directly when running the command:
BRAINMAPS_API_KEY=your_token_here brainmaps --visualGetting a Token
- Log in to the BrainMaps platform
- Go to your Account Settings
- Navigate to the API Tokens section
- Click “Create New Token”
- Give your token a descriptive name
- Copy the token immediately (it won’t be shown again)
Token Security
- Keep your token secure and never share it
- Store tokens in environment variables or secure configuration files
- Avoid committing tokens to version control
- Revoke tokens immediately if they’re compromised
Using Tokens in Scripts
You can use tokens in shell scripts:
#!/bin/bash
export BRAINMAPS_API_KEY=your_token_here
brainmaps --visualOr in your .env file:
BRAINMAPS_API_KEY=your_token_hereToken Validation
The CLI will automatically:
- Verify the token on startup
- Skip the login screen if the token is valid
- Fall back to the login screen if the token is invalid or missing
Revoking Tokens
You can revoke tokens:
- Through the web platform
- Using the CLI:
brainmaps token revoke <token_id> - Tokens are automatically invalidated on logout