CLI reference

nordai — the agent in your terminal

A Node.js and TypeScript CLI with streaming output, a real tool loop, approvals, session persistence and a workspace boundary. It never holds the upstream provider key.

Install and sign in

npm install -g https://nordai.my.id/downloads/nordai-0.5.0.tgz

Registry 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 login

Device 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

CommandBehaviour
/helpList commands and current mode
/keysKeyboard shortcuts and editor keys
/loginDevice authorization flow (or set an API key)
/logoutRevoke the local credential and server device token
/modelList allowed models and switch the active one
/models, /providersList approved models and the provider behind each
/approvalSwitch between manual, auto-edit, read-only and full-access
/plan-modeInvestigate and propose without editing (Shift+Tab)
/themeColour theme: nord, midnight, forest, solar, mono
/glyphsGlyph set: auto, unicode or ascii for legacy consoles
/planPlan, expiry and remaining allowance
/usageRequests and tokens used against your plan
/statsTurns, tokens, context use and elapsed time
/todosThe plan the agent recorded for the current task
/contextCurrent context budget and usage
/initCreate a NORD.md project brief for the agent
/filesList workspace files available as context
/diffShow the working diff (--last for the last step)
/reviewAsk the model to review the current diff
/undoRestore files changed by the last approved step
/runRun one allowlisted command yourself
/newStart a fresh session
/sessionsBrowse stored local sessions
/resumeResume a stored session
/renameRename the current session
/deleteDelete a stored session
/compactSummarise older turns to free context
/exportWrite the transcript as Markdown
/clearClear the screen
/settingsEndpoint, model, approval mode, context budget
/doctorDiagnose Node, API, credentials and workspace
/exitExit 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

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 doctor reports Node, API reachability, credential validity and workspace state.
  • quota_exceeded responses include a reset time; the CLI prints it and stops retrying.
  • 401 after a long break usually means the device credential was revoked or expired — run /login again.
  • If a command is blocked, check the deny rules in /settings before assuming a bug.