Skip to content

CLI

The hadronbox npm package is a command-line tool. The command is hadronbox, short form hb. Node.js 20 or later is required (22 or later for hb sh). For all commands and flags, run npx hadronbox --help.

Installation

To run it without installing, use npx hadronbox <command>. For a permanent install:

npm i -g hadronbox
hb --help

What works today

Every command is described in full in the Command reference section below; each command's key scope and limits are written there.

Version: 0.4.0 (latest on npm). This version has machine management, exec, the interactive terminal (sh, needs Node.js 22 or later), file copying (cp), ports, services, disk, config, machines set, tools, credits (including budgets) and the snapshot commands. hb cp moves 100 MB per file; on machines whose server side has not been updated yet, the limit is 8 MB.

Credentials

Commands read the API key first from the HADRONBOX_API_KEY environment variable, otherwise from the profile saved with hb login. The key is not accepted as a command-line argument: arguments end up in the shell history and the process list. hb logout deletes the key from this computer only; the key stays valid on the server, so use the panel to revoke it.

Output

Data is written to stdout, and warnings and errors to stderr. The --json flag always writes a single JSON document to stdout.

Language

CLI messages are Turkish by default. For English messages, use --lang en or HADRONBOX_LANG=en. The command reference below is the English text of the CLI's own help.

Command reference

This section is generated from the CLI's own help text; the terminal shows the same with hb <command> --help.

hb login

Log in with an API key (from a hidden prompt or stdin with --with-api-key)

hb login [--with-api-key]

Options

  • --with-api-key: Read the key from stdin

Examples

hb login
hb login --with-api-key < anahtar.txt
echo "$HB_KEY" | hb login --with-api-key --profile ci

hb logout

Remove the stored key of this profile

hb logout

Examples

hb logout
hb logout --profile ci

hb whoami

Show who you are, your package and quota

hb whoami

Examples

hb whoami
hb whoami --json

hb machines

Manage machines (ls, create, status, set, pause, resume, rm)

hb machines <subcommand> [name] [options]

Aliases: machine, m

Subcommands

  • ls: List machines (with quota)
  • create: Create a machine; prints its name on stdout
  • status: Machine state, idle time and auto-pause
  • set: Change a machine’s idle timeout and auto-pause
  • pause: Pause a machine (continue with resume); --hard stops it for good
  • resume: Resume a paused machine; a stopped machine cannot be started
  • rm: Delete a machine (asks first; --yes skips)

Examples

hb machines ls
hb machines create web
hb machines rm web --yes

Shortcuts: hb ls · hb create · hb status · hb set · hb pause · hb resume · hb rm

hb machines ls

List machines (with quota)

hb machines ls [--status <status>]

Alias: list

Options

  • --status <creating|running|paused|stopped|error>: Only machines in this state

Examples

hb machines ls
hb ls --status running
hb machines ls --json

hb machines create

Create a machine; prints its name on stdout

hb machines create [name] [--size small|medium|large] [--template <code>] [--from-snapshot <id|name> [--count <n> [--prefix <prefix>] [--partial]]] [--idle-timeout <minutes>] [--no-auto-pause] [--tool <tool>]...

Alias: new

Options

  • --size <small|medium|large>: Size: small 2 vCPU/2 GiB (default), medium 2/4, large 4/8. The desktop template needs at least medium (its default is medium). A size above the package vCPU/RAM limit is refused (beta package: small and medium, at most 2 vCPU / 4 GiB; no large)
  • --template <code>: Template code (e.g. standard)
  • --from-snapshot <id|name>: Create from a snapshot (id or name; hb snapshots ls). The snapshot brings its tools; cannot be used with --tool
  • --count <n>: With --from-snapshot: how many machines to open from the snapshot (1–10) (arrives with the next version)
  • --prefix <prefix>: With --count: machine name prefix (<prefix>-1 …); the snapshot name when omitted (arrives with the next version)
  • --partial: With --count: if not all fit, open as many as fit (default: open none) (arrives with the next version)
  • --idle-timeout <minutes>: Idle minutes before auto-pause (5 up to the package value; beta package: at most 15)
  • --no-auto-pause: Do not auto-pause when idle (the package must allow it; not on the beta package)
  • --tool <tool>: Tool to install (repeatable; e.g. --tool claude-code --tool node). Required tools are added automatically; install runs in the background

