OrkStageOrkStage

ork CLI reference

The ork CLI (Preview). Install it, log in with an API key, scan a project into a template, push it, deploy instances. Commands, flags and exit codes.

Preview

Commands and output may still change. Release binaries are signed once the signing certificates are configured; until then they are unsigned, so machines that block unsigned programs need the Docker option below.

ork turns an existing project into an OrkStage template, pushes it, and deploys and operates instances from your terminal or from CI. It reads Terraform and OpenTofu, CloudFormation, SAM and CDK, Kubernetes and Helm, Docker Compose, Dockerfiles and package manifests. It also detects Pulumi, Serverless, Bicep and ARM projects. The CLI is written in Rust and licensed under AGPL-3.0.

Install

The scripts download the latest release for your machine, verify it against the release's SHA256SUMS and install it without administrator rights.

Linux, macOS
curl -fsSL https://orkstage.io/install.sh | sh     # installs to ~/.local/bin
Windows
irm https://orkstage.io/install.ps1 | iex          # installs to %LOCALAPPDATA%\Programs\ork

Pin a version with ORK_VERSION=0.1.0, or choose the directory with ORK_INSTALL_DIR. Every release on GitHub also has the archives and SHA256SUMS for a manual install.

For shell completions, run ork completions bash|zsh|fish|powershell|elvish > <your completion dir>.

Quick start

ork login --api-url https://orkstage.example.com   # prompts for an API key (ork_live_…)
cd my-project
ork init                                           # scans and writes .ork/
ork scan                                           # what was detected, with evidence
# fill [placements] in .ork/config.toml: a cloud target and region per slot
ork up --publish --wait                            # push, publish, create the instance, deploy
ork status && ork logs api

Create the key with the ork CLI (developer) preset: instances:read, instances:deploy, templates:read, templates:write, imports:write. Add instances:write for ork instances create and ork up. Templates are shared by all tenants, so ork template push works only with an organization key (role PlatformAdmin). See API keys.

From an empty directory

A run against a local platform (pnpm platform:up in orkstage-dev) with the seeded simulation targets. Output is shortened.

mkdir shop && cd shop
ork init --tenant acme --environment development --name shop -y
# Template: nothing deployable was detected, so .ork/template.yaml is a starter (one web service).
# Created /home/me/shop/.ork/ with config.toml, template.yaml, inventory.json and .gitignore.

ork init leaves one line per placement slot to fill in .ork/config.toml:

.ork/config.toml
[placements]
primary = { target = "Simulated AWS (us-east-1)", region = "us-east-1" }
ork up --publish --yes --wait
# Pushed template shop@0.1.0 (draft).
# Published shop@0.1.0.
# Created instance shop-development from shop@0.1.0.
# [phase:verify] All health and connectivity checks passed.
# [phase:finalize] Instance is READY.
# Deployment 01a12dd9-82d0-... succeeded.

ork status
# Status: READY   Health: HEALTHY
# Template: shop@0.1.0   Tenant: Acme Corp

Change the template, then publish and roll it out:

ork template push && ork template publish
ork preview --template-version 0.1.1
# Plan: 0 to create, 0 to update, 1 to delete, 2 unchanged (risk high)
ork upgrade --yes --wait
# [phase:prune] Deleting cache (no longer in the template)
# [phase:prune] 1 resource(s) removed: cache.
# Deployment 01a12e13-742b-... succeeded.

Day to day: ork logs api, ork triggers run restart-api --wait and ork incidents list. When the instance is no longer needed:

ork destroy --instance shop-development --confirm shop-development --wait

Production destroys wait for approval in the console; the CLI prints the link.

Commands

