@runhooks/cli

Command-line interface for Runhooks — reliable HTTP scheduling infrastructure. Schedule webhooks in seconds. Never lose a webhook again.

Works on macOS, Linux, and Windows (cmd.exe, PowerShell, Git Bash, WSL).

Installation

Requirements

  • Node.js 20 or newer (node --version to check)
  • A package manager: npm, pnpm, or yarn

Install globally

Using npm:

bash
npm install -g @runhooks/cli

Using pnpm:

bash
pnpm add -g @runhooks/cli

Using yarn:

bash
yarn global add @runhooks/cli

After installation, the runhooks command should be available everywhere.

bash
runhooks --version

Run without installing

bash
npx @runhooks/cli <command>

Verifying the install on Windows

If runhooks is not recognized after a global install on Windows, the npm global bin directory is probably not on your PATH. Find it with:

cmd
npm config get prefix

Then add that directory (for npm, usually %APPDATA%\npm) to your User PATH via System Properties → Environment Variables, and open a new terminal.

Verifying the install on macOS / Linux

Make sure your shell can find globally-installed npm binaries. They're usually in /usr/local/bin (system Node) or ~/.npm-global/bin (user-scoped). If not found:

bash
echo $PATH
npm config get prefix

Add <prefix>/bin to your PATH in ~/.zshrc, ~/.bashrc, or ~/.profile and restart your terminal.

Quick Start (30 seconds)

The fastest path from zero to a running scheduled job:

bash
# 1. Create an account (no email required)
runhooks init

# 2. Schedule a webhook every 5 minutes
runhooks create -n "Sync inventory" -u https://api.example.com/sync -m POST --cron "*/5 * * * *"

# 3. Check it's running
runhooks list

# 4. View execution logs
runhooks logs <job-id>

That's it. Your job is live. When you're ready, secure your account:

bash
# Add email & password (so you can log in from the dashboard too)
runhooks upgrade

Already have an account?

If you registered via the web dashboard and have an API key:

bash
runhooks login --api-key rh_live_xxxxxxxxxxxx

Account Commands

runhooks init

Create an anonymous account and save credentials locally. This is the recommended starting point — no email, no password, just start scheduling.

OptionDescription
--name <name>Display name (will prompt if omitted)
bash
# Interactive — prompts for an optional display name
runhooks init

# Non-interactive
runhooks init --name "My Server"

If a config already exists, you'll be asked to confirm before overwriting.

runhooks login

Store API credentials locally. Use this when you already have an API key (e.g. from the web dashboard or from a teammate).

OptionDescription
--api-key <key>Your API key (hidden prompt if omitted)
bash
# Interactive — prompts for API key
runhooks login

# Non-interactive (CI-friendly)
runhooks login --api-key rh_live_xxxxxxxxxxxx

The CLI validates the credentials against the API before saving.

runhooks logout

Remove stored credentials.

bash
runhooks logout

runhooks whoami

Show your current account details and verify the connection.

bash
runhooks whoami

Output:

text
API URL:  https://api.runhooks.app
API Key:  rh_abc1…ef90
Name:     Ronen
Email:    (anonymous)
Plan:     free
Account:  anonymous

Tip: Run `runhooks upgrade` to add email/password.

runhooks upgrade

Add email and password to an anonymous account. This lets you log in from the web dashboard and protects your account if you lose your API key.

bash
runhooks upgrade

Two upgrade paths are offered:

  1. Inline (default) — enter email and password directly in the terminal.
  2. Browser link — get a one-time URL to complete the upgrade in the web dashboard.

If your account already has an email, this command exits cleanly with a message.

runhooks rotate-key

Generate a new API key. The old key stops working immediately.

OptionShortDescription
--force-fSkip confirmation prompt
bash
# With confirmation prompt
runhooks rotate-key

# Non-interactive
runhooks rotate-key -f

The new key is saved to your config automatically.

Job Commands

runhooks create

Create a new scheduled job. You must provide either --cron or --interval (not both).

