Skip to main content
Get startedInstall and setup

Run darkgrade, the Darkgrade CLI, with npx, or install it once for a shorter command, tab completion and a manual page. Then doctor says whether this computer and your camera are ready.

Run or install

You need Node.js 22.18 or newer.

  • npx darkgrade <command> when you are trying it, or the machine should not keep an install.
  • npm install -g darkgrade when you run it often or from cron, or want tab completion and man darkgrade.

The docs write npx darkgrade. After a global install, drop the npx:

npm install -g darkgrade
darkgrade --version
darkgrade 0.1.0-alpha.1

Your version number will be newer. darkgrade version --json adds the Node version and platform, for bug reports:

{"version":"0.1.0-alpha.1","node":"24.3.0",
 "platform":"darwin","architecture":"arm64"}

Check your setup

doctor checks four things and says how to fix each one that is not right.

npx darkgrade doctor
darkgrade 0.1.0-alpha.1

✓ Node 24.3.0 on darwin arm64
✓ Settings in ~/.darkgrade; sharing is on
✓ USB driver loaded
✓ ILCE-7M5 (054c:0f51) is ready

Everything is in place. Next: darkgrade telemetry benchmark
CheckPasses when
nodeNode is 22.18 or newer. If not, install a newer Node.
settingsThe settings folder (~/.darkgrade) can be read and written. If not, make it writable, or point DARKGRADE_HOME at a folder that is.
usb-driverThe USB module loads. If not, reinstall darkgrade so the module is built for this Node and platform.
cameraA camera is attached and in the USB mode for computer control. If not, follow the USB mode steps below.

doctor exits 1 when a check fails. A missing camera is a warning, not a failure, so it still exits 0. The home folder is printed as ~, so you can paste the output into a bug report. For scripts, doctor --json prints { version, healthy, checks }; see its shape.

doctor looks at USB only and never opens the camera. Ready means the camera is in the right USB mode, not that nothing else is holding it.

Put the camera in the right USB mode

A camera that is attached but not ready shows as attached, not in PTP mode. PTP is the Picture Transfer Protocol: the USB mode in which a camera accepts control from a computer, rather than acting as a card reader.

On a Sony, set USB Connection Mode to PC Remote (or Remote Shooting), not Mass Storage. The menu path differs by model: see Where the setting is, by model. Canon and Nikon usually need nothing: close the brand's own utility (EOS Utility, NX Tether) first. A Canon DSLR with Wi-Fi enabled and a Nikon set to iPhone are the exceptions: see Canon and Nikon. Set up the camera has every brand.

Use a USB cable that carries data, switch the camera on, then run the command again. Camera compatibility lists which bodies work.

If a ready camera will not open

Only one program can hold a camera's USB connection. Close Studio and the maker's own utility (EOS Utility, NX Tether) first.

On a Mac, the system's own camera service claims a camera when it is plugged in, and a command then fails with an access or busy error (why; Camera not found and other errors lists every such message with its fix). The CLI does not stop the service for you. Stop it, then run your command straight away, because macOS starts it again:

killall -9 ptpcamerad PTPCamera mscamerad 2> /dev/null
npx darkgrade camera get-info

Scripts and automations has the line to put before each command in a script.

On Linux, your user needs permission to open the camera's USB device. Prepare your computer says how.

List cameras

cameras lists what is attached over USB, with each camera's USB id and state. Like doctor, it only looks at USB: no camera is opened and no setting is read.

npx darkgrade cameras
ILCE-7M5  054c:0f51  ready

The id is the USB vendor and product id (VID:PID). Pass it to --camera, or set DARKGRADE_CAMERA, to pick one camera when several are attached:

npx darkgrade camera get-info --camera 054c:0f51

When several are attached and you do not name one, a command uses the only device made by a camera brand it knows. If there is still more than one, it lists them with the exact --camera line for each and exits 1.

The id names a model, not one body. Two cameras of the same model share an id, so --camera cannot tell them apart.

Get help in the terminal

RunTo see
darkgrade or darkgrade --helpEvery command
darkgrade help cameraEvery camera command
darkgrade help camera take-photoOne command: its inputs, flags and examples
darkgrade camera take-photo --helpThe same
darkgrade manThe manual page

A mistyped command or flag is answered with the closest one, and nothing runs on a guess:

$ darkgrade camra
error: Unknown command "camra". Did you mean "camera"?
Usage: darkgrade <command> [options]
Run "darkgrade --help" for details.

A camera word that is not a command names the command for it:

$ darkgrade shoot
error: Unknown command "shoot". Use "darkgrade camera take-photo".
Usage: darkgrade <command> [options]
Run "darkgrade --help" for details.

Tab completion

completions prints a script for bash, zsh or fish that completes commands and flags when you press Tab. Save it where your shell loads completions:

mkdir -p ~/.zfunc
darkgrade completions zsh > ~/.zfunc/_darkgrade
# In ~/.zshrc, before compinit:
#   fpath=(~/.zfunc $fpath)

Open a new shell to load it. Completion is for the darkgrade command, so it needs the global install.

The manual page

A global install registers the manual page, so man darkgrade works. darkgrade man opens the same page, and works with npx too. Piped, it prints the page's roff source:

darkgrade man > darkgrade.1

The manual lists every command, the environment variables and the exit statuses.

Still stuck?

Get help says where to ask and what to send.

Next

⌘I