Using Cronitor CLI
CronitorCLI is our cross-platform, open source companion application. Run it on your workstation and deploy it to your server for powerful features, including:
Import and sync all of your cron jobs Complete your integration in minutes with cronitor sync and sync schedule changes to Cronitor automatically.
Easier integration with Cronitor Run and monitor any command with exec and use ping to send telemetry pings more reliably than curl.
Power tools for your cron jobs Use list and select to view and run any cron job on your system. Use shell to test running a command like cron does.
Installation
Install by Script (recommended)
CronitorCLI is packaged as a single executable for Linux, MacOS and Windows. This installation script selects the right binary for your operating system and platform. Installation does not require an API key; authenticate separately after inspecting the installed command. View Source
You can re-run this script at any time to install the latest version of CronitorCLI.
curl -fsSL 'https://cronitor.io/install-linux?sudo=1' | sh
cronitor help
Do not run cronitor sync until you have reviewed the jobs it will discover and approved the resulting Cronitor resources and crontab changes.
Manual Installation
Download and install a prebuilt executable for your platform, or compile CronitorCLI directly from source.
Linux (amd64)
Choosing an installation location The easiest way to integrate and use CronitorCLI is to install the binary system-wide in /usr/bin. If you choose an alternate install location (e.g. your home directory) you will need to remember and use its full path when running commands.
Downloading and installing Paste each instruction into a terminal and execute. Because /usr/bin is a privileged directory you will require sudo or root access for that step. By default the CronitorCLI config file is stored in /etc/cronitor and you will also need sudo access to create and write this file.
curl -sOL https://cronitor.io/dl/linux_amd64.tar.gz
sudo tar xvf linux_amd64.tar.gz -C /usr/bin/
Testing your installation To verify your installation, run cronitor help from your terminal.
MacOS (amd64)
Choosing an installation location The easiest way to integrate and use CronitorCLI is to install the binary system-wide in /usr/bin. If you choose an alternate install location (e.g. your home directory) you will need to remember and use its full path when running commands.
Downloading and installing Paste each instruction into a terminal and execute. Because /usr/bin is a privileged directory you will require sudo or root access for that step. By default the CronitorCLI config file is stored in /etc/cronitor and you will also need sudo access to create and write this file.
curl -sOL https://cronitor.io/dl/darwin_amd64.tar.gz
sudo tar xvf darwin_amd64.tar.gz -C /usr/local/
Testing your installation To verify your installation, run cronitor help from your terminal.
Windows
- Download application: https://cronitor.io/dl/windows_amd64.zip
- Unzip and move the executable to
%ProgramFiles%\for system-wide use - Run
%ProgramFiles%\cronitor.exe helpfrom PowerShell or cmd.
Testing your installation To verify your installation, run %ProgramFiles%\cronitor.exe from powershell. A usage block will be printed to your screen.
More Options
Download an executable CronitorCLI builds for multiple platforms and operating systems can be found on our Github Release page: https://github.com/cronitorio/cronitor-cli/releases
Verify a build MD5 and SHA256 hashes for every build are available on our Github Release page: https://github.com/cronitorio/cronitor-cli/releases
Installing from source View on Github
After installation, inspect cronitor help before authenticating or changing cron jobs.
Authentication
Provide CRONITOR_API_KEY through an approved secret injector. Never put a literal key in --api-key, a copied command, source control, shell history, logs, tickets, or screenshots.
Your API key authorizes resource management; it is not a production workload credential. Give deployed jobs a telemetry-only CRONITOR_PING_API_KEY or another documented runtime credential through their secret manager.
Usage
Command Reference
cronitor help
cronitor <command> --help
Use the installed command's help as the command reference; it stays aligned with that binary's version and available resource commands.
Account resource commands
CronitorCLI manages the same account resources exposed by Cronitor's API. The installed command's --help output is authoritative for its version.
| Resource | Command | Common operations |
|---|---|---|
| Monitors | cronitor monitor | list, search, get, export, create, update, delete, clone, pause, unpause |
| Status pages | cronitor statuspage | list, get, create, update, delete; manage components with statuspage component |
| Issues | cronitor issue | list, get, create, update, resolve, delete, bulk |
| Notification lists | cronitor notification | list, get, create, update, delete |
| Groups | cronitor group | list, get, create, update, delete, pause, resume |
| Environments | cronitor environment | list, get, create, update, delete |
| Maintenance windows | cronitor maintenance | list, get, create, update, delete |
| Metrics | cronitor metric | get, aggregate |
| RUM sites | cronitor site | list, get, create, update, delete, errors, query |
Representative examples:
cronitor monitor list --type job --env production
cronitor monitor update billing-rollup --data '{"name":"Billing rollup"}'
cronitor issue list --state unresolved --severity outage
cronitor issue update ISSUE_KEY --data '{"state":"investigating"}'
cronitor statuspage component list --statuspage company-status
cronitor notification list
cronitor group list --with-status
cronitor environment list
cronitor maintenance list --upcoming
cronitor metric aggregate --monitor billing-rollup --time 30d
cronitor site errors --site web-app
Use --format json|table|yaml where supported, --output to write supported output to a file, and --data or --file as shown by the individual create/update command. Before sending a payload, read cronitor <resource> <operation> --help and the linked raw API documentation. The CronitorCLI README resource reference contains additional examples.
Safe use
Wrap an executable without uploading its output
cronitor exec sends the wrapped command's stdout and stderr to Cronitor by default. It also includes the command string with run telemetry. Begin with output collection disabled:
cronitor exec --no-stdout monitor-key path/to/executable arg1 arg2
CLI flags such as --no-stdout must appear before the monitor key. Inspect the executable's arguments for passwords, tokens, connection strings, or customer data; move sensitive values to the workload's normal secret injector. Remove --no-stdout only after deciding that the output is appropriate to retain in Cronitor.
Put the wrapper in the real crontab, scheduler, service, or deployment command and preserve the executable's exit status. A test invocation from a setup shell does not prove that the production scheduler is monitored.
Limit agent-visible output
Start account inspection with the CLI's default table or summary output. JSON/YAML exports and event expansions may contain request headers, bodies, event messages, or captured output. Request and locally filter those fields only when needed; do not paste raw exports into an agent conversation.
Keep verbose and file logging disabled during credential setup and telemetry debugging unless the destination and contents have been reviewed. Logs can include telemetry URLs or other sensitive request details.
Treat sync, create, update, delete, and crontab-editing commands as writes. Inspect their help and proposed scope, reconcile stable monitor keys, and obtain approval before running them.
On Your Server
If you're using Cronitor to monitor traditional cron jobs, cronitor sync is the easiest way to create monitors and keep their schedule in sync with your server. If you're monitoring Windows scheduled tasks, scripts, daemons, ETL processes or almost anything else, using CronitorCLI for cronitor exec and cronitor ping will send telemetry pings more reliably than simply using Curl.
- Required configuration can be provided as environment variables or from a json file. See Configuration section for details.
- Update easily to the latest version with a simple
cronitor updatecommand. - Install CronitorCLI in a system-wide location to more easily monitor tasks running as different users.
On Your Local Machine
Running CronitorCLI on your local machine enables quick commandline access to your Cronitor account.
- Use
cronitor statusto view your current Cronitor dashboard details from your terminal - View and query monitor activity using
cronitor activity. Use the optional--before [timestamp]param to paginate results. - Like server deployment, update easily to the latest version with a simple
cronitor updatecommand.
Configuration
Configuration variables like api key and current server hostname can be provided as runtime arguments or environment variables. Alternatively, the configure command can be used to save configuration variables to a file.
Prefer environment variables supplied by a secret manager over literal arguments. Configure management and telemetry credentials separately; some CLI versions fall back to the management API key for telemetry when CRONITOR_PING_API_KEY is absent. A credential file must be owned by the runtime user and readable only by that user (0600 on Unix-like systems).
| Name | Argument | Variable name |
|---|---|---|
| Monitor API Key | -k, --api-key [key] | CRONITOR_API_KEY |
| Telemetry Events API Key | -p, --ping-api-key [key] | CRONITOR_PING_API_KEY |
| Current server name | -n, --hostname [name] | CRONITOR_HOSTNAME |
| Log Cronitor activity | --log [path] | CRONITOR_LOG |
| Exclude from name | -e, --exclude-from-name [substring] | CRONITOR_EXCLUDE_TEXT |
| Config file to use | -c, --config [path to file] | CRONITOR_CONFIG |
| Environment to send telemetry events to | --env | CRONITOR_ENV |
| Disable sending job output logs to Cronitor | --no-stdout |
Default Config File Locations
| Platform | Default config file location |
|---|---|
| Linux | /etc/cronitor/cronitor.json |
| MacOS | /etc/cronitor/cronitor.json |
| Windows | %SystemDrive%\ProgramData\Cronitor\cronitor.json |
Uninstall
First, you will need to update any crontab files that were edited to include Cronitor to remove the reference to cronitor exec MONITOR_KEY that were added when you created monitors.
Then, remove the cronitor executable from wherever it was installed. If you followed our default instructions it can be removed with rm /usr/bin/cronitor