OptionShortDescriptionDefault
--name <name>-n(required) Job name
--url <url>-u(required) Target URL to hit on each run
--description <text>-dOptional human-readable description
--method <method>-mHTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)GET
--header <header>-HHTTP header in "Key: Value" form. Repeatable.
--body <body>-bRequest body (string)
--timeout <duration>-tRequest timeout (e.g. 30s, 60s, 5m)30s
--cron <expression>Cron expression (e.g. "*/5 * * * *")
--interval <duration>Interval duration (e.g. 30s, 5m, 1h, 2d)
--timezone <tz>IANA timezone (only for cron schedules)
--tag <tag>Tag to attach. Repeatable.
--max-retries <n>Max retry attempts on failure3
--initial-delay <duration>Initial retry delay1s
--jsonOutput the created job as JSON
bash
# Cron-scheduled POST with auth header
runhooks create -n "Refresh cache" \
  -u https://api.example.com/refresh \
  -m POST \
  -H "Authorization: Bearer xyz" \
  --cron "0 * * * *" \
  --timezone "America/New_York"

# Interval-scheduled GET with tags
runhooks create -n "Healthcheck" -u https://api.example.com/health --interval 30s --tag prod --tag healthcheck

# Output as JSON for piping
runhooks create -n "Test job" -u https://example.com --interval 1m --json

Duration format: <number><unit> where unit is one of ms, s, m, h, d. A bare integer is interpreted as milliseconds.

runhooks list alias: ls

List your jobs.

OptionShortDescription
--status <status>-sFilter by status: active, paused, completed, failed
--tag <tag>-tFilter by tag
--name <name>-nFilter by name (regex)
--page <n>Page number
--limit <n>Results per page
--jsonOutput as JSON
bash
runhooks list
runhooks ls --status active
runhooks ls --tag prod --limit 50

runhooks get <id>

Show details of one job.

OptionDescription
--jsonOutput as JSON
bash
runhooks get 65f8a1b2c3d4e5f6a7b8c9d0

runhooks update <id>

Update an existing job. Only the flags you provide are changed — everything else stays the same.

OptionShortDescription
--name <name>-nJob name
--description <text>-dJob description
--url <url>-uTarget URL
--method <method>-mHTTP method
--header <header>-HHTTP header in "Key: Value" form. Repeatable.
--body <body>-bRequest body
--timeout <duration>-tRequest timeout
--cron <expression>Cron expression
--interval <duration>Interval duration
--timezone <tz>IANA timezone
--tag <tag>Tags (replaces all existing tags)
--max-retries <n>Max retry attempts
--initial-delay <duration>Initial retry delay
--status <status>Set status (active or paused)
--jsonOutput as JSON
bash
# Rename a job
runhooks update 65f8a1b2c3d4e5f6a7b8c9d0 -n "New name"

# Change schedule and URL
runhooks update 65f8a1b2c3d4e5f6a7b8c9d0 --cron "0 */2 * * *" -u https://new-url.example.com

# Pause via update (same as runhooks pause)
runhooks update 65f8a1b2c3d4e5f6a7b8c9d0 --status paused

runhooks pause <id>

Pause a job. The job stops executing until resumed.

bash
runhooks pause 65f8a1b2c3d4e5f6a7b8c9d0

runhooks resume <id>

Resume a paused job.

bash
runhooks resume 65f8a1b2c3d4e5f6a7b8c9d0

runhooks delete <id> alias: rm

Delete a job. Prompts for confirmation unless --force is supplied.

OptionShortDescription
--force-fSkip the confirmation prompt
bash
runhooks delete 65f8a1b2c3d4e5f6a7b8c9d0
runhooks rm 65f8a1b2c3d4e5f6a7b8c9d0 -f

Execution Commands

runhooks logs <job-id>

Show recent executions for a job.

OptionShortDescriptionDefault
--limit <n>-lResults per page20
--page <n>Page number1
--status <status>-sFilter by execution status (success, failed, timeout, running, pending)
--jsonOutput as JSON
bash
runhooks logs 65f8a1b2c3d4e5f6a7b8c9d0
runhooks logs 65f8a1b2c3d4e5f6a7b8c9d0 --status failed --json

runhooks replay <execution-id>

Re-run a past execution immediately. Useful for debugging or recovering from transient failures. The replay creates a new execution linked to the original.

bash
runhooks replay 65f9b2c3d4e5f6a7b8c9d0e1

Alert Commands

