Aller au contenu principal

Reference · CLI

CLI reference

Every grotte subcommand, argument, and option. Generated from grotte --help — re-run that against your installed version if you suspect drift.

Install

bash
npm install -g @grotte/cli

Latest published version: see @grotte/cli on npm. Check yours with grotte --version.

Authentication

Most commands require auth. Two paths:

bash
grotte auth login                       # browser flow (recommended)
grotte auth login --key grt_...         # non-interactive, sandbox scope only

The --key shortcut is useful in CI: paste a team API key and run sandbox-scoped commands without a browser. Template + team-management commands still require the browser flow — they need a personal access token, not a team API key.


grotte auth

Authentication commands.

grotte auth login

Log in to the CLI.

OptionDescription
--key <apiKey>Log in non-interactively with a team API key (grt_…). Sandbox-scoped commands work; template/team-management commands still require the browser flow.

grotte auth logout

Log out of the CLI. Clears ~/.grotte/config.json.

grotte auth info

Print information about the current logged-in user (email, team, token scope).

grotte auth configure

Interactive prompt to update saved credentials.


grotte sandbox · alias sbx

Work with sandboxes.

grotte sandbox create [template] · alias cr

Create a sandbox and connect a terminal to it.

OptionDescription
-p, --path <path>Change root directory where the command is executed.
--config <grotte-toml>Path to the GROTTE config toml. Default ./grotte.toml. (The new build system does not use config files.)
-d, --detachCreate the sandbox without attaching a terminal.
-j, --jsonPrint the creation result as JSON (implies --detach).

grotte sandbox connect <sandboxID> · alias cn

Attach a terminal to an already-running sandbox.

grotte sandbox info <sandboxID> · alias in

Show information for a sandbox.

OptionDescription
-f, --format <format>Output format — json or pretty.

grotte sandbox list · alias ls

List sandboxes (running by default).

OptionDescription
-s, --state <state>Filter by state — running, paused. Defaults to running.
-m, --metadata <metadata>Filter by metadata, e.g. key1=value1.
-l, --limit <limit>Limit results (default 1000, 0 = no limit).
-f, --format <format>Output format — json or pretty.

grotte sandbox kill [sandboxIDs...] · alias kl

Kill one or more sandboxes immediately.

OptionDescription
-a, --allKill all sandboxes.
-s, --state <state>With --all, filter by state. Defaults to running.
-m, --metadata <metadata>With --all, filter by metadata.

grotte sandbox pause <sandboxID> · alias ps

Pause a sandbox (filesystem state retained).

grotte sandbox resume <sandboxID> · alias rs

Resume a paused sandbox.

grotte sandbox logs <sandboxID> · alias lg

Show logs for a sandbox.

OptionDescription
--level <level>Filter by level — DEBUG, INFO, WARN, ERROR. Higher levels also shown. Default INFO.
-f, --followStream until the sandbox closes.
--format <format>json or pretty. Default pretty.
--loggers [loggers]Filter by loggers — comma-separated.

grotte sandbox metrics <sandboxID> · alias mt

Show CPU / RAM / disk metrics.

OptionDescription
-f, --followStream metrics.
--format <format>json or pretty. Default pretty.

grotte sandbox exec <sandboxID> <command...> · alias ex

Execute a one-off command in a running sandbox.

OptionDescription
-b, --backgroundRun in background and return immediately.
-c, --cwd <dir>Working directory.
-u, --user <user>Run as the specified user.
-e, --env <KEY=VALUE>Set environment variable (repeatable).

grotte snapshot · alias snap

Manage sandbox snapshots — frozen filesystem state reusable as a template.

grotte snapshot create <sandboxID> · alias cr

Snapshot a sandbox to a reusable template.

grotte snapshot list · alias ls

List snapshots.

OptionDescription
-s, --sandbox <sandboxID>Filter snapshots by source sandbox ID.
-f, --format <format>json or pretty.

grotte snapshot delete <snapshotID> · alias rm

Delete a snapshot.


grotte template · alias tpl

Manage sandbox templates.

grotte template create <template-name> · alias ct

Build a Dockerfile (or grotte.template.ts / grotte_template.py) into a sandbox template. The template name must match [a-z0-9-_]+.

OptionDescription
-p, --path <path>Change root directory.
-d, --dockerfile <file>Dockerfile path. Defaults to grotte.Dockerfile then Dockerfile.
-c, --cmd <start-command>Command run when the sandbox starts (as sudo).
--ready-cmd <ready-command>Command that must exit 0 for the template to be marked ready.
--cpu-count <cpu-count>CPU count. Default 2.
--memory-mb <memory-mb>Memory in MB. Must be even. Default 512.
--no-cacheSkip cache when building.

grotte template list · alias ls

List sandbox templates.

OptionDescription
-t, --team <team-id>Team ID. Find it at dashboard?tab=team.
-f, --format <format>json or pretty.

grotte template init · alias it

Initialize a new sandbox template using the SDK.

OptionDescription
-p, --path <path>Change root directory.
-n, --name <name>Template name.
-l, --language <language>Target language — typescript, python-sync, python-async.

grotte template delete [template] · alias dl

Delete a sandbox template (and its grotte.toml config). Without [template], deletes the one defined in grotte.toml.

OptionDescription
-p, --path <path>Change root directory.
--config <grotte-toml>Path to grotte.toml.
-s, --selectSelect template from an interactive list.
-t, --team <team-id>Team ID.
-y, --yesSkip manual delete confirmation.

grotte template publish [template] · alias pb

Publish a sandbox template (makes it discoverable + usable by other teams).

OptionDescription
-p, --path <path>Change root directory.
--config <grotte-toml>Path to grotte.toml.
-s, --selectSelect from interactive list.
-t, --team <team-id>Team ID.
-y, --yesSkip publish confirmation.

grotte template unpublish [template] · alias upb

Reverse template publish.

grotte template migrate

Migrate a grotte.Dockerfile + grotte.toml to the new Template SDK format (defining a template).

OptionDescription
-d, --dockerfile <file>Dockerfile path. Defaults to grotte.Dockerfile.
--config <grotte-toml>Path to grotte.toml.
-l, --language <language>Target — typescript, python-sync, python-async.
-p, --path <path>Change root directory.

Where to file CLI bugs

GitHub: parallactic-ai/grotte-sdk. Include the version (grotte --version), your platform, and the full command output.