Examples

hb machines create
hb create web --size medium
hb create web --tool claude-code --tool node
hb create web2 --from-snapshot web-ilk
hb create --from-snapshot web-ilk --count 3 --prefix deney
hb create --from-snapshot web-ilk --count 5 --partial
NAME=$(hb create) && hb status "$NAME"

--count opens 1–10 machines from the same snapshot at once (names: <prefix>-1, <prefix>-2 …; the snapshot name when no prefix is given). The machine limit, the balance and the spend budget are checked first: if not all fit, none opens and the requested / available count is printed. --partial opens as many as fit; the rest are listed and the exit code is 6. The estimated hourly cost is printed.

hb machines status

Machine state, idle time and auto-pause

hb machines status <name>

Alias: show

Examples

hb machines status web
hb status web --json

hb machines set

Change a machine’s idle timeout and auto-pause

hb machines set <name> [--idle-timeout <minutes>] [--auto-pause | --no-auto-pause]

Alias: configure

Options

  • --idle-timeout <minutes>: Idle minutes before auto-pause (5 up to the package value; beta package: at most 15)
  • --auto-pause: Turn auto-pause on
  • --no-auto-pause: Do not auto-pause when idle (the package must allow it; not on the beta package)

Examples

hb machines set web --idle-timeout 10
hb set web --auto-pause
hb set web --no-auto-pause

hb machines pause

Pause a machine (continue with resume); --hard stops it for good

hb machines pause <name> [--hard [--yes]]

Alias: stop

Options

  • --hard: Stop for good: the machine cannot be started again, only deleted (asks first)
  • -y, --yes: Do not ask for confirmation with --hard

Examples

hb machines pause web
hb stop web
hb stop web --hard --yes

hb machines resume

Resume a paused machine; a stopped machine cannot be started

hb machines resume <name>

Alias: start

Examples

hb machines resume web
hb start web

hb machines rm

Delete a machine (asks first; --yes skips)

hb machines rm <name> [--yes]

Alias: delete

Options

  • -y, --yes: Do not ask for confirmation

Examples

hb machines rm web
hb rm web --yes

hb exec

Run a command in a machine; streams the output and exits with its exit code

hb exec <name> [--timeout <seconds>] -- <command> [argument...]

Options

  • --timeout <seconds>: Stop the command if it runs longer than this many seconds (1–3600)

Examples

hb exec web -- ls -la
hb exec web --timeout 60 -- "npm test | tail -20"
hb exec web --json -- uname -a

A single argument is a shell line; several arguments are passed as written (quoted). The exit code is the remote command’s; CLI-side failures exit 125 (see --json, details.cliExitCode). Ctrl+C also stops the command in the machine (from 0.3.0; 130). stdin is not forwarded.

hb sh

Open an interactive terminal in a machine (a shell or the given command)

hb sh <name> [-- <command> [argument...]]

Examples

hb sh web
hb sh web -- htop
hb sh web -- "npm run dev"

Needs a terminal (TTY) and Node.js 22 or newer. Every key, Ctrl+C included, goes to the machine; leave the shell with exit. The window size is followed; a dropped connection is retried for up to two minutes. The exit code is the remote shell’s or command’s; CLI-side failures exit 125. The session is closed on exit. Key scope: machines:exec.

hb cp

Copy a file (a directory with -r) between this computer and a machine

hb cp [-r] <source> <destination>

Options

  • -r, --recursive: Copy a directory with its contents

Examples

hb cp ./main.py web:src/
hb cp web:/workspace/out/report.pdf ./
hb cp -r ./proje web:
hb cp -r web:dist ./dist

One side must be <machine>:<path>; the machine path is inside /workspace (relative, or starting with /workspace/). Limit 100 MB per file; -r compresses the directory and moves it in one piece (up to 100 MB compressed) and needs tar on this computer. The machine must be running (resume a paused one first). Existing files are overwritten. Key scope: machines:exec.

