NextX in your terminal: the nextx command
Type nextx to chat with NextX AI on your real workspace data, like Claude Code or Codex. Plus developer subcommands: API calls, AI tools, API keys, webhooks, MCP.
Version 0.3.5 · GitHub
Install
curl -fsSL https://developers.nextx.vn/install.sh | shirm https://developers.nextx.vn/install.ps1 | iexbrew install nextx-organization/nextx/nextxnpm install -g @nextxai/clinpm and Homebrew installs keep tokens in the OS keychain. The script install needs no Node.
Quick start
nextx login
nextx
nextx -p "yesterday's revenue by branch"
nextx doctorThe first nextx login opens your browser; over SSH, scan the QR code with the NextX app. nextx doctor checks network, clock, session and AI plan.
Log in
| Method | Command | Use when |
|---|---|---|
| Browser | nextx login --web | The machine has a browser (default) |
| QR code | nextx login --qr | SSH or headless servers — approve in the NextX app |
| Device code | nextx login --device | No browser and no app: enter a code on another device |
| API key | NEXTX_API_KEY=… nextx … | Scripts, read-only CI — an agent identity, no AI chat |
| CI OIDC | nextx login --ci | GitHub Actions / GitLab CI, no stored secret |
Sessions renew while used and expire after 30 idle days. Revoke them with nextx sessions or on the Devices page.
Chat
Run nextx to open it. / opens the command menu, @ attaches a file or picks an Agent, Shift+Tab cycles the permission mode, Esc stops an answer.
| Command | Meaning |
|---|---|
/help | Commands and shortcuts |
/new | New conversation (keeps workspace, agent) |
/resume [query] | Resume an earlier conversation |
/rename <name> | Rename this conversation |
/pin | Pin / unpin this conversation |
/workspace [code] | Switch workspace |
/agent [code] | Choose an Agent: general, sales, support… |
/mode read|propose|auto | Permission mode: read · propose · auto |
/model [name] | Switch model: NextX AI or your own |
/attach <file> | Attach an Excel / CSV / image / text file |
/pending | Writes waiting for confirmation |
/undo [id] | Undo the last write |
/journal | Journal of what the AI wrote |
/why [runId] | Why the AI answered that way (steps, tools) |
/memory | What the AI remembers — edit, lock, forget |
/schedule "question" daily 08:00 | Schedule a question daily / weekly / monthly |
/library | Images, documents and files the AI produced |
/export md|json [file] | Export the conversation to Markdown / JSON |
/tools | AI tools you can use (by your real permissions) |
/usage | AI turns this month |
/feedback up|down | Rate the last answer |
/support <problem> | Hand over to a support agent (ticket) |
/status | Account, workspace, environment, version |
/doctor | Check connectivity, clock, token, plan |
/config [key value] | Settings: language, color, update notices |
/init | Create NEXTX.md: instructions for this folder |
/mcp | Install the MCP server into another client |
/logout | Log out this profile |
/clear | Clear the screen (keeps the conversation) |
/exit | Exit |
Shortcuts
| Key | Meaning |
|---|---|
Enter · Shift+Enter (\ + Enter) | Send · new line |
/ | Command menu |
@ | Attach a file, pick an Agent for this message |
# | Quick note into this folder's NEXTX.md |
Shift+Tab | Cycle permission mode |
Esc | Stop the running answer |
Esc Esc | Edit the last message |
↑ / ↓ | Input history |
Ctrl+O | Expand / collapse steps |
Ctrl+L | Clear screen |
Ctrl+C · Ctrl+D | Clear input (twice to exit) · exit |
Permission modes and writes
| Mode | Normal write | Large write (delete, bulk > 20, permissions) | Finance |
|---|---|---|---|
| Read only | Never | Never | Never |
| Propose (default) | Change table + [y/N] | Type the count | Confirm in the app only |
| Auto-write normal | Written, undoable | Type the count | Confirm in the app only |
| No terminal (-p, CI) | Not written, prints how to confirm | Not written | Not written |
The server re-checks real permissions, the AI plan and the proposal's expiry on every write — the CLI is not the only gate.
Command reference
Generated from nextx help --json of the released version.
Flags for every command
| Flag | Meaning |
|---|---|
-v, --version | print the version |
-p, --print [question] | non-interactive: print the answer and exit (reads stdin too) |
-c, --continue | continue the last conversation |
-r, --resume [id] | resume a conversation (no id = pick from a list) |
-f, --file <path> | attach an Excel/CSV, image or text file (repeatable, max 3) |
--profile <name> | login profile |
--sandbox | use the sandbox environment |
-w, --workspace <code> | run this command on another workspace |
--agent <code> | choose an Agent instead of the general assistant |
--model <provider/name> | use your own model over MCP: claude, gemini, gpt, grok, ollama/<name> |
--mode <mode> | permission mode |
--output-format <format> | output format |
--json | shorthand for --output-format json |
--lang <lang> | language |
--no-color | disable colors |
--quiet | print results only |
--verbose | verbose output |
--debug | print request ids and timings (never tokens) |
nextx login
log in (browser or QR, chosen automatically)
| Flag | Meaning |
|---|---|
--web | log in with the browser |
--qr | scan with the NextX app (SSH, headless machines) |
--device | enter a code on another device (RFC 8628) |
--ci | in GitHub Actions/GitLab CI: exchange the OIDC token for a short-lived token |
--no-browser | do not open the browser, print the link only |
nextx logout
log out this profile (revokes the server session)
| Flag | Meaning |
|---|---|
--all | log out every profile on this machine |
nextx status
account, workspace, environment, AI plan, session
nextx sessions
your login sessions on all devices
nextx sessions list
list sessions
nextx sessions revoke [id]
revoke one session, or --others for all other sessions
| Flag | Meaning |
|---|---|
--others | every session except this one |
nextx workspace(ws)
your workspaces (companies)
nextx workspace list
list workspaces
nextx workspace use [code]
switch the working workspace (saved in the profile)
nextx ai
AI assistant: ask, history, proposals, memory, schedules
nextx ai ask <question...>
ask one question non-interactively (same as -p)
| Flag | Meaning |
|---|---|
--conversation <id> | continue this conversation |
nextx ai history
list conversations
| Flag | Meaning |
|---|---|
--search <text> | filter by text |
--limit <n> | rows · default 30 |
nextx ai show <id>
print a whole conversation
nextx ai rename <id> [title...]
rename a conversation (empty = clear)
nextx ai pin <id>
pin a conversation
| Flag | Meaning |
|---|---|
--off | unpin |
nextx ai delete <id>
delete a conversation permanently
nextx ai why [runId]
why the AI answered that way: steps and tools
nextx ai runs
recent runs
| Flag | Meaning |
|---|---|
--limit <n> | · default 20 |
nextx ai pending
drafts and questions waiting for you
nextx ai show-changeset <id>
show the rows of a draft
nextx ai apply <id>
apply a draft (real write)
nextx ai reject <id>
reject a draft
nextx ai undo <id>
undo what the AI wrote (within the window)
nextx ai journal
journal of what the AI wrote
| Flag | Meaning |
|---|---|
--module <m> | filter by module |
--limit <n> | · default 20 |
nextx ai memory
what the AI remembers about your company
nextx ai memory list
nextx ai memory edit <id> <text...>
edit a memory
nextx ai memory lock <id>
lock so the AI cannot change it
| Flag | Meaning |
|---|---|
--off | unlock |
nextx ai memory forget <id>
make the AI forget something
nextx ai schedule
schedule a recurring question
nextx ai schedule list
nextx ai schedule add <question>
e.g. ai schedule add "yesterday's revenue" --daily 08:00
| Flag | Meaning |
|---|---|
--daily <HH:mm> | |
--weekly <dow@HH:mm> | 0=Sun … 6=Sat, e.g. 1@08:00 |
--monthly <dom@HH:mm> | day 1–28, e.g. 1@08:00 |
--title <title> |
nextx ai schedule run <id>
run once now
nextx ai schedule off <id>
disable
nextx ai schedule on <id>
enable
nextx ai schedule delete <id>
delete
nextx ai library
images, documents and files the AI produced
nextx ai library list
| Flag | Meaning |
|---|---|
--kind <kind> | image | document | generated |
nextx ai library get <n>
download item n
| Flag | Meaning |
|---|---|
-o, --out <file> |
nextx ai agents
Agents available to you
nextx ai usage
AI turns this month
nextx ai feedback <messageId> <vote>
rate an answer: up / down
nextx ai support <problem...>
hand over to a support agent (opens a ticket)
nextx model
your own models for --model (keys stay in the keychain, never sent to NextX)
nextx model list
models you added
nextx model add <provider>
add a provider: claude, gemini, gpt, grok, ollama
| Flag | Meaning |
|---|---|
--key-from-stdin | read the API key from stdin (never put keys on the command line) |
--name <model> | model used when only the provider is given |
--url <url> | server address (Ollama or a compatible endpoint) |
nextx model remove <name>
remove a model and delete its key
nextx model default <name>
model used by default (nextx = NextX AI)
nextx tools
AI tools you can use (by your real permissions)
nextx tools login
grant AI tool access to the CLI on this machine (once)
| Flag | Meaning |
|---|---|
--no-browser | do not open the browser |
nextx tools logout
revoke the CLI's AI tool access
nextx tools list
list tools
| Flag | Meaning |
|---|---|
--module <m> | filter by module (crm, sales, dms…) |
--kind <k> | filter by kind (read | proposal | export) |
--public | public catalog (no login) |
nextx tools describe <name>
parameters and an example for a tool
nextx tools call <name>
call a tool. Write tools only create a proposal to confirm
| Flag | Meaning |
|---|---|
--args <json> | JSON arguments |
--args-file <file> | arguments from a JSON file (- = stdin) |
-a, --arg <key=value> | one argument (repeatable) |
nextx api <method> <path>
call the API directly (e.g. api GET /crm/contacts -f q=Minh)
| Flag | Meaning |
|---|---|
-f, --raw-field <key=value> | string parameter: query for GET/DELETE, JSON body for POST/PUT/PATCH (repeatable) |
-F, --field <key=value> | like -f but typed: numbers, true/false, JSON |
--input <file> | request body from a JSON file (- = stdin) |
-H, --header <K: V> | extra header (repeatable) |
--paginate | follow all pages (items/pageNumber results) |
--select <path> | print only part of the result, e.g. .items[0].name |
-i, --include | print status and headers too |
--idempotency-key <key> | idempotency key for POST |
nextx keys
workspace API keys
nextx keys list
list keys
nextx keys create
create a key (printed once)
| Flag | Meaning |
|---|---|
--name <name> | |
--scopes <codes> | permission codes, comma separated, e.g. crm.contacts.view,sales.orders.view |
--expires <dur> | lifetime: 30d, 6m, 1y · default 90d |
--description <text> |
nextx keys revoke <id>
revoke a key (stops immediately)
nextx keys delete <id>
delete a key
nextx keys usage [id]
calls over 7 days
nextx keys calls <id>
last 50 calls of a key
nextx webhooks(webhook)
webhook events: browse, trigger, listen locally
nextx webhooks events
list events
| Flag | Meaning |
|---|---|
--module <m> |
nextx webhooks schema <event>
payload schema and example
nextx webhooks endpoints
your webhook endpoints
nextx webhooks endpoints list
nextx webhooks endpoints create <url>
| Flag | Meaning |
|---|---|
--events <list> | events, comma separated |
--description <text> |
nextx webhooks endpoints delete <id>
nextx webhooks endpoints rotate-secret <id>
rotate the signing secret (old one stays valid for a while)
nextx webhooks trigger <event>
send a sample event to an endpoint
| Flag | Meaning |
|---|---|
--endpoint <id> | target endpoint (default: first one subscribed) |
nextx webhooks deliveries
recent deliveries
| Flag | Meaning |
|---|---|
--status <s> | success | failed | pending |
--endpoint <id> | |
--limit <n> | · default 30 |
nextx webhooks retry <deliveryId>
retry a delivery
nextx webhooks verify
verify a webhook signature locally (no server call)
| Flag | Meaning |
|---|---|
--secret <secret> | |
--payload <file> | raw received body (- = stdin) |
-H, --header <K: V> | received header (repeatable) |
--signature <sig> | signature from the *-Signature-256 header |
--timestamp <ts> | timestamp from the *-Timestamp header |
nextx webhooks listen
receive real events on this machine and forward them locally
| Flag | Meaning |
|---|---|
--forward-to <url> | e.g. localhost:3000/hook |
--events <list> | events, comma separated (default: all) |
--print-secret | print the full signing secret |
--print-json | print event bodies |
nextx openapi
download the public OpenAPI spec
nextx openapi pull
| Flag | Meaning |
|---|---|
--module <m> | one module only |
-o, --out <file> | · default openapi.json |
nextx docs [topic]
open the docs (cli, quickstart, api-keys, oauth, mcp, ai-tools, webhooks, sdk, errors, rate-limit, sandbox, changelog, versioning, security)
nextx changelog
recent API changes
nextx mcp
connect the MCP server to other AI assistants
nextx mcp url
print the MCP server URL
nextx mcp install [clients...]
install into: chatgpt, claude, claude-desktop, codex, copilot, cursor, gemini, grok, vscode, windsurf
nextx mcp uninstall <client>
nextx mcp serve
serve MCP over stdio with the CLI's grant (for clients without OAuth)
| Flag | Meaning |
|---|---|
--stdio | use stdin/stdout (default) |
nextx ci
secretless CI login (OIDC)
nextx ci trust
CI repositories allowed to log in to this workspace
nextx ci trust list
nextx ci trust add
allow a repository to log in (tokens act as you, live 15 minutes)
| Flag | Meaning |
|---|---|
--repo <owner/repo> | |
--provider <p> | github | gitlab · default github |
--ref <ref> | branch or tag prefix, e.g. main · refs/tags/v* · default main |
--environment <name> | required GitHub environment (recommended for the main branch) |
--expires <dur> | lifetime: 90d, 1y |
--name <name> |
nextx ci trust revoke <id>
revoke (immediate)
nextx ci policy
pre-approval policies: let CI write within a ceiling
nextx ci policy list
nextx ci policy kinds
kinds a policy can cover
nextx ci policy show <id>
nextx ci policy request
ask to let a CI repository write (an API-key manager approves; with that permission it is active at once)
| Flag | Meaning |
|---|---|
--trust <id|owner/repo> | CI trust (see: ci trust list) |
--kinds <a,b> | kinds (see: ci policy kinds) |
--max <n> | record ceiling (1–1000) · default 50 |
--expires <dur> | lifetime, at most 30d · default 14d |
--note <text> | |
--approve | approve now (needs API-key manage permission) |
nextx ci policy revoke <id>
revoke (the next write goes back to a link)
nextx ci example
print a sample GitHub Actions workflow
| Flag | Meaning |
|---|---|
--repo <owner/repo> | |
--workspace <code> | |
--write | sample that writes (needs a policy: ci policy request) |
nextx doctor
check connectivity, clock, token, plan, version
nextx config
settings
nextx config list
nextx config get <key>
nextx config set <key> <value>
lang · mode · updateChannel · updateCheck · telemetry · color · defaultProfile
nextx completion <shell>
Tab completion for bash | zsh | fish | powershell
nextx update
upgrade to the latest version
| Flag | Meaning |
|---|---|
--channel <c> | latest | next |
nextx init
create NEXTX.md: instructions for this folder
Scripts and CI
-p prints the answer and exits; --json and --output-format stream-json are machine readable. Writes never run without a terminal.
NEXTX_API_KEY=… nextx tools call <tool> -a q=… --jsonnextx -p "yesterday's revenue by branch" --json > report.json
nextx -p "…" --output-format stream-jsonEnvironment and config files
| Variable | Meaning |
|---|---|
NEXTX_API_KEY | API key (CI, read only) |
NEXTX_TOKEN | An existing access token |
NEXTX_PROFILE | Login profile |
NEXTX_ENV | prod | sandbox |
NEXTX_WORKSPACE | Workspace for this command |
NEXTX_LANG | vi | en |
NEXTX_DEBUG | Print request ids and timings (never tokens) |
NEXTX_NO_UPDATE_CHECK | Disable update notices |
NEXTX_NO_KEYCHAIN | Store tokens in a 0600 file instead of the keychain |
NEXTX_ID_TOKEN | CI OIDC token (GitLab) |
Settings live in ~/.config/nextx/config.toml (no tokens). A NEXTX.md in a folder holds instructions sent with every question.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General / server error |
2 | Invalid usage |
3 | Not logged in / session expired |
4 | Missing permission or plan |
5 | Out of AI turns / rate limited |
6 | Network error |
7 | Write proposal not confirmed |
8 | Not found |
130 | Cancelled (Ctrl+C) |