Skip to content
NeuralRepo
Get Support

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.

MethodBest forCommandPlan required
BrowserInteractive use on a workstationnrepo loginAny — including free
API keyCI, scripts, headless machinesnrepo login --api-keyPro, to create the key
Terminal window
nrepo login
  1. 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%2Fcallback
    Waiting for authentication...
  2. It also tries to open that URL for you (open on macOS, start on Windows, xdg-open elsewhere). If nothing opens, paste the printed URL yourself.

  3. 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.

  4. The server redirects back to the local callback with a freshly minted key. The CLI saves it and prints:

    ✔ Logged in as Alice (pro)
GitHubneuralrepo.comYour browserlocalhost:PORTnrepoGitHubneuralrepo.comYour browserlocalhost:PORTnrepoStart one-shot server on a random portOpen /auth/cli?callback=http://localhost:PORT/callbackGET /auth/cliRedirect to /auth/github with the callback storedSign in and approveOAuth codeMatch account by verified primary emailMint an nrp_ key labelled "CLI (auto-generated)"Redirect to localhost:PORT/callback?api_key=nrp_...GET /callback with the keyHand over the key, close the serverGET /user/me to verifyWrite ~/.config/neuralrepo/config.json

Two consequences of that flow are worth knowing:

  • nrepo login mints a real API key, not a session token. It is labelled CLI (auto-generated) and appears in nrepo key list alongside 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 create is 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 is a bare flag. It prompts; it does not take the key as an argument.

Terminal window
nrepo login --api-key
# Enter your API key: nrp_...
# ✔ Logged in as Alice (pro)

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.

~/.config/neuralrepo/config.json
FieldDescription
api_urlAPI base URL. Defaults to https://neuralrepo.com/api/v1 when absent
api_keyThe nrp_ key, in plain text
user_idYour account identifier, recorded at login
auth_methodbrowser or api-key — recorded at login and never read again

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.

Terminal window
export NREPO_NO_UPDATE_CHECK=1
echo "$NEURALREPO_API_KEY" | nrepo login --api-key
nrepo push "Nightly build failed on $(git rev-parse --short HEAD)" \
--body "$(tail -50 build.log)" --tag ci --json

Give 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.

Terminal window
nrepo logout
# Logged out.