CLI reference
nordai — the agent in your terminal
Install and sign in
npm install -g https://nordai.my.id/downloads/nordai-0.5.0.tgzRegistry vs. pinned build
The command above installs the pinned nordai-0.5.0.tgz from our own host, which is always the build this page documents. The npm registry entry can lag behind while releases are managed by hand, so npm install -g nordai@latest may install an older version until it catches up.
Verify the install
nordai --version prints the installed version and nordai doctor checks auth and connectivity. If the command is not found, add npm prefix -g to PATH and reopen the terminal.
Requires Node.js 20.11 or newer. Then run nordai in your repository and use /login, or authenticate before starting:
nordai loginDevice login prints an 8-character code and a verification URL. Approve it at Dashboard → Devices. The CLI polls the API until approval, then stores a 30-day revocable device credential. You can revoke it from the dashboard at any time.
API-key login
For CI or scripted use, create a key in the dashboard and export it as NORDAI_API_KEY. Keys are shown once and stored only as a hash. Use per-key model, rate and monthly limits to constrain automation.
Commands and flags
nordai # interactive workbench nordai "Analyze this repository" # one autonomous task, then exit nordai --cwd ./my-project # workspace root nordai --model <available-model-id> # model for this session nordai --approval auto-edit # manual | auto-edit | read-only | full-access nordai --version nordai doctor nordai login nordai sessions nordai resume <session-id>
Model ids must come from GET /api/v1/me/models or /model. Unknown ids are rejected by the gateway rather than silently substituted.
Interactive commands
| Command | Behaviour |
|---|---|
| /help | List commands and current mode |
| /keys | Keyboard shortcuts and editor keys |
| /login | Device authorization flow (or set an API key) |
| /logout | Revoke the local credential and server device token |
| /model | List allowed models and switch the active one |
| /models, /providers | List approved models and the provider behind each |
| /approval | Switch between manual, auto-edit, read-only and full-access |
| /plan-mode | Investigate and propose without editing (Shift+Tab) |
| /theme | Colour theme: nord, midnight, forest, solar, mono |
| /glyphs | Glyph set: auto, unicode or ascii for legacy consoles |
| /plan | Plan, expiry and remaining allowance |
| /usage | Requests and tokens used against your plan |
| /stats | Turns, tokens, context use and elapsed time |
| /todos | The plan the agent recorded for the current task |
| /context | Current context budget and usage |
| /init | Create a NORD.md project brief for the agent |
| /files | List workspace files available as context |
| /diff | Show the working diff (--last for the last step) |
| /review | Ask the model to review the current diff |
| /undo | Restore files changed by the last approved step |
| /run | Run one allowlisted command yourself |
| /new | Start a fresh session |
| /sessions | Browse stored local sessions |
| /resume | Resume a stored session |
| /rename | Rename the current session |
| /delete | Delete a stored session |
| /compact | Summarise older turns to free context |
| /export | Write the transcript as Markdown |
| /clear | Clear the screen |
| /settings | Endpoint, model, approval mode, context budget |
| /doctor | Diagnose Node, API, credentials and workspace |
| /exit | Exit the workbench |
Tools and approvals
The model can only act through these tools. Mutating tools require approval in the default mode; read-only tools do not.
- read_fileread
Reads a file inside the workspace (secret files excluded)
- write_filewrite
Creates or replaces a file; requires approval unless auto-edit
- edit_filewrite
Applies an exact string replacement and records undo state
- list_filesread
Walks directories, skipping ignored and secret paths
- search_filesread
Regex search with result caps and binary skipping
- run_commandexec
Runs a shell command through the allow/deny policy with a timeout
- git_statusread
Shows the working tree status
- git_diffread
Shows the diff for tracked files
- ask_userprompt
Pauses the loop to ask a clarifying question
- finish_taskfinal
Ends the loop and produces the summary
| Tool | Class | Notes |
|---|---|---|
| read_file | read | Reads a file inside the workspace (secret files excluded) |
| write_file | write | Creates or replaces a file; requires approval unless auto-edit |
| edit_file | write | Applies an exact string replacement and records undo state |
| list_files | read | Walks directories, skipping ignored and secret paths |
| search_files | read | Regex search with result caps and binary skipping |
| run_command | exec | Runs a shell command through the allow/deny policy with a timeout |
| git_status | read | Shows the working tree status |
| git_diff | read | Shows the diff for tracked files |
| ask_user | prompt | Pauses the loop to ask a clarifying question |
| finish_task | final | Ends the loop and produces the summary |
Approval modes
- manual (default): every write and command asks for confirmation.
- auto-edit: file writes apply automatically; commands still ask.
- read-only: writes and commands are refused; the agent can still analyse and explain.
- full-access: the agent may reach the whole machine — any file, any directory, any command through a real shell (pipes, redirects,
&&). It is still not unattended: every action is shown and approved first, and anything outside the project or any secret file triggers an explicit prompt naming the absolute path.
Security model
- Workspace root is fixed at startup; every path is resolved and checked against it.
- Symlinks that escape the workspace are rejected; secret files are excluded from reads and search.
- A deny-list blocks destructive commands and an allow-list constrains execution.
- Commands have a timeout and output cap; the agent has a maximum step count and loop detection.
- Ctrl+C cancels the current task and records the session as cancelled.
- Credentials are never placed in a URL, a command line or a log line.
Sessions and files
Configuration, credentials and local session state live in ~/.nordai (%USERPROFILE%\.nordai on Windows). On POSIX systems the directory is created with 0700 and credential files with 0600. Sessions are also mirrored to your NordAI account when you are signed in, enabling /resume on another machine.
/compact asks the model to summarise older turns, then replaces them in the context while keeping the system prompt and recent tool results. The summary is stored in the session.
Troubleshooting
nordai doctorreports Node, API reachability, credential validity and workspace state.quota_exceededresponses include a reset time; the CLI prints it and stops retrying.401after a long break usually means the device credential was revoked or expired — run/loginagain.- If a command is blocked, check the deny rules in
/settingsbefore assuming a bug.