Skip to main content
ReferenceCommand reference

Run a camera command as npx darkgrade camera <command>: it opens the camera, does one thing and closes it. Run the commands from This computer on as npx darkgrade <command>. Required inputs come in order; the rest are flags.

Every camera command also takes --camera VID:PID, to choose between several cameras, and --json, written after the command, plus the global flags. --duration takes 10s, 2m or 1h, from 1 second to 24 hours; a bare number is seconds. A value that starts with -, such as an exposure compensation of -1.0, is read as a flag and cannot be passed today. Output and scripting covers --json, --output and the commands that hold.

On a Mac, if a command fails with an access or busy error, see If a ready camera will not open.

Connection

CommandDoes
connectConnect. Open the camera.
Flags: --[no-]observe-only
get-infoCamera info. Make, model, firmware and connection.
get-capabilitiesWhat the camera can do. Every setting, its choices, and what works right now.
set-control <id> <value>Set any setting. Change a setting by its id.
Flags: --frames-per-second <number>
recoverRecover a stuck camera. Bring back a camera that stopped answering.
Flags: --step-timeout-milliseconds <number>, --wait-for-device-milliseconds <number>, --[no-]allow-port-reset
disconnectDisconnect. Close the camera and put it back as it was.

connect and disconnect exist to match Slate: every other command connects and disconnects by itself. To list cameras without opening one, use cameras. recover exits 0 whether or not the camera came back: read recovered in its result.

Exposure

CommandDoes
get-exposure-mode
set-exposure-mode <value>
Read or set Exposure mode.
get-shutter-speed
set-shutter-speed <value>
Read or set Shutter speed.
get-aperture
set-aperture <value>
Read or set Aperture.
get-iso
set-iso <value>
Read or set ISO.
get-exposure-compensation
set-exposure-compensation <value>
Read or set Exposure compensation.
get-metering-mode
set-metering-mode <value>
Read or set Metering.

Focus

CommandDoes
autofocusAutofocus. Focus once and say whether it locked.
set-focus-point <x> <y>Focus on a point. Focus on a spot in the frame.
Flags: --[no-]autofocus
reset-focus-pointReset the focus point. Put the focus point back in the centre.
nudge-focus <near|far> <small|medium|large>Nudge manual focus. Step focus nearer or farther.
get-focus-mode
set-focus-mode <value>
Read or set Focus mode.
get-focus-area
set-focus-area <value>
Read or set Focus area.
get-subject-detection
set-subject-detection <On|Off>
Read or set Subject detection.
get-detection-subject
set-detection-subject <value>
Read or set Detection subject.
get-eye-selection
set-eye-selection <Auto|Off|Right|Left>
Read or set Eye selection.
get-continuous-autofocus
set-continuous-autofocus <On|Off>
Read or set Continuous AF.

Zoom and stabilisation

CommandDoes
zoom-to <focal-length-millimetres>Zoom to a focal length. Go to 35 mm, for example.
start-zoom <in|out> <slow|medium|fast>Start zooming. Zoom in or out until stopped.
Flags: --duration <duration>
stop-zoomStop zooming. Stop the zoom.
get-digital-zoom
set-digital-zoom <value>
Read or set Digital zoom.
get-image-stabilization
set-image-stabilization <value>
Read or set Image stabilisation.

Photos

CommandDoes
take-photoTake a photo. Take one photo and get its file name.
Flags: --[no-]autofocus, --destination (card, computer, computerOnly), --[no-]download, --raw-compression (Compressed, Lossless, High efficiency★, High efficiency), --[no-]include-info, --output <path>
get-drive-mode
set-drive-mode <value>
Read or set Drive mode.
get-shutter-type
set-shutter-type <value>
Read or set Shutter type.
get-flash-mode
set-flash-mode <value>
Read or set Flash.
get-photo-format
set-photo-format <value>
Read or set Photo format.
get-photo-size
set-photo-size <value>
Read or set Photo size.
get-aspect-ratio
set-aspect-ratio <value>
Read or set Aspect ratio.
get-jpeg-quality
set-jpeg-quality <value>
Read or set JPEG quality.
get-raw-compression
set-raw-compression <value>
Read or set RAW compression.

Live view

CommandDoes
get-live-view-frameRead a live-view frame. The current picture, as a JPEG.
Flags: --[no-]overlay, --output <path>
get-live-view-quality
set-live-view-quality <Low|Medium|High>
Read or set Live-view quality.

Video

CommandDoes
start-recordingStart recording. Start a video recording.
Flags: --duration <duration>
stop-recordingStop recording. Stop and get the finished clip.
get-recording-stateRecording state. Whether the camera is recording.
get-photo-video-mode
set-photo-video-mode <photo|video>
Read or set Photo / video.
get-video-format
set-video-format <value>
Read or set Video format.
get-video-quality
set-video-quality <value>
Read or set Video quality.
get-frame-rate
set-frame-rate <value>
Read or set Frame rate.
get-audio-recording
set-audio-recording <value>
Read or set Audio recording.
get-audio-level
set-audio-level <value>
Read or set Audio level.

Colour and look

CommandDoes
get-white-balance
set-white-balance <value>
Read or set White balance.
get-color-temperature
set-color-temperature <value>
Read or set Colour temperature.
get-picture-style
set-picture-style <value>
Read or set Look.
get-picture-profile
set-picture-profile <value>
Read or set Picture profile.

Card and files

CommandDoes
get-card-statusCard space. Free space, photos and recording time left.
list-mediaList photos and clips. The photos and clips on the card, newest first.
get-media-preview <id>Preview a file. A small JPEG of a photo or clip.
Flags: --size (thumbnail, preview), --output <path>
download-media <id>Download a file. Copy a photo or clip off the card.
Flags: --output <path>

Battery and clock

CommandDoes
get-batteryBattery. Charge, minutes left and power source.
set-clockSet the clock. Set the camera's date and time.
Flags: --moment <ISO 8601>

Events

watch is a camera command too: run it as npx darkgrade camera watch. Events shows the same on every product.

CommandDoes
watchPrint a line each time a setting changes on the camera or a new photo or clip lands, until Ctrl-C or --duration. With --json, each line is {"event": …, "at": …}. Watch for events
Flags: --duration <duration>

AI apps

CommandDoes
mcpServe the camera tools to an AI app over MCP. Serve your camera to an AI app
Flags: --camera <VID:PID>, --output <folder>

This computer

CommandDoes
camerasList the cameras attached over USB. List cameras
Flags: --json
doctorCheck this computer and any attached camera. Check your setup
Flags: --json

Diagnostics sharing

Benchmark and sharing explains each of these.

CommandDoes
telemetry benchmarkRun every check on the attached camera. Benchmark your camera
Flags: --camera <VID:PID>, --no-photo, --no-live-view, --json
telemetry statusShow the sharing preference. See the sharing preference
Flags: --email, --json
telemetry opt-inShare diagnostics. Turn sharing off or on
telemetry opt-outStop sharing diagnostics. Turn sharing off or on
telemetry deleteTurn sharing off and delete what was shared. Delete what was shared
Flags: -y, --yes
telemetry whoamiPrint your diagnostic ID. Your diagnostic ID
telemetry login <email>Link an email to your contributions. Link an email
telemetry logoutRemove the linked email. Link an email

Shell

CommandDoes
completions <bash|zsh|fish>Print a shell completion script. Tab completion
manOpen the manual page. The manual page
help [command]Show help for a command. Get help in the terminal
versionPrint the version. Run or install
Flags: --json
⌘I