hb run

Run an agent on a repository (on a new machine, the task headless); prints the run id on stdout

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb run --repo <adres> --task <text|@dosya> (--agent <ajan> | --agents <ajan,ajan,...>) [options]

Options

  • --repo <adres>: Public repository address (https)
  • --task <text|@dosya>: What the agent should do; @file reads it from a file (at most 8000 characters)
  • --agent <ajan>: Agent: claude-code, codex, gemini-cli, aider, opencode
  • --agents <ajan,ajan>: Give the same task to 2–4 different agents (comma separated: claude-code, codex, gemini-cli, aider, opencode); creates a comparison (arrives with the next version)
  • --branch <dal>: Branch to clone (the default branch when omitted)
  • --secret <AD>: Name of a secret to give the agent (repeatable, at most 10); the value is never sent
  • --size <boyut>: Machine size (default small)
  • --timeout <dk>: Time limit of the agent step in minutes (1–60, default 30)
  • --destroy: Delete the machine when the run ends (default: pause it)
  • --follow: Stream the output and wait until the run ends

Examples

hb run --repo https://github.com/acme/web --task "Fix the failing test" --agent claude-code --secret ANTHROPIC_API_KEY --follow
hb run --repo https://github.com/acme/web --task @task.md --agent codex --secret OPENAI_API_KEY --size medium --destroy
hb run --repo https://github.com/acme/web --task "Fix the failing test" --agents claude-code,codex --secret ANTHROPIC_API_KEY --secret OPENAI_API_KEY
hb runs ls

Public repositories only (github.com, gitlab.com, bitbucket.org; https). The agent’s API key is a secret saved in the panel and is given by name only (--secret ANTHROPIC_API_KEY); the agent and the code in the repository can read the key, so use a limited, separate one. --follow streams the output and exits when the run ends (0 if it succeeded, 6 otherwise). Ctrl+C only stops following; to stop the run use hb runs cancel. An API key needs the agent_runs:write scope. With --agents (2–4 different agents, comma separated) the same task goes to every agent on its own machine and a comparison id is printed; results side by side: hb runs compare <id>. The total machines, the balance and the spend budget are checked first; if not all fit, none starts (no queueing). --agents cannot be used with --follow.

hb runs

Agent runs (ls, show, cancel, logs, compare)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs <subcommand> [id] [options]

Subcommands

  • ls: List agent runs (newest first)
  • show: Show the status and result of a run
  • cancel: Cancel an unfinished run (the machine is paused; deleted if it was started with --destroy)
  • logs: Stream the output of a run; for a finished run prints the stored last part
  • compare: Show the results of an agent comparison side by side (duration, cost, changed files, summary)

Examples

hb runs ls
hb runs show run_0f8e6c1a2b3c4d5e8f90123456789abc
hb runs logs run_0f8e6c1a2b3c4d5e8f90123456789abc

hb runs ls

List agent runs (newest first)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs ls [--status <status>] [--agent <ajan>] [--limit <n>]

Alias: list

Options

  • --status <status>: Filter by status
  • --agent <ajan>: Filter by agent
  • --limit <n>: Most runs to show (1–200, default 20)

Examples

hb runs ls
hb runs ls --status running
hb runs ls --json

hb runs show

Show the status and result of a run

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs show <id>

Alias: get

Examples

hb runs show run_0f8e6c1a2b3c4d5e8f90123456789abc
hb runs show run_0f8e6c1a2b3c4d5e8f90123456789abc --json

hb runs cancel

Cancel an unfinished run (the machine is paused; deleted if it was started with --destroy)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs cancel <id>

Examples

hb runs cancel run_0f8e6c1a2b3c4d5e8f90123456789abc

A queued run is cancelled at once; a started one within seconds. A finished run answers 409.

hb runs logs

Stream the output of a run; for a finished run prints the stored last part

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs logs <id>

Examples

hb runs logs run_0f8e6c1a2b3c4d5e8f90123456789abc