Alerts notify you when jobs fail. Supports email, webhook, and Slack channels.

runhooks alerts list

List all your alerts.

OptionDescription
--jsonOutput as JSON
bash
runhooks alerts list
runhooks alerts list --json

runhooks alerts create

Create a new alert.

OptionShortDescriptionDefault
--name <name>-n(required) Alert name
--channel <channel>-c(required) email, webhook, or slack
--target <target>(required) Destination (email address, webhook URL, or Slack URL)
--job-id <id>Scope to a specific job (omit for all jobs)all jobs
--threshold <n>Consecutive failures before alert fires1
--cooldown <minutes>Minimum minutes between repeat alerts60
--disabledCreate in disabled state
--jsonOutput as JSON
bash
# Email alert on any job failure
runhooks alerts create -n "All failures" -c email --target [email protected]

# Webhook alert for a specific job, after 3 consecutive failures
runhooks alerts create -n "Critical sync alert" -c webhook \
  --target https://hooks.slack.com/xxx \
  --job-id 65f8a1b2c3d4e5f6a7b8c9d0 \
  --threshold 3

# Slack alert with 30-minute cooldown
runhooks alerts create -n "Slack notify" -c slack --target https://hooks.slack.com/yyy --cooldown 30

runhooks alerts get <id>

Show alert details.

OptionDescription
--jsonOutput as JSON
bash
runhooks alerts get 65fa1b2c3d4e5f6a7b8c9d0e

runhooks alerts update <id>

Update an alert. Only the flags you provide are changed.

OptionShortDescription
--name <name>-nAlert name
--channel <channel>-cAlert channel
--target <target>Destination
--enableEnable the alert
--disableDisable the alert
--jsonOutput as JSON
bash
# Change target
runhooks alerts update 65fa1b2c3d4e5f6a7b8c9d0e --target [email protected]

# Disable an alert
runhooks alerts update 65fa1b2c3d4e5f6a7b8c9d0e --disable

runhooks alerts delete <id>

Delete an alert. Prompts for confirmation unless --force is supplied.

OptionShortDescription
--force-fSkip confirmation prompt
bash
runhooks alerts delete 65fa1b2c3d4e5f6a7b8c9d0e
runhooks alerts delete 65fa1b2c3d4e5f6a7b8c9d0e -f

Template Commands

Templates bundle opinionated defaults (retry policy, headers, tags) for common job shapes so you don't have to remember the right knobs every time.

runhooks template list

List all bundled templates.

OptionDescription
--jsonOutput as JSON
bash
runhooks template list

runhooks template use <name>

Create a job from a template. Prompts for any placeholder not supplied via --set.

OptionDescription
--set KEY=VALUEPre-fill a placeholder value (repeatable)
--no-promptFail if any placeholder is unset (CI-friendly)
--jsonOutput the created job as JSON
bash
runhooks template use retry-webhook \
  --set TARGET_URL=https://api.example.com/hooks/retry \
  --set CRON_EXPRESSION="*/10 * * * *"

Bundled templates

NameWhat it creates
retry-webhookGeneric POST webhook with aggressive retries (5 attempts, exponential backoff).
shopify-webhook-retryReplay a Shopify webhook with HMAC headers and Shopify-tuned retries.

Usage & Plan

runhooks usage

Show your current plan usage and limits.

OptionDescription
--jsonOutput as JSON
bash
runhooks usage

When you hit a plan limit (e.g. max jobs or max alerts), the CLI will suggest running runhooks upgrade to unlock higher limits.

Configuration

The CLI stores credentials in a config file at:

OSPath
macOS / Linux~/.runhooks/config.json
Windows%USERPROFILE%\.runhooks\config.json

The file is created automatically by runhooks init or runhooks login. On macOS/Linux it is chmod 0600 (user read/write only). On Windows, file permissions follow the user's profile ACL.

The file is plain JSON:

json
{
  "apiUrl": "https://api.runhooks.app",
  "apiKey": "rh_live_xxxxxxxxxxxxxxxxxxxxxxxx"
}

Environment Variables

You can override the file-based config with environment variables. These take precedence when both are set, making the CLI ideal for CI/CD pipelines.