CommandWhat it does
ork login [--api-url URL] [--with-token]Stores an API key for that API URL. The key comes from --token or ORK_TOKEN, from stdin with --with-token, or from a prompt. The CLI checks it with GET /me unless you pass --no-verify.
ork logoutForgets the key for the API URL.
ork whoamiShows the user, key name, scopes and tenants.
ork init [--name] [--tenant] [--environment] [--yes] [--force] [PATH]Scans the project and creates .ork/. It asks questions unless you pass --yes or stdin is not a TTY.
ork scan [PATH] [--format table|json] [--write]Walks and scans in parallel. PATH can be a directory or one file. --write refreshes .ork/inventory.json and .ork/template.yaml.
ork template validate [-f FILE] [--tenant SLUG]Calls POST /templates/validate and exits with 1 when the template is invalid. With --tenant, also checks that tenant's limits and feature flags.
ork template push [-f FILE]Creates the template, or adds a DRAFT version. When the local version is not newer than the server's, it bumps the patch number and updates the file.
ork template diff [-f FILE] [--exit-code]Prints a unified diff between the local template and the latest server version.
ork import [PATH] [--tenant]Scans locally and sends POST /imports { report }, then prints the import id and the console URL. Your code never leaves your machine.
ork template publish [-f FILE] [--template-version V]Publishes a draft version so instances can use it. The server validates it again. Needs permission to publish templates.
ork instances list [--tenant]Lists the instances you can see.
ork instances create [--name] [--template-version V] [--var KEY=VALUE]... [--yes]Creates the instance described in .ork/config.toml ([instance], [placements], [variables]) from the latest published template version. Target names need a platform role to resolve; otherwise use target ids. --yes is required outside a terminal.
ork up [--publish] [--yes] [--wait]Pushes the template when it changed (publishes it with --publish), creates the instance when it does not exist, then deploys.
ork deploy [--instance SLUG] [--wait] [--timeout S]Deploys. With --wait it streams the deployment events and exits with a nonzero code if the deployment fails. --timeout defaults to 3600 seconds.
ork status [--instance SLUG]Shows the instance, its resources and the last deployment.
ork logs <resource> [--instance SLUG] [-n N]Prints recent log lines of a resource (50 by default).
ork destroy --instance SLUG --confirm SLUG [--wait]Destroys an instance. --confirm must repeat the slug.
ork preview [--instance SLUG] [--template-version V]Shows the plan for the next deploy without applying it: the changes, their risk, the monthly cost and blocking issues. With --template-version, the plan of an upgrade or rollback to that published version.
ork upgrade [--instance SLUG] [--template-version V] [--yes] [--wait]Moves the instance to another published version of its template (default: the latest). Shows the plan first and asks for confirmation; resources the new version no longer has are deleted, and production changes that delete or replace resources wait for approval.
ork incidents list [--tenant] [--instance SLUG] [--all] / show ID / resolve ID [--message]Open incidents (all with --all), one incident with its timeline, or resolve one (needs incidents:write).
ork triggers list [--instance SLUG] / run NAME [--param KEY=VALUE]... [--wait]The template's triggers with whether they can run, or run one. API keys can run triggers whose template sets on.webhook.
ork marketplace list / show SLUGPublished marketplace listings, or one with its slots, resources and estimated cost. Start a project from one with ork init --from SLUG.
ork targets listCloud targets with provider, environment, regions, health and last validation.
ork targets add [--provider] [--name] [--environment] [--tenant] [--config KEY=VALUE]... [--credential-ref REF] [--regions a,b] [--default-region] [--no-validate] [--yes]Connects a cloud account step by step: asks for what is missing with the provider's own form, prints the docs page that prepares the account, registers the target, validates it and prints every check. Exits with 1 when a check fails.
ork targets validate TARGET [--region]Runs the target's checks again. Exits with 1 when one fails.
ork targets edit TARGET [--name] [--config KEY=VALUE]... [--credential-ref] [--regions] [--default-region] [--max-concurrent]Rotates the role or the credential reference, changes regions or the DNS zone. KEY= removes a config key; the account and the state location are fixed.
ork targets external-idPrints a new random external id for an AWS deployment role.
ork completions <shell>Prints shell completions.

The targets commands need a platform API key (role PlatformAdmin) with the targets:manage and instances:read scopes. Create one under Integrations > API keys without a tenant.

Global flags and environment

FlagEnvironmentMeaning
--api-urlORK_API_URLOrkStage API base URL.
--tokenORK_TOKENAPI key.
-o, --output table|jsonORK_OUTPUTOutput format.
--no-colorNO_COLORTurns off colors.
-v, -vv, -vvvORK_LOG=debugWrites logs to stderr.
-C, --chdir DIRRuns as if started in DIR.
ORK_CONFIG_DIRMoves the user config directory.
ORK_CREDENTIALS_STORE=fileUses the credentials file instead of the OS keychain.

Precedence: flags first, then environment variables, then .ork/config.toml, then the user config.

Output and exit codes

CodeMeaning
0OK
1Failure (invalid template, failed deployment, API error)
2Usage error
3Authentication or authorization error
4Not found

With -o json, stdout carries exactly one JSON document with deterministic ordering. Progress goes to stderr as NDJSON, and errors go to stderr as { "error": { code, message, status, correlationId, help, exitCode } }. API errors always include the platform's message and correlation id.

The .ork/ folder

config.toml
template.yaml
inventory.json
.gitignore
FileCommit itContents
config.tomlYesAPI URL, tenant, template name, instance slug and environment, placement bindings, scan include and exclude lists
template.yamlYesThe platform/v1 template. init generates it, and then it is yours to edit.
inventory.jsonNoThe last ScanReport (.ork/.gitignore excludes it)
.ork/config.toml
api_url = "https://orkstage.example.com"
tenant = "acme"

[template]
name = "shop"

[instance]
slug = "shop-staging"
environment = "staging"

# Placement slot → cloud target (name or id) and region, one line per slot of the template.
[placements]
primary = { target = "aws-staging", region = "us-east-1" }
data = { target = "azure-data", region = "westeurope" }

[scan]
include = []
exclude = ["examples/**"]

Credentials

The CLI stores one key per API URL in the OS keychain: macOS Keychain, Windows Credential Manager, or Secret Service on Linux. Where no keychain is available (containers, CI runners without a desktop session), it writes them to credentials.toml (mode 0600) in the user config directory:

OSDirectory
Linux~/.config/ork
Windows%APPDATA%\OrkStage\ork\config
macOS~/Library/Application Support/dev.OrkStage.ork

Keys are never written to the project.

How the scan works

  1. Walk (CLI only). A parallel walk that respects .gitignore skips node_modules, .terraform, target, vendor, dist, hidden directories and CDK asset.* copies. It also skips files over 1 MiB (configurable) and files that are not valid UTF-8.
  2. Detect each source kind. Terraform is parsed as HCL. The scan evaluates var.*, local.* and simple expressions, expands local modules per call and reports remote modules as unmapped. References such as aws_db_instance.main.address in a task definition become connections. CloudFormation tags in short form (such as !Ref, !GetAtt and !Sub) are normalized.
  3. Merge. When several sources show the same component, it becomes one resource that keeps every source. IaC evidence wins over Kubernetes, and Kubernetes wins over Compose, Dockerfiles and package hints.
  4. Infer. The scan adds a network when services or data stores need one, and an ingress plus DNS for a public HTTP service on a cloud provider. It then chooses placement slots and tags the template with its size (starter, growth or scale) and with what it found (containers, postgres, object storage).
  5. Render and validate the template. Problems become warnings, so the scan never fails on bad input.

In the generated template, each image is a catalog reference named after its service (catalog://api). The resource's sourceImage property keeps the image the scan detected.

On this page