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

macOS · Linux
curl -fsSL https://developers.nextx.vn/install.sh | sh
Windows (PowerShell)
irm https://developers.nextx.vn/install.ps1 | iex
Homebrew
brew install nextx-organization/nextx/nextx
npm (Node 20+)
npm install -g @nextxai/cli

npm and Homebrew installs keep tokens in the OS keychain. The script install needs no Node.

Quick start

Lệnh mẫu
nextx login
nextx
nextx -p "yesterday's revenue by branch"
nextx doctor

The 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

MethodCommandUse when
Browsernextx login --webThe machine has a browser (default)
QR codenextx login --qrSSH or headless servers — approve in the NextX app
Device codenextx login --deviceNo browser and no app: enter a code on another device
API keyNEXTX_API_KEY=… nextx …Scripts, read-only CI — an agent identity, no AI chat
CI OIDCnextx login --ciGitHub 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.

CommandMeaning
/helpCommands and shortcuts
/newNew conversation (keeps workspace, agent)
/resume [query]Resume an earlier conversation
/rename <name>Rename this conversation
/pinPin / unpin this conversation
/workspace [code]Switch workspace
/agent [code]Choose an Agent: general, sales, support…
/mode read|propose|autoPermission mode: read · propose · auto
/model [name]Switch model: NextX AI or your own
/attach <file>Attach an Excel / CSV / image / text file
/pendingWrites waiting for confirmation
/undo [id]Undo the last write
/journalJournal of what the AI wrote
/why [runId]Why the AI answered that way (steps, tools)
/memoryWhat the AI remembers — edit, lock, forget
/schedule "question" daily 08:00Schedule a question daily / weekly / monthly
/libraryImages, documents and files the AI produced
/export md|json [file]Export the conversation to Markdown / JSON
/toolsAI tools you can use (by your real permissions)
/usageAI turns this month
/feedback up|downRate the last answer
/support <problem>Hand over to a support agent (ticket)
/statusAccount, workspace, environment, version
/doctorCheck connectivity, clock, token, plan
/config [key value]Settings: language, color, update notices
/initCreate NEXTX.md: instructions for this folder
/mcpInstall the MCP server into another client
/logoutLog out this profile
/clearClear the screen (keeps the conversation)
/exitExit

Shortcuts

KeyMeaning
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+TabCycle permission mode
EscStop the running answer
Esc EscEdit the last message
↑ / ↓Input history
Ctrl+OExpand / collapse steps
Ctrl+LClear screen
Ctrl+C · Ctrl+DClear input (twice to exit) · exit

Permission modes and writes

ModeNormal writeLarge write (delete, bulk > 20, permissions)Finance
Read onlyNeverNeverNever
Propose (default)Change table + [y/N]Type the countConfirm in the app only
Auto-write normalWritten, undoableType the countConfirm in the app only
No terminal (-p, CI)Not written, prints how to confirmNot writtenNot 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

FlagMeaning
-v, --versionprint the version
-p, --print [question]non-interactive: print the answer and exit (reads stdin too)
-c, --continuecontinue 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
--sandboxuse 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
--jsonshorthand for --output-format json
--lang <lang>language
--no-colordisable colors
--quietprint results only
--verboseverbose output
--debugprint request ids and timings (never tokens)

nextx login

log in (browser or QR, chosen automatically)

FlagMeaning
--weblog in with the browser
--qrscan with the NextX app (SSH, headless machines)
--deviceenter a code on another device (RFC 8628)
--ciin GitHub Actions/GitLab CI: exchange the OIDC token for a short-lived token
--no-browserdo not open the browser, print the link only

nextx logout

log out this profile (revokes the server session)

FlagMeaning
--alllog 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

FlagMeaning
--othersevery 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)

FlagMeaning
--conversation <id>continue this conversation

nextx ai history

list conversations

FlagMeaning
--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

FlagMeaning
--offunpin

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

FlagMeaning
--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

FlagMeaning
--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

FlagMeaning
--offunlock

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

FlagMeaning
--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

FlagMeaning
--kind <kind>image | document | generated

nextx ai library get <n>

download item n

FlagMeaning
-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

FlagMeaning
--key-from-stdinread 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)

FlagMeaning
--no-browserdo not open the browser

nextx tools logout

revoke the CLI's AI tool access

nextx tools list

list tools

FlagMeaning
--module <m>filter by module (crm, sales, dms…)
--kind <k>filter by kind (read | proposal | export)
--publicpublic 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

FlagMeaning
--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)

FlagMeaning
-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)
--paginatefollow all pages (items/pageNumber results)
--select <path>print only part of the result, e.g. .items[0].name
-i, --includeprint 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)

FlagMeaning
--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

FlagMeaning
--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>

FlagMeaning
--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

FlagMeaning
--endpoint <id>target endpoint (default: first one subscribed)

nextx webhooks deliveries

recent deliveries

FlagMeaning
--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)

FlagMeaning
--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

FlagMeaning
--forward-to <url>e.g. localhost:3000/hook
--events <list>events, comma separated (default: all)
--print-secretprint the full signing secret
--print-jsonprint event bodies

nextx openapi

download the public OpenAPI spec

nextx openapi pull

FlagMeaning
--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)

FlagMeaning
--stdiouse 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)

FlagMeaning
--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)

FlagMeaning
--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>
--approveapprove 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

FlagMeaning
--repo <owner/repo>
--workspace <code>
--writesample 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

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

API key
NEXTX_API_KEY=… nextx tools call <tool> -a q=… --json
JSON for scripts
nextx -p "yesterday's revenue by branch" --json > report.json
nextx -p "…" --output-format stream-json

Environment and config files

VariableMeaning
NEXTX_API_KEYAPI key (CI, read only)
NEXTX_TOKENAn existing access token
NEXTX_PROFILELogin profile
NEXTX_ENVprod | sandbox
NEXTX_WORKSPACEWorkspace for this command
NEXTX_LANGvi | en
NEXTX_DEBUGPrint request ids and timings (never tokens)
NEXTX_NO_UPDATE_CHECKDisable update notices
NEXTX_NO_KEYCHAINStore tokens in a 0600 file instead of the keychain
NEXTX_ID_TOKENCI 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

CodeMeaning
0Success
1General / server error
2Invalid usage
3Not logged in / session expired
4Missing permission or plan
5Out of AI turns / rate limited
6Network error
7Write proposal not confirmed
8Not found
130Cancelled (Ctrl+C)