Known secret values are masked as ***. For an unfinished run it waits until the agent starts; with --json the output arrives as one document when the run ends.

hb runs compare

Show the results of an agent comparison side by side (duration, cost, changed files, summary)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb runs compare <group>

Examples

hb runs compare rgrp_0f8e6c1a2b3c4d5e8f90123456789abc
hb runs compare rgrp_0f8e6c1a2b3c4d5e8f90123456789abc --json

The id is printed by hb run --agents. The cost is an estimate (machine minutes × the current price list). To see one agent’s run on its own: hb runs show <id> (the run ids are in the --json output). An API key needs the agent_runs:read scope.

hb ports

Preview ports (ls, expose, rm, token)

hb ports <subcommand> <name> [port] [options]

Alias: port

Subcommands

  • ls: List the preview ports of a machine
  • expose: Expose a machine port at a private preview URL; prints the URL on stdout
  • rm: Remove a preview port; its URL stops working at once and is never reused
  • token: Create an access token for a private preview port; prints the token on stdout

Examples

hb ports ls web
hb ports expose web 3000
hb ports token web 3000

hb ports ls

List the preview ports of a machine

hb ports ls <name>

Alias: list

Examples

hb ports ls web
hb ports ls web --json

hb ports expose

Expose a machine port at a private preview URL; prints the URL on stdout

hb ports expose <name> <port> [--label <text>]

Alias: open

Options

  • --label <text>: Port label (at most 60 characters)

Examples

hb ports expose web 3000
hb ports expose web 5173 --label "vite"
URL=$(hb ports expose web 3000)

To reach the URL sign in through the panel or get an access token: hb ports token <name> <port>

hb ports rm

Remove a preview port; its URL stops working at once and is never reused

hb ports rm <name> <port>

Aliases: close, delete

Examples

hb ports rm web 3000

hb ports token

Create an access token for a private preview port; prints the token on stdout

hb ports token <name> <port> [--ttl <seconds>]

Options

  • --ttl <seconds>: Token lifetime in seconds (60–86400)

Examples

hb ports token web 3000
hb ports token web 3000 --ttl 600
curl -H "X-Hadronbox-Preview-Token: $(hb ports token web 3000)" "$URL"

Send the token in the X-Hadronbox-Preview-Token header. Lifetime 60–86400 s (server default); capped at the API key expiry. Do not share the token.

hb snapshots

Snapshots (ls, create, rm)

hb snapshots <subcommand> [machine|id] [options]

Alias: snapshot

Subcommands

  • ls: List snapshots
  • create: Take a snapshot of a machine (in the background); prints the snapshot name on stdout
  • rm: Delete a snapshot (asks first; --yes skips)

Examples

hb snapshots ls
hb snapshots create web --name web-ilk --wait
hb snapshots rm web-ilk

hb snapshots ls

List snapshots

hb snapshots ls

Alias: list

Examples

hb snapshots ls
hb snapshots ls --json

hb snapshots create

Take a snapshot of a machine (in the background); prints the snapshot name on stdout

hb snapshots create <machine> --name <name> [--wait]

Alias: new

Options

  • --name <name>: Snapshot name (lowercase letters, digits, "-"; 2–40 characters)
  • --wait: Wait until the snapshot is ready or failed

Examples

hb snapshots create web --name web-ilk
hb snapshots create web --name web-ilk --wait
hb machines create --from-snapshot web-ilk

A snapshot copies the whole machine disk (installed software included); the machine must be running or paused. State: hb snapshots ls. Tools cannot be chosen when a machine is created from a snapshot.

hb snapshots rm

Delete a snapshot (asks first; --yes skips)

hb snapshots rm <id|name> [--yes]

Alias: delete

Options

  • -y, --yes: Do not ask for confirmation

Examples

hb snapshots rm web-ilk
hb snapshots rm web-ilk --yes

A deleted snapshot cannot be restored; machines already created from it are not affected.

hb credits

Show your balance, state, hourly burn and estimated time left

hb credits [ledger|budget] [--machine <machine>]

Alias: balance

