oakctl tool
oakctl is a command-line tool that allows you to interact with your OAK4 cameras. It can be used to create, deploy, and manage apps and devices that are running the oak-agent service and are on the local network.
Note that oak-agent is pre-installed on OAK4 devices (it's baked into the Luxonis OS), so you can start using oakctl right away.Installation
Linux/MacOS
Windows
Linux/MacOS
Command Line
1bash -c "$(curl -fsSL https://oakctl-releases.luxonis.com/oakctl-installer.sh)"Update
oakctl tool later like this:Command Line
1oakctl self-updateProblems updating on Windows
If you have problems updating the oakctl version on Windows, download the installer from here.
Usage
Connect to a device
Command Line
1oakctl connectCommand Line
1oakctl connect 10.0.1.24--with-password flag. This will prevent you from entering the password every time the session expires.Find devices
oakctl allows you to interact with your devices that have oak-agent installed. You can list all available devices (found on your network) with the following command:Command Line
1oakctl list
2+---+---------------+---------------+------------+----------------+---------------+-------+
3| # | Serial Number | Device | Connection | OS | Agent Version | Setup |
4+=========================================================================================+
5| 1 | 1623452492 | Luxonis, Inc. | 10.0.1.24 | OS RVC4 1.18.0 | 0.13.7 | OK |
6| | | OAK4-D R7 | | | | |
7+---+---------------+---------------+------------+----------------+---------------+-------+App Development
Command Line
1oakctl app run /app/path/to/sourceoakapp.toml file.Optional flags:
| Flag | Description |
|---|---|
-d, --device <DEVICE_IP> | Specify the device to run the app on. By default, it will run on the first device from the list |
-b, --detach | Run the app in the background (detached mode). You can stop the app with oakctl app stop <CONTAINER_ID> |
Example apps
oakapp.toml:Command Line
1git clone https://github.com/luxonis/oak-examples.git
2cd oak-examples
3# Run an app
4oakctl app run ./neural-networks/pose-estimation/human-pose # or some other exampleApp Management
-d, --device <DEVICE> to specify the device to run the command on (IP address or index from the oakctl list).List installed apps
com.luxonis.default).Command Line
1$ oakctl app list
2+---+--------------------------------------+---------------------------+---------+--------------+
3| E | App Id | Identifier | Status | Frontend URL |
4+===============================================================================================+
5| * | f8da56a4-b602-45ec-8fda-7588bf7c473a | com.luxonis.default:1.3.8 | running | 10.0.1.24 |
6+---+--------------------------------------+---------------------------+---------+--------------+E) has asterisk if the app is enabled.Any app can be in one of the following states: installing, building, ready, starting, running, stopping, stopped, deleting, deleted, unknown.Ready means the app is installed and ready to run, but it was not started since the agent was started, while stopped means the app is installed but not running, it was stopped by the user.App control flow
start, stop, and delete. First, let's start the app:Command Line
1$ oakctl app start 612a745c-8d68-4264-a3d6-d06d14275ef5
2Starting app 612a745c-8d68-4264-a3d6-d06d14275ef5 ...
3 App has been started!Command Line
1$ oakctl app logs <container-id>
2Reading logs ...
3 Press Ctrl+C to stop reading logs.
4 App output:
5 [2025-02-12T14:37:54Z] Hello cli 1 / Wed Feb 12 14:37:54 UTC 2025-n flag:Command Line
1oakctl app logs <container-id> -n 10Command Line
1$ oakctl app stop 612a745c-8d68-4264-a3d6-d06d14275ef5
2Stopping app 612a745c-8d68-4264-a3d6-d06d14275ef5 ...
3 App has been stopped!Command Line
1$ oakctl app delete 612a745c-8d68-4264-a3d6-d06d14275ef5
2Deleting app 612a745c-8d68-4264-a3d6-d06d14275ef5 ...
3 App has been deleted!Command Line
1oakctl app enable <container-id>disable command:Command Line
1oakctl app disable <container-id>exec command:Command Line
1oakctl app exec <container-id> -i /bin/bashNote
Be careful when modifying files or saving data inside the container, as changes can be lost when the container is stopped or removed.Better approach is to mount a persistent folder from the host device into the container using mounts (see
oakapp.toml configuration).Install an app
--enable=false or --keep-others flags.App installation is done by following command:Command Line
1$ oakctl app install com-example-emotion_recognition_1-0-1.oakapp
2Sending data to agent ...
3 Data sent successfully!
4
5✔ Oakapp package built successfully.
6Installed app has ID: ddb8a884-d9e1-4779-a88b-c30d5d1e265f
7
8Start the app: oakctl app start ddb8a884-d9e1-4779-a88b-c30d5d1e265f*.oakapp file, from Hub (by identifier) or from URL.If you want to install app from Hub, do this:Command Line
1# Install app by identifier
2oakctl app install -i com.example.appCommand Line
1# Install app by URL
2oakctl app install -u https://example.com/app.oakappBuild And Publish App
*.oakapp file that can be installed on other devices:Command Line
1oakctl app build ./folder/app/srcoakapp.toml file. There are two optional flags:-k, --keep- keep the container after the build (useful if you want tooakctl app startit right after the build)-p, --publish- publish the app to the Hub after the build (the app will show up in the Hub's OAK4 Apps).-O, --optimized- build the app in optimized mode (smaller size, longer build time)-U, --update-descriptioon- update the app description on the Hub if the app is published-N, --no-download- do not download the oakapp file to host after build
oakapp.toml file.Hub connection
Command Line
1oakctl hub loginCommand Line
1oakctl hub statusCommand Line
1oakctl hub switch-teamCommand Line
1oakctl hub logout*.oakapp packages:Command Line
1oakctl hub publish <oakapp-file>Command Line
1oakctl hub run-script <script-file>Device Management
Device Info
Command Line
1$ oakctl device info
2Device Info:
3 OS: Luxonis OS RVC4 1.4.0
4 Agent Version: 2.0.11 (rvc4)
5 Architecture: linux/arm64
6 Serial Number: 2713799968
7 Model: Luxonis, Inc. KalamaP OAK4-D R1Device Update
CHANNEL are stable and beta:Command Line
1oakctl device update --channel=[CHANNEL]--select flag:Command Line
1oakctl device update --select --channel=[CHANNEL]Device Reboot
oakctl:Command Line
1oakctl device rebootDevice Unlock
Command Line
1oakctl device unlockDevice Flash
Command Line
1oakctl device flash [<path-to-tar.xz>]*.tar.xz image is optional; if not specified, the latest stable image will be downloaded and flashed. For detailed flashing and OS update instructions see updating OS page.oak-agent
oak-agent is a service that runs on the OAK4 device and manages the containers. It's responsible:- Managing apps, running containers
- Communicating with the
oakctltool - Communicating with the Hub (cloud platform)
Containers
runc as a lightweight container runtime, which is also what Docker/Podman uses. We opted-in for runc because it's lightweight and gives us full control over the container lifecycle.