Authentication
Overview
Section titled “Overview”The NeuralRepo CLI supports two authentication methods:
| Method | Best for | Command |
|---|---|---|
| OAuth (browser) | Interactive use on a workstation | nrepo login |
| API key | CI, scripts, headless environments | nrepo login --api-key |
OAuth login
Section titled “OAuth login”Running nrepo login opens your default browser to the NeuralRepo authorization page. After you approve access, the CLI receives a session token and stores it locally.
nrepo login# Opens browser → approve → "Logged in as alice@example.com"API key login
Section titled “API key login”If you cannot open a browser (CI runners, remote servers), use API key authentication instead. The CLI will prompt for the key interactively:
nrepo login --api-key# Paste your API key (nrp_<64-hex-chars>): ****# Logged in as alice@example.comYou can also pipe the key from a secret manager:
echo "$NEURALREPO_API_KEY" | nrepo login --api-keyAPI keys use the format nrp_ followed by 64 hexadecimal characters.
Configuration file
Section titled “Configuration file”Credentials and settings are stored at:
~/.config/neuralrepo/config.jsonThe file contains:
| Field | Description |
|---|---|
api_url | NeuralRepo API endpoint |
api_key | Stored API key or session token |
user_id | Your account identifier |
auth_method | oauth or api_key |
Output format defaults
Section titled “Output format defaults”The default output format depends on how you authenticated:
| Auth method | Default output |
|---|---|
| OAuth | --human (human-readable) |
| API key | --json (machine-readable) |
You can override the default on any command with --json or --human.
Headless and CI usage
Section titled “Headless and CI usage”For automated environments, use API key authentication. Create a key via nrepo key create or the web dashboard, store it as a secret, and pass it at login time.
nrepo login --api-key <<< "$NEURALREPO_API_KEY"nrepo push "Automated idea" --body "From CI pipeline"Logging out
Section titled “Logging out”To clear stored credentials:
nrepo logoutRelated commands
Section titled “Related commands”- nrepo login / logout / whoami — full auth command reference
- nrepo key — create and manage API keys
- Installation — install the CLI