Subcommands

  • ledger: List balance movements (newest first)
  • budget: Monthly spend budgets (warn / pause)

Options

  • --machine <machine>: One machine’s spend this month, hourly rate and budget (name or id)

Examples

hb credits
hb balance --json
hb credits ledger --limit 50
hb credits --machine web
hb credits budget

Balance enforcement is currently off: machines are not paused when the balance runs out. Once it is on, running machines are paused; your data is kept. Details: https://hadronbox.tr/panel/bakiye (opens in a new tab)

hb credits ledger

List balance movements (newest first)

hb credits ledger [--limit <n>]

Options

  • --limit <n>: Number of rows (1–100, default 20)

Examples

hb credits ledger
hb credits ledger --limit 50
hb credits ledger --json

Hourly usage rows are folded into one row per day. --limit 1–100 (default 20).

hb credits budget

Monthly spend budgets (warn / pause)

hb credits budget [ls|set|rm]

Alias: budgets

Subcommands

  • ls: List spend budgets and this month’s spend
  • set: Set or change the monthly budget of the organization or a machine
  • rm: Remove the organization or a machine budget (asks first; --yes skips)

Examples

hb credits budget
hb credits budget set --limit 200
hb credits budget rm --machine web

A budget looks at this month’s spend (Istanbul time); warning at 80% (--warn), at 100% the action: pause (default) or warn only. It works independently of balance enforcement. Metering lags a few minutes, so the limit is approximate. Paused machines do not resume on their own. Changing budgets needs the owner or admin role.

hb credits budget ls

List spend budgets and this month’s spend

hb credits budget ls

Alias: list

Examples

hb credits budget ls
hb credits budget ls --json

hb credits budget set

Set or change the monthly budget of the organization or a machine

hb credits budget set --limit <TL> [--machine <machine>] [--warn <percent>] [--action pause|warn]

Options

  • --limit <TL>: Monthly limit in TL (VAT included, 1–1,000,000)
  • --machine <machine>: Machine budget (name or id); without it the organization budget
  • --warn <percent>: Warning threshold, 1–99 (default 80)
  • --action <pause|warn>: At the limit: pause = pause running machines (default), warn = warn only

Examples

hb credits budget set --limit 200
hb credits budget set --machine web --limit 50 --action warn
hb credits budget set --limit 500 --warn 90

A budget looks at this month’s spend (Istanbul time); warning at 80% (--warn), at 100% the action: pause (default) or warn only. It works independently of balance enforcement. Metering lags a few minutes, so the limit is approximate. Paused machines do not resume on their own. Changing budgets needs the owner or admin role.

hb credits budget rm

Remove the organization or a machine budget (asks first; --yes skips)

hb credits budget rm [--machine <machine>] [--yes]

Alias: delete

Options

  • --machine <machine>: Machine budget (name or id); without it the organization budget
  • -y, --yes: Do not ask for confirmation

Examples

hb credits budget rm
hb credits budget rm --machine web --yes

Machines the budget paused do not resume on their own; resume them with hb machines resume.

hb disk

Show your persistent /workspace disk size, the choices and the price above 20 GB

hb disk [grow <20|50|100>]

Subcommands

  • grow: Make the persistent disk larger (20, 50 or 100 GB; grow only, data kept)

Examples

hb disk
hb disk --json
hb disk grow 50

hb disk grow

Make the persistent disk larger (20, 50 or 100 GB; grow only, data kept)

hb disk grow <20|50|100>

Examples

hb disk grow 50
hb disk grow 100 --json

Without a disk it is created with this size. Otherwise the size is applied at the next cold boot: when a new machine starts after the current one is deleted, or when the machine is restarted. Pause / resume keep the size.

hb tools

Machine tools (ls, add, retry)

hb tools <subcommand> <name> [tool]

Alias: tool

Subcommands

  • ls: List the tools of a machine and their install state
  • add: Add tools to a running machine (installed in the background)
  • retry: Retry the install of a failed tool

Examples

hb tools ls web
hb tools add web claude-code
hb tools retry web codex

hb tools ls

List the tools of a machine and their install state

hb tools ls <name>

