Northern Commander

Command line

ncmd reaches Northern Commander from any terminal: a script, an editor, git, or the terminal built in. Each command acts on the running application, or starts it first, and hands the shell back. northern-commander is the same command under a longer name.

This page lists every command there is, written from the tool’s own help, so it is the same as ncmd help prints. More of the application is reached from a terminal as releases add commands, and each new one is listed here as it ships.

  • How to use it day to day, with examples: From any terminal.
  • Installing it: Homebrew installs it with the application. Otherwise, Install command-line tool… in the Options menu does it, and the application offers it once as it starts.

Where it fits

To Run
Show a folder in the active pane ncmd ~/work, or ncmd . for the folder you are in
Go to a file, with the cursor on it ncmd notes.txt
Read a file in the viewer ncmd view notes.txt
Change a file in the editor ncmd edit notes.txt
Make it git’s editor git config --global core.editor "ncmd edit --wait"

Every command

What ncmd help prints:

ncmd opens and uses Northern Commander from a terminal.
Each command acts on the running application, starting it first if needed,
and returns without waiting. ncmd and northern-commander are the same
command.

Usage: ncmd [<command>] [<options>] [<path>]

Commands:
  open [<path>]          Show a folder in the active pane, or a file's folder
                         with the cursor on the file. The word open can be
                         left out. With no path, bring the application forward.
  view [--wait] <file>   Open a file in the viewer.
  edit [--wait] <file>   Open a file in the editor.
  help [<command>]       Show this help, or one command's.
  version                Show the version.

Options:
  --wait                 Return only when the viewer or editor closes.
  -h, --help             Show the help for the command.
  --version              Show the version.
  --                     Read what follows as a path, even if it starts with -.

Exit status: 0 done, 1 could not be done, 2 not understood,
3 Northern Commander did not answer.

More about one command: ncmd help <command>

ncmd open

ncmd [open] [<path>]

Shows a folder in the active pane, or the folder a file is in with the cursor
on the file; in the app, ⌘[ takes the pane back. A relative path is read
from the folder you are in. With no path, brings Northern Commander
forward. The word open can be left out.

Options:
  -h, --help   Show this help.
  --           Read what follows as a path, even if it starts with -.

There is no --wait: a pane stays open, so there is nothing to wait for.

Examples:
  ncmd .             show the folder you are in
  ncmd ~/notes.txt   show your home folder, with the cursor on notes.txt

ncmd view

ncmd view [--wait] <file>

Opens a file in Northern Commander's viewer, and returns without waiting.

Options:
  --wait       Return only when the viewer closes.
  -h, --help   Show this help.
  --           Read what follows as a path, even if it starts with -.

Examples:
  ncmd view notes.txt
  ncmd view --wait notes.txt

ncmd edit

ncmd edit [--wait] <file>

Opens a file in Northern Commander's editor, and returns without waiting.

Options:
  --wait       Return only when the editor closes. A program that asks for an
               editor to write in, such as git, needs this.
  -h, --help   Show this help.
  --           Read what follows as a path, even if it starts with -.

Example:
  git config --global core.editor "ncmd edit --wait"

ncmd help

ncmd help [<command>]

Shows every command, or one command's usage and options. ncmd <command> --help
does the same.

ncmd version

ncmd version

Shows the version of Northern Commander this tool belongs to. ncmd --version
does the same.