VariableDescription
RUNHOOKS_API_URLAPI base URL
RUNHOOKS_API_KEYAPI key
NO_COLORSet to any value to disable ANSI color output

Setting env vars

macOS / Linux (bash/zsh):

bash
export RUNHOOKS_API_URL="https://api.runhooks.app"
export RUNHOOKS_API_KEY="rh_live_xxxxxxxxxxxx"
runhooks list

Windows (cmd.exe):

cmd
set RUNHOOKS_API_URL=https://api.runhooks.app
set RUNHOOKS_API_KEY=rh_live_xxxxxxxxxxxx
runhooks list

Windows (PowerShell):

powershell
$env:RUNHOOKS_API_URL = "https://api.runhooks.app"
$env:RUNHOOKS_API_KEY = "rh_live_xxxxxxxxxxxx"
runhooks list

Cross-Platform Notes

The CLI is platform-agnostic, but a few shell conventions differ.

Quoting cron expressions

Cron expressions contain * which is a glob character. Always quote them.

ShellExample
bash / zsh--cron "*/5 * * * *"
Windows cmd--cron "*/5 * * * *"
PowerShell--cron "*/5 * * * *"

Multi-line commands

ShellLine continuation
bash / zshtrailing \
Windows cmdtrailing ^
PowerShelltrailing ` (backtick)

JSON bodies with quotes

bash/zsh — use single quotes outside:

bash
runhooks create -n "Webhook" -u https://example.com --interval 1m -b '{"event":"test"}'

Windows cmd / PowerShell — escape inner quotes with \":

cmd
runhooks create -n "Webhook" -u https://example.com --interval 1m -b "{\"event\":\"test\"}"

Hidden input

When the CLI prompts for a password or API key, input is hidden. On Windows this works in cmd.exe, PowerShell, and Windows Terminal. In non-TTY environments, pass values via flags instead.

Colors

ANSI colors are auto-disabled when:

  • NO_COLOR environment variable is set
  • stdout is not a TTY (e.g. piped to a file)

Exit Codes

CodeMeaning
0Success
1Error (invalid arguments, API error, network failure, auth failure, etc.)
130Cancelled by user (Ctrl+C during a prompt)

Troubleshooting

runhooks: command not found

The npm global bin directory is probably not on your PATH. See the Installation section above for how to fix this on each platform.

Authentication failed. Check your API key.

Your stored key is invalid or revoked. Run runhooks rotate-key if you need a new one, or runhooks logout && runhooks login to re-enter credentials.

Cannot reach <url>. Is the API running?

The API URL is wrong or unreachable. For local development, make sure the API is running on the configured port.

Not configured.

Run runhooks init for quick setup, or runhooks login with an existing API key.

Plan limit reached.

You've hit a free-tier limit. Run runhooks upgrade to add email/password (required for paid plans), then upgrade your plan from the web dashboard.

Garbled symbols in Windows cmd.exe

The legacy console can't render UTF-8 glyphs. Use Windows Terminal or PowerShell 7+, or run chcp 65001 in your cmd session.

Command Reference

text
Account
  runhooks init [--name]                     Create anonymous account
  runhooks login [--api-key]                 Store existing credentials
  runhooks logout                            Remove credentials
  runhooks whoami                            Show current account
  runhooks upgrade                           Add email/password
  runhooks rotate-key [-f]                   Rotate API key

Jobs
  runhooks create [options]                  Create a job
  runhooks list [options]                    List jobs
  runhooks get <id> [--json]                 Show job details
  runhooks update <id> [options]             Update a job
  runhooks pause <id>                        Pause a job
  runhooks resume <id>                       Resume a job
  runhooks delete <id> [-f]                  Delete a job

Executions
  runhooks logs <job-id> [options]           Show execution logs
  runhooks replay <execution-id>             Re-run an execution

Alerts
  runhooks alerts list [--json]              List alerts
  runhooks alerts create [options]           Create an alert
  runhooks alerts get <id> [--json]          Show alert details
  runhooks alerts update <id> [options]      Update an alert
  runhooks alerts delete <id> [-f]           Delete an alert

Templates
  runhooks template list [--json]            List templates
  runhooks template use <name> [options]     Create job from template

Other
  runhooks usage [--json]                    Show plan usage