Alias: list

Examples

hb tools ls web
hb tools ls web --json

States: pending, installing (percent and step), ready (version), failed (error code; retry: hb tools retry <name> <tool>).

hb tools add

Add tools to a running machine (installed in the background)

hb tools add <name> <tool>... [--tool <tool>]

Options

  • --tool <tool>: Tool to install (repeatable; e.g. --tool claude-code --tool node). Required tools are added automatically; install runs in the background

Examples

hb tools add web claude-code
hb tools add web --tool codex --tool go

The machine must be running (not while it is still being created). Tools already on the machine stay as they are. State: hb tools ls <name>

hb tools retry

Retry the install of a failed tool

hb tools retry <name> <tool>

Examples

hb tools retry web codex

A tool gets at most 3 install rounds; once they are used up this command answers TOOL_NOT_RETRYABLE (exit 6).

hb services

Background services (ls, add, edit, rm, start, stop, restart, logs)

hb services <subcommand> <machine> [service] [options]

Aliases: service, svc

Subcommands

  • ls: List the background services of a machine and their state
  • add: Add a background service to a machine (starts while the machine runs)
  • edit: Change the command, working directory or restart policy of a service
  • rm: Stop and delete a service (asks first; --yes skips)
  • start: Start a stopped service
  • stop: Stop a service and keep its definition
  • restart: Restart a running service now
  • logs: Print the last output of a service (stdout and stderr)

Examples

hb services ls web
hb services add web opencode -- opencode serve --hostname 0.0.0.0 --port 4096
hb services logs web opencode

A service does not keep the machine awake: if the machine pauses automatically its services stop and continue when it wakes up. To reach a service from outside: hb ports expose <machine> <port>

hb services ls

List the background services of a machine and their state

hb services ls <machine>

Alias: list

Examples

hb services ls web
hb services ls web --json

States: pending (applied when the machine runs), starting, running, retrying, crash loop (waits 5 min), stopped, failed, unsupported (re-create the machine).

hb services add

Add a background service to a machine (starts while the machine runs)

hb services add <machine> <service> [--cwd <directory>] [--restart always|on-failure] [--disabled] -- <command>...

Alias: create

Options

  • --command <command>: Command to run (with bash -lc); can also follow "--"
  • --cwd <directory>: Working directory (absolute path; default /workspace)
  • --restart <always|on-failure>: Restart policy: always (on every exit, default) | on-failure (only after an error exit)
  • --disabled: Define it but do not start it (later: hb services start)

Examples

hb services add web opencode -- opencode serve --hostname 0.0.0.0 --port 4096
hb services add web dev --cwd /workspace/app -- "npm run dev -- --host 0.0.0.0"
hb services add web worker --restart on-failure --disabled --command "python worker.py"

The command runs as the machine user with bash -lc. Do not put secrets in the command; read them from a file in /workspace (e.g. set -a; . /workspace/.env; set +a; opencode serve).

hb services edit

Change the command, working directory or restart policy of a service

hb services edit <machine> <service> [--command <command>] [--cwd <directory>] [--restart always|on-failure]

Alias: update

Options

  • --command <command>: Command to run (with bash -lc); can also follow "--"
  • --cwd <directory>: Working directory (absolute path; default /workspace)
  • --restart <always|on-failure>: Restart policy: always (on every exit, default) | on-failure (only after an error exit)

Examples

hb services edit web opencode --command "opencode serve --hostname 0.0.0.0 --port 4097"
hb services edit web dev --restart on-failure
hb services edit web dev -- npm run dev

A changed service restarts with the new definition. The name cannot change (delete and add it again).

hb services rm

Stop and delete a service (asks first; --yes skips)

hb services rm <machine> <service> [--yes]

Alias: delete

Options

  • -y, --yes: Do not ask for confirmation

Examples

hb services rm web opencode
hb services rm web opencode --yes

hb services start

Start a stopped service

hb services start <machine> <service>

Examples

hb services start web opencode

hb services stop

Stop a service and keep its definition

hb services stop <machine> <service>

Examples

hb services stop web opencode

