A command-line tool for controlling Axis IP cameras: general VAPIX control (params, PTZ, ACAPs, reboot), CamOverlay/CamStreamer/CamSwitcher management, and fleet-wide health checks — all from the terminal.
How_axis-cli_Automates_Camera_Fleets.mp4
Built on camstreamerlib v4, commander, and cli-table3.
npm install
npm run build
npm link # makes the `axis` command available globallyOr run it directly without linking: node dist/index.js <command>.
Camera credentials are stored per-profile in ~/.axis-cli/config.json (mode 0600), so you only type them once.
# Local network camera
axis camera add q1656 --ip 192.168.1.50 --user root --pass mypassword
# HTTPS camera
axis camera add frontdoor --ip 192.168.1.60 --pass mypassword --tls
# Camera reached via CamStreamer Cloud (device-connect.net) instead of a local IP
axis camera add remote-cam --cloud-url https://xxxx.device-connect.net --cloud-token YOUR_DEVICE_ACCESS_TOKEN
axis camera list
axis camera remove q1656Every command below takes the profile name you chose here, not a raw IP.
axis info q1656 # brand, firmware, serial, installed ACAPs
axis param get q1656 root.Brand.ProdFullName root.Network.eth0.IPAddress
axis param set q1656 root.Time.DST=yes
axis reboot q1656 --yesaxis ptz presets q1656 -c 1
axis ptz goto q1656 "Home" -c 1
axis ptz position q1656 -c 1axis apps list q1656
axis apps start q1656 CamOverlay
axis apps stop q1656 CamOverlay
axis apps restart q1656 CamScripteraxis overlay list q1656
axis overlay enable q1656 2
axis overlay disable q1656 2
axis overlay text q1656 2 temperature=22.5C humidity=45%axis stream show q1656 42448
axis stream start q1656 42448
axis stream stop q1656 42448axis switcher list q1656
axis switcher switch q1656 MainView
axis switcher queue q1656 GateView
axis switcher queue-clear q1656Runs across every saved camera profile and reports reachability, firmware, SD card status, and how many ACAPs are running — handy as a cron job or CamStreamer Scheduler / Claude Scheduled Task.
axis fleet healthaxis events watch q1656 # prints VAPIX events (motion, I/O, ACAP events...) until Ctrl+CFor anything not wrapped above:
axis vapix get q1656 /axis-cgi/param.cgi action=list group=Image
axis vapix post q1656 /axis-cgi/restart.cgi--cloud-url/--cloud-tokenprofiles authenticate viaDEVICE_ACCESS_TOKENinstead of Basic/Digest auth, matching the CamStreamer Cloud (device-connect.net) proxy pattern. Live event watching (axis events watch) requires a local--ipprofile since it opens a direct WebSocket to the camera.- CamSwitcher control has no dedicated camstreamerlib wrapper in older library versions, but v4's
CamSwitcherAPIexposesplaylistSwitch/playlistQueuePush/etc. directly, which this CLI uses. - Extend this by adding a new file under
src/commands/, exporting aregister*Commands(program)function, and wiring it intosrc/index.ts.