Skip to content

Authentication

The NeuralRepo CLI supports two authentication methods:

MethodBest forCommand
OAuth (browser)Interactive use on a workstationnrepo login
API keyCI, scripts, headless environmentsnrepo login --api-key

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.

Terminal window
nrepo login
# Opens browser → approve → "Logged in as alice@example.com"

If you cannot open a browser (CI runners, remote servers), use API key authentication instead. The CLI will prompt for the key interactively:

Terminal window
nrepo login --api-key
# Paste your API key (nrp_<64-hex-chars>): ****
# Logged in as alice@example.com

You can also pipe the key from a secret manager:

Terminal window
echo "$NEURALREPO_API_KEY" | nrepo login --api-key

API keys use the format nrp_ followed by 64 hexadecimal characters.

Credentials and settings are stored at:

~/.config/neuralrepo/config.json

The file contains:

FieldDescription
api_urlNeuralRepo API endpoint
api_keyStored API key or session token
user_idYour account identifier
auth_methodoauth or api_key

The default output format depends on how you authenticated:

Auth methodDefault output
OAuth--human (human-readable)
API key--json (machine-readable)

You can override the default on any command with --json or --human.

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.

Terminal window
nrepo login --api-key <<< "$NEURALREPO_API_KEY"
nrepo push "Automated idea" --body "From CI pipeline"

To clear stored credentials:

Terminal window
nrepo logout