Command-line reference
Every octic-sensor command and flag, and every option of the Linux, Windows and macOS install scripts, with defaults.
This page lists the octic-sensor commands and flags in sensor version
1.0.0, the macOS commands added in 1.1.0, and the options of the install
scripts. The executable is /usr/bin/octic-sensor on Linux,
C:\Program Files\OcticSensor\octic-sensor.exe on Windows and
/usr/local/libexec/octic-sensor on macOS. Run
octic-sensor <command> --help on a host for the same detail.
| Command | Platform | What it does |
|---|---|---|
octic-sensor status | All | Report the sensor's health on this host. Read-only. |
octic-sensor report | All | Scan the host once and print the AI tools found. Sends nothing. |
octic-sensor install | All | Install the service. On Linux and Windows it also starts it; on macOS it never does. |
octic-sensor uninstall | All | Stop and remove the service and withdraw the Claude Code and Codex settings. |
octic-sensor run | Linux, macOS | Run the sensor loop. The systemd service and the launch daemon run this. |
octic-sensor start | Windows, macOS | Start the OcticSensor service or the com.octic.sensor launch daemon. |
octic-sensor stop | Windows, macOS | Stop the OcticSensor service or the com.octic.sensor launch daemon. |
octic-sensor configure | Windows | Change the service's API and ingest addresses. |
octic-sensor claude hook | All | Receive one Claude Code hook event. Claude Code runs it; you don't. |
octic-sensor codex hook | All | Receive one Codex hook event. Codex runs it; you don't. |
octic-sensor completion | All | Print a shell completion script for bash, zsh, fish or powershell. |
octic-sensor help | All | Show help for any command. |
On Windows, run refuses to start directly; the OcticSensor service
hosts the sensor loop instead. On macOS, start the sensor with start, not
run, so launchd runs it.
These work with every command.
| Flag | Default | Effect |
|---|---|---|
-z, --log-level <level> | info | Log detail: trace, debug, info, notice, warning or error. Logs go to standard error. |
-x, --include-source-locations | true | Add source locations to log lines. Released builds don't include them, so this has no effect there. |
-v, --version | Print the version and exit. | |
-h, --help | Show help. |
The OCTIC_LOG_LEVEL environment variable sets the log level when
--log-level isn't passed.
octic-sensor status [--probe | --require-probe] [--output text|json|yaml] [--config <path>]| Flag | Default | Effect |
|---|---|---|
--probe | off | Ask Octic once whether it accepts the enrollment token, and report the outcome. An unreachable Octic doesn't fail the exit code. |
--require-probe | off | Like --probe, but exit 2 unless Octic accepts the token. |
-o, --output <format> | text | text, json or yaml. |
--config <path> | /etc/octic/octic-sensor/config.yaml; C:\ProgramData\Octic\Sensor\config.yaml on Windows; /Library/Application Support/OcticSensor/config.yaml on macOS | The configuration file to check. |
| Exit code | Meaning |
|---|---|
0 | Healthy. |
1 | Degraded: enrolled and running, but at least one check failed. |
2 | Not enrolled or not configured, including a rejected token. |
status writes nothing and is safe to run as any user. Checks it can't
complete without root report unknown. See
Verify a host for the checks.
octic-sensor report [--scope all|system|user] [--output json|yaml] [--no-exec]| Flag | Default | Effect |
|---|---|---|
--scope <scope> | all | all, system or user. |
-o, --output <format> | json | json or yaml. |
--no-exec | off | Run no helper or version commands; report only what's on disk and in the process table. |
report prints to standard output and sends nothing to Octic.
Linux and macOS.
octic-sensor run [--config <path>] [--once]| Flag | Default | Effect |
|---|---|---|
--config <path> | /etc/octic/octic-sensor/config.yaml; /Library/Application Support/OcticSensor/config.yaml on macOS | The configuration file. A missing file at the default path isn't an error. |
--once | off | Send one poll and exit. |
octic-sensor install [--no-start] [--enable=false]Writes the systemd unit, the tmpfiles.d rule and
/etc/octic/octic-sensor/config.yaml.example, reloads systemd, then enables
and restarts octic-sensor.service. It doesn't place the executable or
write the enrollment token; the install script does that. Running it again
is safe, and is how the script upgrades.
| Flag | Default | Effect |
|---|---|---|
--no-start | off | Install without starting. The unit is still enabled for the next boot. |
--enable | true | Enable the unit so it starts at boot. --enable=false doesn't. |
octic-sensor uninstall [--purge]Stops the service, removes the unit, the tmpfiles.d rule and the example
configuration, and withdraws the Claude Code settings file and the sensor's
Codex entries. It never deletes the executable.
| Flag | Default | Effect |
|---|---|---|
--purge | off | Also delete /etc/octic/octic-sensor (the token and configuration) and any queued events. |
Get-Content token.txt | .\octic-sensor.exe install --token-stdin [--api-url <url>] [--ingest-url <url>] [--skip-verify] [--no-start].\octic-sensor.exe install --updateCopies the executable into C:\Program Files\OcticSensor, registers the
OcticSensor service under LocalSystem and starts it, then asks Octic to
accept the token. If Octic rejects it, the service is stopped and set to
manual start, and the files are kept for a retry. The install script runs
this for you.
| Flag | Default | Effect |
|---|---|---|
--token-stdin | off | Read the enrollment token from standard input. Required for a fresh install and for --reenroll. The token is never accepted as an argument. |
--update | off | Update an existing installation, keeping its configuration and token. |
--reenroll | off | Enroll retained files with a new token after an uninstall. Needs --token-stdin. |
--api-url <url> | https://api.octic.ai | The API address, as an HTTPS origin. |
--ingest-url <url> | https://ingest.octic.ai | The ingest address, as an HTTPS origin. |
--skip-verify | off | Don't ask Octic to accept the token after starting. |
--no-start | off | Register the service without starting it. It still starts at boot. Skips verification. |
& 'C:\Program Files\OcticSensor\octic-sensor.exe' uninstall [--purge]Withdraws the sensor's Claude Code and Codex settings, deletes the
enrollment token, and removes the OcticSensor service and its event log
source. The configuration and queued events are kept. It never deletes the
executable; the install script's -Uninstall removes the folder too.
| Flag | Default | Effect |
|---|---|---|
--purge | off | Also delete the configuration and queued events. |
Windows only.
& 'C:\Program Files\OcticSensor\octic-sensor.exe' start& 'C:\Program Files\OcticSensor\octic-sensor.exe' stop& 'C:\Program Files\OcticSensor\octic-sensor.exe' configure --api-url <url> --ingest-url <url>Flag (configure) | Effect |
|---|---|
--api-url <url> | The API address, as an HTTPS origin. |
--ingest-url <url> | The ingest address, as an HTTPS origin. |
sudo /usr/local/libexec/octic-sensor install [--enable]Writes the launch daemon, /Library/LaunchDaemons/com.octic.sensor.plist,
disabled and not loaded. It never starts the sensor; use start. It
doesn't place the executable or write the enrollment token; the install
script does that. It refuses while the launch daemon is loaded, so stop the
sensor first.
| Flag | Default | Effect |
|---|---|---|
--enable | off | Write the boot profile instead: launchd starts the sensor at boot and restarts it when it exits with an error. Needs a configuration file the sensor can use. |
--no-start | on | Must stay on. --no-start=false is refused. |
sudo /usr/local/libexec/octic-sensor uninstall [--purge]Stops and disables the launch daemon, withdraws the Claude Code settings
file and the sensor's Codex entries, and removes the launch daemon's plist.
The token, configuration, queued events and log are kept. It never deletes
the executable; delete it afterwards with
sudo rm /usr/local/libexec/octic-sensor.
| Flag | Default | Effect |
|---|---|---|
--purge | off | Also delete the token, /Library/Application Support/OcticSensor, the log and any queued events. |
sudo /usr/local/libexec/octic-sensor startsudo /usr/local/libexec/octic-sensor stopstart needs a configuration file the sensor can use. It enables and loads
the launch daemon and starts the sensor, keeping whichever profile
install wrote. If the sensor is already running, it does nothing.
stop unloads and disables the launch daemon, so the sensor doesn't start
at boot or restart until you run start again. It works even when the
configuration file is broken.
Claude Code and Codex run these on each hook event, with the event on standard input. The sensor writes the flags into the settings it deploys, from the configuration file; you don't run them by hand. They fail open: an error in the sensor never fails the hook, so it can't interrupt a session.
| Flag | Default | Effect |
|---|---|---|
--spool <path> | The Claude Code or Codex queue | Where to write the event. |
--max-bytes <n> | 262144 | The largest event to accept. |
--capture-prompts | true | Keep prompt text. |
--capture-tool-inputs | true | Keep tool arguments. |
--capture-tool-outputs | true | Keep tool results. |
--capture-assistant-messages | true | Keep the model's replies. |
--capture-transcript-usage | true | claude hook only: read token counts from the local transcript. |
codex hook also lists --handler-id, a marker the sensor uses to
recognize its own Codex entries, and --strict, which reports receiver
errors to the caller instead of failing open.
install.sh [--enrollment-token <token>] [--api-url <url>] [--ingest-url <url>] [--no-start] [--skip-verify]install.sh --uninstall [--purge]install.sh --helpPass options to the piped script after sh -s --:
curl -fsSL https://get.octic.ai/sensor-linux/latest/install.sh | sh -s -- --uninstall| Option | Environment variable | Effect |
|---|---|---|
--enrollment-token <token> | OCTIC_ENROLLMENT_TOKEN | The enrollment token. Written to /etc/octic/octic-sensor/enrollment.token with mode 0600. Without either, an installed host keeps its token; otherwise the script prompts on the terminal. |
--api-url <url> | OCTIC_API_URL | The API address. Default https://api.octic.ai. Writes config.yaml. |
--ingest-url <url> | OCTIC_INGEST_URL | The ingest address. Default https://ingest.octic.ai. Writes config.yaml. |
--no-start | Install and enable the service without starting it. | |
--skip-verify | Don't ask Octic to accept the token before installing. | |
--uninstall | Stop the service, withdraw the Claude Code and Codex settings, and remove the executable. | |
--purge | With --uninstall, also delete the token, configuration and queued events. | |
-h, --help | Show usage. | |
OCTIC_SENSOR_VERSION | Override the version the script installs. For testing. | |
OCTIC_BASE_URL | Override the download location, such as a mirror. For testing. |
Prefer the environment variable or the prompt for the token: an argument is visible in the process list while the script runs.
--api-url and --ingest-url write /etc/octic/octic-sensor/config.yaml
containing only those keys. The script writes the file whole: it backs up an
existing one to config.yaml.<timestamp>.bak and warns about any address it
resets to the default.
install.ps1 [-EnrollmentToken <token>] [-ApiUrl <url>] [-IngestUrl <url>] [-SkipVerify]install.ps1 -Reenroll [-EnrollmentToken <token>] [-ApiUrl <url>] [-IngestUrl <url>] [-SkipVerify]install.ps1 -Configure -ApiUrl <url> -IngestUrl <url>install.ps1 -Start | -Stopinstall.ps1 -Uninstall [-Purge]install.ps1 -HelpTo pass parameters to the downloaded script, run it as a script block:
& ([scriptblock]::Create((irm https://get.octic.ai/sensor-windows/latest/install.ps1))) -Uninstall| Parameter | Environment variable | Effect |
|---|---|---|
-EnrollmentToken <token> | OCTIC_ENROLLMENT_TOKEN | The enrollment token. The parameter wins if both are set. Without either, the script prompts without echo. An installed host ignores it. |
-ApiUrl <url> | OCTIC_API_URL | The API address, as an HTTPS origin with no path. Default https://api.octic.ai. |
-IngestUrl <url> | OCTIC_INGEST_URL | The ingest address, as an HTTPS origin with no path. Default https://ingest.octic.ai. |
-SkipVerify | Don't ask Octic to accept the token. Install and -Reenroll only. | |
-Reenroll | Enroll retained installation files with a new token, after octic-sensor.exe uninstall. | |
-Configure | Point an installed sensor at new addresses. Needs both -ApiUrl and -IngestUrl. | |
-Start, -Stop | Start or stop the installed service. | |
-Uninstall | Remove the service, withdraw the Claude Code and Codex settings, delete the token and remove C:\Program Files\OcticSensor. Keeps the configuration and queued events. | |
-Purge | Uninstall, and also delete the configuration and queued events. | |
-Help | Show usage. | |
OCTIC_SENSOR_VERSION | Override the version the script installs. For testing. | |
OCTIC_BASE_URL | Override the download location, such as a mirror. For testing. |
Run without a mode, the script installs, or upgrades a host that already
has the sensor. On an upgrade, passing both -ApiUrl and -IngestUrl also
applies them. The earlier spelling -Action Install|Update|Reenroll|Configure|Start|Stop|Uninstall|Purge
still works.
bootstrap-macos.sh (--token-stdin | --token-file <path>) [--api-url <url>] [--ingest-url <url>]bootstrap-macos.sh --helpThe Enroll Host command downloads this script from
https://get.octic.ai/sensor-macos/<version>/install.sh, saves it as
bootstrap-macos.sh in a private temporary folder, and runs it as your own
user with the token on standard input. The script refuses to run as root.
It verifies the release, then uses sudo to install the executable, the
token and the configuration, and runs octic-sensor install. It never
starts the sensor.
| Option | Effect |
|---|---|
--token-stdin | Read the enrollment token from standard input. |
--token-file <path> | Read the enrollment token from a file, given as an absolute path. |
--api-url <url> | The API address, as a bare HTTPS origin. Default https://api.octic.ai. |
--ingest-url <url> | The ingest address, as a bare HTTPS origin. Default https://ingest.octic.ai. |
-h, --help | Show usage. |
Every run needs exactly one of --token-stdin or --token-file; the token
is never accepted as an argument or from the environment. The script writes
/Library/Application Support/OcticSensor/config.yaml with the addresses you
pass, or {} without them, and stops if a different file is already there.
The version is fixed in the script, so it takes no version or download
location option; pick the version in the URL.
Last updated
Was this page helpful?