Authentication
Both login methods end in the same place: an nrp_ API key in
~/.config/neuralrepo/config.json, sent as an X-API-Key header on every request.
| Method | Best for | Command | Plan required |
|---|---|---|---|
| Browser | Interactive use on a workstation | nrepo login | Any — including free |
| API key | CI, scripts, headless machines | nrepo login --api-key | Pro, to create the key |
Browser login
Section titled “Browser login”nrepo login-
The CLI starts a one-shot HTTP server on a random local port between 49152 and 65535 and prints the sign-in URL:
Starting local auth server...Open this URL to log in:https://neuralrepo.com/auth/cli?callback=http%3A%2F%2Flocalhost%3A51234%2FcallbackWaiting for authentication... -
It also tries to open that URL for you (
openon macOS,starton Windows,xdg-openelsewhere). If nothing opens, paste the printed URL yourself. -
You sign in with GitHub. NeuralRepo matches the account by your GitHub verified primary email, so this works whether or not you originally signed up through GitHub, as long as that email is the one your account uses. If it isn’t, the login creates a separate new account.
-
The server redirects back to the local callback with a freshly minted key. The CLI saves it and prints:
✔ Logged in as Alice (pro)
Two consequences of that flow are worth knowing:
nrepo loginmints a real API key, not a session token. It is labelledCLI (auto-generated)and appears innrepo key listalongside keys you made yourself.- No plan check runs on that path. Browser login works on the free plan even though creating
a key from the dashboard or with
nrepo key createis a Pro feature.
nrepo login always authenticates through GitHub — it sends no provider preference, and the
endpoint’s default is GitHub. Google sign-in is not part of this flow at all.
API key login
Section titled “API key login”--api-key is a bare flag. It prompts; it does not take the key as an argument.
nrepo login --api-key# Enter your API key: nrp_...# ✔ Logged in as Alice (pro)echo "$NEURALREPO_API_KEY" | nrepo login --api-keyThe prompt reads a single line from stdin, so piping and here-strings both work.
The key is verified against GET /user/me before it is saved. A bad key fails with
Invalid API key. Generate one at https://neuralrepo.com/settings and exit status 1.
Keys use the format nrp_ followed by 64 hexadecimal characters. Create one with
nrepo key create or in Settings ▸ API Keys on the web dashboard;
both require Pro.
Configuration file
Section titled “Configuration file”~/.config/neuralrepo/config.json| Field | Description |
|---|---|
api_url | API base URL. Defaults to https://neuralrepo.com/api/v1 when absent |
api_key | The nrp_ key, in plain text |
user_id | Your account identifier, recorded at login |
auth_method | browser or api-key — recorded at login and never read again |
Output format
Section titled “Output format”Every command prints human-readable output by default, on both login methods. Pass --json
for machine-parseable output, and --human to force text back on if something upstream in your
tooling sets --json. --human wins when both are given.
Headless and CI
Section titled “Headless and CI”export NREPO_NO_UPDATE_CHECK=1echo "$NEURALREPO_API_KEY" | nrepo login --api-keynrepo push "Nightly build failed on $(git rev-parse --short HEAD)" \ --body "$(tail -50 build.log)" --tag ci --jsonGive CI its own key so you can revoke it independently, and check the exit status: every failure
exits 1, and with --json the error is a single JSON object on stderr.
Logging out
Section titled “Logging out”nrepo logout# Logged out.