hb services restart

Restart a running service now

hb services restart <machine> <service>

Examples

hb services restart web opencode

The machine must be running. A stopped service answers SERVICE_DISABLED (exit 6); first: hb services start

hb services logs

Print the last output of a service (stdout and stderr)

hb services logs <machine> <service> [--tail <bytes>]

Alias: log

Options

  • --tail <bytes>: How many last bytes (1–262144)

Examples

hb services logs web opencode
hb services logs web opencode --tail 4096

Output is kept only in the machine's memory (last 256 KiB per service) and is cleared when the machine stops. --tail 1–262144 bytes (default 65536). The machine must be running.

hb schedules

Scheduled and triggered jobs (ls, add, rm, run, runs, enable, disable, trigger-token)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules <subcommand> <machine|job> [options]

Aliases: schedule, cron

Subcommands

  • ls: List the scheduled jobs of a machine
  • add: Add a scheduled job to a machine
  • rm: Delete a scheduled job (asks first; --yes skips)
  • run: Start the job now (also when disabled); follow the result with runs
  • runs: List the last 50 runs of a job (--output prints the latest run’s output)
  • enable: Enable the job (clears the failure counter and the disable reason)
  • disable: Disable the job (stops it without deleting)
  • trigger-token: Create or rotate the token of the job’s URL trigger (shown only once)

Examples

hb schedules ls web
hb schedules add web yedek --cron "0 3 * * *" -- "cd /workspace/app && npm run backup"
hb schedules runs web/yedek

The schedule is read in Istanbul time; the shortest interval is 15 minutes. A job is named by its id (sch_…) or as <machine>/<job name>. Adding, changing and deleting need the owner or admin role.

hb schedules ls

List the scheduled jobs of a machine

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules ls <machine>

Alias: list

Examples

hb schedules ls web
hb schedules ls web --json

hb schedules add

Add a scheduled job to a machine

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules add <machine> <name> --cron <cron> [--timeout <minutes>] -- <command>...

Alias: create

Options

  • --cron <cron>: 5-field cron in Istanbul time; shortest interval 15 minutes (e.g. "0 3 * * *")
  • --timeout <minutes>: Time limit of one run in minutes (1–60; default 30)
  • --command <command>: Shell commands to run (with sh, in /workspace); can also follow "--"

Examples

hb schedules add web yedek --cron "0 3 * * *" -- "cd /workspace/app && npm run backup"
hb schedules add web temizlik --cron "*/30 * * * *" --timeout 10 --command "rm -rf /tmp/cache"

The command is written to a script file and run with sh in the workspace; secrets arrive as for hb exec. A paused machine is resumed for the job and paused again when it ends. At most 5 jobs per organization; closed during the first 7 days of a new organization. 3 failed runs in a row disable the job.

hb schedules rm

Delete a scheduled job (asks first; --yes skips)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules rm <job> [--yes]

Alias: delete

Options

  • -y, --yes: Do not ask for confirmation

Examples

hb schedules rm web/yedek
hb schedules rm sch_0123456789abcdef0123456789abcdef --yes

hb schedules run

Start the job now (also when disabled); follow the result with runs

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules run <job>

Examples

hb schedules run web/yedek

If the previous run is still going, the new run is recorded as "skipped".

hb schedules runs

List the last 50 runs of a job (--output prints the latest run’s output)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules runs <job> [--output]

Alias: history

Options

  • --output: Print the output of the latest run

Examples

hb schedules runs web/yedek
hb schedules runs web/yedek --output

The last 4 KB of the output is kept (stdout and stderr together); known secret values are replaced by ***.

hb schedules enable

Enable the job (clears the failure counter and the disable reason)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules enable <job>

Examples

hb schedules enable web/yedek

hb schedules disable

Disable the job (stops it without deleting)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules disable <job>

Examples

hb schedules disable web/yedek

hb schedules trigger-token

Create or rotate the token of the job’s URL trigger (shown only once)

This command arrives with the next CLI version (0.5.0); it is not in the published version yet.

hb schedules trigger-token <job>

Examples

