A command-line interface for the Wherobots Cloud API. Submit and manage Spark job runs, stream logs, and access the full Wherobots API surface — all from your terminal.
- A Wherobots Cloud account and API key
- Go 1.25.7+ (only if building from source)
ghCLI (only if installing from a pre-built release)
If you have access to the wherobots/wbc-cli repository, use the installer script. This requires the GitHub CLI (gh) with gh auth login completed.
./scripts/install-release.shThe script:
- Detects your OS and architecture automatically.
- Downloads and verifies the SHA-256 checksum of the binary.
- Installs to
~/.local/bin/wherobotsby default (override with--install-dir). - Defaults to the
latest-prereleaserelease tag.
git clone https://github.com/wherobots/wbc-cli.git
cd wbc-cli
make build # produces bin/wherobots-
Set your API key (required for all commands):
export WHEROBOTS_API_KEY='<your-api-key>'
-
Explore available commands:
wherobots --help wherobots --tree # print the full command tree -
Submit a job run:
wherobots job-runs create s3://bucket/script.py --name my-job-001 --watch
The CLI has two command groups:
| Group | Description |
|---|---|
wherobots job-runs <subcommand> |
Purpose-built commands for creating, monitoring, and listing job runs. |
wherobots api <resource> ... <verb> |
Dynamically generated commands covering every Wherobots API endpoint. |
Curated commands for the most common job-run workflows: submitting runs, streaming logs, listing by status, and viewing metrics.
Submit a new job run. Accepts an S3 URI or a local file path (which is auto-uploaded to your Wherobots managed directory).
# submit from an S3 path
wherobots job-runs create s3://bucket/script.py --name my-job-001
# submit a local script (auto-uploaded)
wherobots job-runs create ./script.py --name my-job-001
# submit and stream logs until the run reaches a terminal status
wherobots job-runs create s3://bucket/script.py --name my-job-001 --watch
# override the upload destination for local files
wherobots job-runs create ./script.py --name my-job-001 --upload-path s3://my-bucket/custom/root| Flag | Description | Default |
|---|---|---|
-n, --name |
Required. Name for the job run. | — |
-r, --runtime |
Wherobots runtime size. | tiny |
--run-region |
Region to run the job in. | aws-us-west-2 |
--timeout |
Run timeout in seconds. | 3600 |
--args |
Arguments passed to the script. | — |
-c, --spark-config |
Repeatable Spark config key=value pairs. | — |
--dep-pypi |
PyPI dependency to install. | — |
--dep-file |
File dependency to include. | — |
--jar-main-class |
Main class for JAR jobs. | — |
-w, --watch |
Stream logs after submission until the run completes. | false |
--no-upload |
Skip auto-upload of local files. | false |
--upload-path |
Custom S3 root for uploading local files. | — |
--output |
Output format: text or json. |
json |
Fetch or stream logs for a job run.
# fetch logs once
wherobots job-runs logs <run-id>
# stream logs until the run completes
wherobots job-runs logs <run-id> --follow
# show only the last 50 lines
wherobots job-runs logs <run-id> --tail 50| Flag | Description | Default |
|---|---|---|
-f, --follow |
Stream logs continuously until the run finishes. | false |
-t, --tail |
Number of most recent lines to display. | — |
--interval |
Poll interval in seconds (used with --follow). |
2.0 |
--output |
Output format: text or json. |
text |
List job runs, optionally filtered by status, name, or region.
# list recent runs (JSON output)
wherobots job-runs list
# human-readable table
wherobots job-runs list --output text
# filter by status
wherobots job-runs list --status RUNNING --status FAILED| Flag | Description | Default |
|---|---|---|
-s, --status |
Repeatable status filter (e.g. RUNNING, FAILED, COMPLETED). |
— |
--name |
Filter by run name. | — |
--after |
Return runs created after this cursor/timestamp. | — |
-l, --limit |
Maximum number of results. | 20 |
--region |
Filter by region. | — |
--output |
Output format: text or json. |
json |
Shorthand aliases equivalent to job-runs list --status RUNNING, --status FAILED, or --status COMPLETED. They accept the same flags as job-runs list except --status.
wherobots job-runs running
wherobots job-runs failed --output text
wherobots job-runs completed --limit 5Display instant metrics (CPU, memory, etc.) for a running or recently completed job run.
wherobots job-runs metrics <run-id>
wherobots job-runs metrics <run-id> --output text| Flag | Description | Default |
|---|---|---|
--output |
Output format: text or json. |
json |
The api command group is generated at runtime from the Wherobots OpenAPI 3.x specification. Every endpoint Wherobots exposes is available as a CLI command — no CLI update required when new API endpoints are released.
Note: Because these commands are generated dynamically from the API spec, the exact set of available resources and verbs may change as the Wherobots API evolves.
# discover all available api commands
wherobots api --tree
# general form
wherobots api <resource> [<sub-resource> ...] <verb> [flags]How it works:
- Resource hierarchy is derived from API URL paths.
- Verbs are derived from
operationIdor inferred from the HTTP method (GET→list/get,POST→create, etc.). - Path and query parameters become named flags (e.g.
--id,--limit). - Object/array request body fields become
*-jsonflags (e.g.--metadata-json '{"k":"v"}'). - Run
--helpon any generated command to see all available flags with types and examples.
Common flags for api commands:
| Flag | Description |
|---|---|
--json '<raw-json>' |
Raw JSON request body (overrides individual body-field flags). |
-q, --query key=value |
Repeatable query parameter (last value wins for duplicate keys). |
--dry-run |
Print the equivalent curl command instead of executing the request. |
--tree |
Print the command tree from this point. |
All configuration is done through environment variables.
| Variable | Required | Description | Default |
|---|---|---|---|
WHEROBOTS_API_KEY |
Yes | Your Wherobots API key. Sent as x-api-key header. |
— |
WHEROBOTS_API_URL |
No | Base URL for the Wherobots API. | https://api.cloud.wherobots.com |
WHEROBOTS_UPLOAD_PATH |
No | Default S3 root for local file uploads in job-runs create. |
(auto-resolved from your account) |
OPENAPI_CACHE_TTL |
No | How long to cache the OpenAPI spec (Go duration, e.g. 15m). |
15m |
OPENAPI_HTTP_TIMEOUT |
No | Timeout for fetching the OpenAPI spec (Go duration). | (default) |
The OpenAPI spec is cached locally at ~/.cache/wherobots/spec.json. If a fresh fetch fails, the cached version is used as a fallback.
- Success: raw JSON response body printed to
stdout. - Failure: error message printed to
stderrwith a non-zero exit code. job-runscommands support--output textfor human-readable table output.- For non-JSON API responses or endpoints requiring file upload/download, use
--dry-runto get acurlcommand you can execute and customize.
Built with:
| Dependency | Purpose |
|---|---|
| cobra | CLI framework and command routing |
| libopenapi | OpenAPI 3.x spec parsing |
| gjson / sjson | JSON reading and mutation |
| shlex | Shell-safe argument quoting (for --dry-run curl output) |
make test # run tests
make build # compile to bin/wherobots
make fmt # format source code
make tidy # tidy go.mod dependencies
make run ARGS='--tree' # run without building- PR validation runs
go testandgo buildautomatically via GitHub Actions. - Merges to
mainpublish a rollinglatest-prereleaserelease with binaries for Linux, macOS, and Windows (amd64 and arm64).