4kr is the primary client for Forkr. It talks to forkr-api over HTTP and WebSocket, so every command here maps to a documented API route. Use the CLI for day-to-day work; reach for the API when you need to drive Forkr from your own tooling.

Install

curl -fsSL https://forkr.sh | sh
This installs 4kr to ~/.local/bin. Once a deployment is configured, keep the CLI current with the version your API serves:
4kr upgrade

Select a target

The CLI needs a base URL and a bearer token to reach the API. Both resolve from the selected profile, so most commands take no connection flags:
4kr config set profile dev
4kr list
Use FORKR_PROFILE=<name> or the global --profile <name> flag to target a different deployment for a single command. See target selection and profiles for the full resolution order.

Global flags

These flags work on every command:
FlagDescription
--profile <name>Target a specific profile instead of the selected default.
--url <url>Override the API base URL.
--token <token>Override the bearer token.
--ip <ip>Override the connection IP, keeping the Host header for TLS/SNI.
--secure / --insecureForce-enable or disable TLS verification.
-h, --helpPrint help. Add --help (not -h) for the long form with examples.

Box refs

Most commands target a box by its ref. The common forms:
FormMeaning
nameBox name in the resolved project.
project:nameExplicit project.
-An ephemeral box (auto-created, auto-deleted).
See reference resolution for project resolution and every ref form.

Command groups

Boxes

Create, list, update, stop, resume, delete, publish, and inject.

Exec and console

Run commands, attach terminals, tail logs, and wait on ports.

Files

Copy files into and out of a box filesystem.

Services and compose

Run long-lived services, publish them, and deploy previews.

Data, snapshots, and bases

Manage data volumes, root checkpoints, and base templates.

Auth and access

Sign in, manage auth policy, GitHub grants, and project users.

Setup and config

Deploy an environment, manage profiles, and check health.