hb schedules trigger-token web/yedek
hb schedules trigger-token web/yedek --json

To trigger from outside: POST to the trigger address with "Authorization: Bearer <token>" (or an HMAC-SHA256 signature of the body). A new token invalidates the old one at once. The token is written to stdout only; the address goes to stderr.

hb config

Configuration settings (get, set, unset: apiUrl, lang, profile)

hb config <subcommand> [setting] [value]

Subcommands

  • get: Print the effective value of a setting (all of them without a key)
  • set: Validate a setting and write it to config.json (apiUrl, lang: per profile; profile: the active profile)
  • unset: Remove a setting from config.json (back to the default)

Examples

hb config get
hb config set lang en
hb config unset apiUrl

Non-secret settings only. The HADRONBOX_API_URL, HADRONBOX_LANG and HADRONBOX_PROFILE environment variables and the --lang/--profile options take precedence over config.json.

hb config get

Print the effective value of a setting (all of them without a key)

hb config get [apiUrl|lang|profile]

Examples

hb config get
hb config get apiUrl
hb config get lang --json

The value is what the CLI uses right now (option > environment variable > config.json > default); --json also gives the source.

hb config set

Validate a setting and write it to config.json (apiUrl, lang: per profile; profile: the active profile)

hb config set <apiUrl|lang|profile> <value>

Examples

hb config set apiUrl https://api.hadronbox.tr
hb config set lang en
hb config set apiUrl http://127.0.0.1:3000 --profile dev
hb config set profile dev

apiUrl must start with https:// (http:// only for localhost). The file is written atomically with mode 0600; API keys can be neither read nor written by this command.

hb config unset

Remove a setting from config.json (back to the default)

hb config unset <apiUrl|lang|profile>

Examples

hb config unset apiUrl
hb config unset lang --profile ci

hb help

Show help (for a command or "exit-codes")

hb help [command…]

Examples

hb help
hb help exit-codes
hb help help --lang en

hb version

Print the CLI version

hb version

Examples

hb version
hb --version --json

Global options

Available on every command.

  • -h, --help: Show help
  • -v, --version: Print the version
  • --json: Machine-readable output: one JSON document on stdout (errors included)
  • --lang <tr|en>: Message language (default tr)
  • --no-color: Disable colors
  • --profile <name>: Profile to use (default "default")
  • --debug: Diagnostic lines (request path, status, timing; never the key)

Environment variables

  • HADRONBOX_API_KEY: API key (hb_live_…); takes precedence over a stored login
  • HADRONBOX_API_URL: API URL (default https://api.hadronbox.tr (opens in a new tab))
  • HADRONBOX_LANG: Message language: tr | en
  • HADRONBOX_PROFILE: Profile name
  • HADRONBOX_CONFIG_DIR: Config directory (default XDG / %APPDATA%)
  • HADRONBOX_CREDENTIAL_STORE: auto | keychain | file
  • NO_COLOR: Disables colors

Exit codes

Scripts and agents can decide by these numbers; the list is also shown with hb help exit-codes.

  • 0 OK: Success
  • 1 GENERAL: General error (server error, unexpected response, local file error)
  • 2 USAGE: Usage error (unknown command/option, missing or invalid argument, confirmation needed without a TTY)
  • 3 AUTH: Authentication/authorization: not logged in, invalid API key, forbidden (401/403)
  • 4 NOT_FOUND: Not found (404)
  • 5 PLAN_LIMIT: Plan or quota limit (402)
  • 6 INVALID_STATE: Invalid state or conflict (409)
  • 7 NETWORK: Network error, timeout, rate limited (429) or service temporarily unavailable (502/503/504)
  • 8 CLI_UPGRADE: This CLI version is no longer supported (426); update: npx hadronbox@latest
  • 125 REMOTE_NOT_STARTED: exec/sh: CLI-side failure (before the start, connection lost, --timeout); class: details.cliExitCode
  • 130 INTERRUPTED: Interrupted by the user (Ctrl+C / SIGINT; from 0.3.0 hb exec also stops the command in the machine)
CLI · hadronbox docs