Skip to content

The nxtrm command

nxtrm opens folders and files in Next Term from any terminal: a project with nxtrm ., a file at a line with nxtrm src/app.ts:42.

Terminal window
nxtrm . # this folder as a project
nxtrm ~/Code/api # a folder as a project
nxtrm src/app.ts:42:7 # a file, at line 42, column 7
nxtrm notes.md # a file that does not exist yet is created empty
nxtrm -n ~/Code/api # in a new window
nxtrm agent claude # an agent session in this tab (nxtrm agent alone lists them)
nxtrm secret run GITHUB_TOKEN -- npm test # a command with a stored key, once you approve
nxtrm secret import .env.local # copy keys from a file into Secrets, as you tick them
OptionDoes
-n, --new-windowOpen in a new window
-h, --helpShow the help
-v, --versionShow the version
--Treat everything after it as a path, even if it starts with -

nxtrm agent NAME runs an agent session in the tab it is typed in: Claude Code (claude), Codex (codex) or an agent that speaks the Agent Client Protocol. --prompt "…" sends a first prompt, --resume ID goes on with a Claude Code or Codex session (what a restore after an update runs), ⌃C or ⎋ stops a turn, and ⌃D on an empty line ends it.

nxtrm mcp is different: it is Next Term’s MCP server, which agents start themselves. See Orchestrate agents (MCP).

Terminal window
nxtrm secret run NAME[=ENVNAME]... -- command [arguments...]
nxtrm secret import [--from FORMAT] [FILE | -]
nxtrm secret help

nxtrm secret run runs a command with keys from Secrets in its environment, once you approve in Next Term with Touch ID or your password. NAME is a stored key; NAME=ENVNAME sets it as another variable, such as GITHUB_TOKEN=GITHUB_PERSONAL_ACCESS_TOKEN. Every other stored key’s name is taken out of the command’s environment, and nxtrm itself writes nothing to standard output, so it works as an MCP server’s command. See Keys for MCP servers.

It needs Next Term running with “Let agents control Next Term” on, and never opens it by itself. When it can’t get a key, it writes one line to standard error and exits with 1 (2 for a name that isn’t stored, a key’s value in the command or wrong arguments, 127 for a command that isn’t found, and 126 for one that can’t run): what each line means. nxtrm secret alone, with no run, import or help, still opens a file named secret. nxtrm secret help prints the usage of both.

nxtrm secret import opens the import in the running Next Term, where you tick the keys to copy into Secrets and approve with Touch ID or your password. It waits there until you are done.

  • A FILE is sent as its full path, and Next Term reads it as Import From › A File… does: a .env, JSON, TOML, YAML or CSV file, or a password manager’s export. An agent’s MCP config opens the import that moves its keys out instead when you run it in a Next Term tab of your own. Run by an agent, in a tab an agent drives, or from no tab Next Term knows, such as inside tmux or herdr, it is refused for an MCP config and prints “nxtrm: this is an agent’s MCP config, and moving its keys out rewrites it, so nothing opened. Choose Secrets › Import From › MCP Configs… in Next Term to move them.” (who ran it).
  • -, or no FILE, reads the keys piped in on standard input, up to 5 MB, such as what a password manager’s command-line tool prints. nxtrm sends them only once Next Term has answered, then wipes its copy. With a terminal on standard input and no FILE, it prints its usage and exits with 2, so it never waits for keys typed on screen.
  • --from FORMAT names the format: 1password, bitwarden, bws, env, json, csv, yaml or toml. Without it, Next Term reads the format from the content.

It prints only how many keys were found and imported, on standard error, never a name or a value: “Next Term: 7 keys found. Choose them in the Import window.”, then “Imported 3 keys.” (exit 0) or “Nothing imported.” (exit 1). When Secrets already shows a sheet, nothing opens behind it: it prints “nxtrm: Next Term is showing another import or sheet in Secrets. Finish it, then run this again.” (exit 1), and the line under Secrets’ list says “nxtrm secret import asked to open an import. Finish what’s open here, then run it again.” Run by an agent, in a tab an agent drives, or from no tab Next Term knows, the Import window comes forward without taking the keyboard, and Import… answers only a click. It needs Next Term running with “Let agents control Next Term” on, and never opens it by itself; it checks the app’s code signature before it sends anything, as secret run does. Import From › 1Password…, Bitwarden… and Bitwarden Secrets Manager… type a line that pipes into it, for you to run: see From 1Password or Bitwarden, and for other tools, From other tools.

  • A folder opens as a project: in its own window if that project is already open, in an unused window if there is one, or in a new window.
  • A file opens in the window whose project contains it, or the front window. With -n, or when no window is open, it opens in a new window on the file’s project (its git root, or its folder).
  • path:line and path:line:column, the form compilers, linters and agents print, open the file at that spot. A folder has no lines, so nxtrm src:12 is an error.
  • A new file in an existing folder is created empty and opened, so you can write it.

If Next Term is not running, nxtrm starts it with your request instead of showing the Welcome window or reopening your projects. If it is running, the request goes to it and the app comes to the front.

In Next Term tabs, nxtrm works from the first launch: it is on the PATH of every tab.

For other terminals, Next Term adds it at launch when it can do so without a password. It reads your PATH from your login shell, as your other terminals get it, and links nxtrm to the copy inside the app in the first of these folders on it that you can write:

  • ~/.local/bin or ~/bin, when your shell puts them on PATH
  • /opt/homebrew/bin, Homebrew’s folder on Apple silicon
  • /usr/local/bin, when Homebrew has made it yours

Your PATH order decides between them. Next Term never adds a folder to PATH or edits your shell’s startup files, and never adds a link to any other folder on PATH, such as a version manager’s. If your shell takes more than 5 seconds to start, that launch does nothing, and a later one decides.

A PATH entry that starts with ~ doesn’t count, because zsh never looks there: the quotes in export PATH="~/.local/bin:$PATH" keep the ~, so write $HOME/.local/bin instead.

When none of them will do, as on a Mac without Homebrew, where /usr/local/bin belongs to the system, the first launch asks Install the “nxtrm” command? on the first project window, once you are past Import or the Welcome window.

  • Install… links /usr/local/bin/nxtrm and asks for your administrator password once, as other editors do for their commands. If your PATH leaves out /usr/local/bin, it says so.
  • Not Now asks again after the next update.
  • Don’t Ask Again stops asking.

Next Term › Install Command Line Tool (nxtrm)… does the same at any time. It also uses a folder that needs no password when there is one.

The one-line installer links it the same way, right after it installs the app, and says where. If no folder qualifies, it tells you that Next Term will offer it.

  • Next Term only ever replaces a link it made itself. It never touches someone else’s nxtrm, and when another nxtrm comes first on your PATH, it adds none of its own.
  • It links only a copy in a permanent place such as Applications. A copy running from the disk image would leave the link pointing at nothing once the image is ejected, so Next Term asks you to move it first.
  • If you move the app, or open another copy, that launch points nxtrm at it. When Next Term’s link still opens the other copy and needs a password to change, it asks, as above, rather than add a link later on PATH that the shell would never reach.
  • The link is the only file it adds. Delete it to remove the command from your other terminals: Next Term leaves it out from then on, and Next Term › Install Command Line Tool (nxtrm)… puts it back.