CLI & workflows

Use Presolve from the command line.

Install the released CLI, inspect what an app needs, build the release you will ship, check whether an environment can run it, inspect the selected plan, and execute locally. This page is the command reference; first-time users should start with the guided tutorial.

Docs / CLI & workflows

The five commands to remember are inspect, build, check, plan, and dev. Environment commands describe what a target can provide. The sections below cover installation, the complete current CLI surface, and machine-readable outputs intended for automation.

Installation

Install the released Presolve CLI.

macOS or Linux

curl -fsSL https://presolve.dev/install.sh | sh
presolve --version

The installer selects the native archive for your operating system and CPU architecture, verifies its SHA-256 checksum, installs it under ~/.presolve/bin, and adds that directory to your shell PATH when necessary.

Windows PowerShell

irm https://presolve.dev/install.ps1 | iex
presolve --version

The Windows installer downloads the x86_64 native archive, verifies its checksum, installs presolve.exe under your user profile, and updates your user PATH.

Presolve is pre-stable, but using Presolve no longer requires compiling the CLI. Release artifacts are produced for Linux x86_64/arm64, macOS Intel/Apple Silicon, and Windows x86_64.

Build from source

Use a source build when contributing to Presolve itself or when you intentionally need an unreleased commit:

git clone https://github.com/fierstdev/presolve.git
cd presolve
cargo build -p presolve-cli
./target/debug/presolve --version

This is a contributor/development path, not the normal installation path.

Local environment

Describe what is available here.

presolve env init
presolve env provider add memory-services --provides kv,objects
presolve env show
presolve env check

The environment tooling generates and persists stable environment/provider identities so normal local development does not require hand-managing opaque IDs. env show explains the discovered environment; env check validates the environment declaration itself.

The ergonomic --provides shorthand currently covers kv and objects. Advanced/current contracts such as SQL and queues can be declared with exact --capability INTERFACE@VERSION arguments or authored directly in presolve.env.toml.
Core commands

Five commands, five different jobs.

01
presolve inspect — What does the app require?

Shows the normalized source application definition without requiring an environment.

presolve inspect
presolve inspect --json
02
presolve build — What exact release are we distributing?

Builds and packages a detached .presolved release whose identity does not include an environment.

presolve build
presolve inspect dist/orders.presolved
03
presolve check — Can this environment satisfy the app?

Runs compatibility checks and reports structured problems when mandatory requirements cannot be satisfied.

presolve check
presolve check dist/orders.presolved --json
04
presolve plan — What exactly did Presolve select?

Shows the environment, workloads, provider identities, exact versions, negotiated features, and optional unbound requirements selected for this application.

presolve plan
presolve plan dist/orders.presolved --json
05
presolve dev — Can I run the resolved application locally?

Checks compatibility, constructs the plan, realizes supported local providers, assembles the runtime, and invokes the application.

presolve dev
presolve dev --input "hello"
Deployment plan

Inspect the decision before runtime objects exist.

A deployment plan is the recorded result of matching one application to one environment. It identifies what Presolve selected; it does not contain live database clients, sockets, secrets, or cloud SDK objects.

application buildorders.presolved
+
targetpresolve.env.toml
→
inspectable resultDeploymentPlanproviders, versions, features
application: orders 1.0.0
environment: production
status: resolved

presolve:sql/database
  provider: postgres-sql
  version: 0.1.0
  features: dialect-postgresql, returning

presolve:objects/store
  provider: s3-objects
  version: 0.1.0
  features: range-read

The exact human formatting may evolve during preview. Automation should use the JSON form described below.

Automation

Use the versioned JSON projection for tooling.

presolve inspect --json
presolve check --json
presolve plan --json
presolve inspect dist/orders.presolved --json

Every machine payload identifies the explicit CLI schema rather than directly serializing internal Rust structs:

{
  "schema": "presolve.cli",
  "schema_version": "0.1",
  "kind": "..."
}
CommandMachine meaning
inspect --jsonnormalized source application semantics; no environment required
inspect RELEASE --jsonverified detached release identity and semantics; no environment required
check --jsoncompatibility status + structured resolution problems; no full plan payload
plan --jsonexact symbolic deployment plan when resolved; plan: null when rejected

Rejected check and plan calls write their structured payload to stdout and return a non-zero status. Branch on stable problem type/code fields rather than scraping human text.

Canonical JSON field reference on GitHub ↗
Diagnostics

Stable codes separate application errors from compatibility failures.

RangeSubsystemExamples
PS1xxxApplication definitionPS1001 parse error · PS1005 duplicate capability · PS1016 invalid capability feature
PS2xxxCompatibility/resolutionPS2001 missing capability · PS2004 missing required feature · PS2005 unsupported workload

Application validation can return multiple PS1xxx diagnostics. Compatibility failures preserve PS2xxx codes through check, plan, and local execution.

{
  "status": "rejected",
  "plan": null,
  "problems": [
    {
      "type": "missing_capability",
      "code": "PS2001",
      "interface": "presolve:kv/store",
      "version": "^0.1"
    }
  ]
}
Complete diagnostic table on GitHub ↗
Local execution

presolve dev closes the local loop.

The local path discovers the application and environment, validates compatibility, constructs the plan, materializes supported local provider/runtime configuration, and executes through the same architecture used by detached-release checkpoints.

presolve env check
presolve check
presolve plan
presolve dev

dev is convenient for local iteration; check and plan remain useful separately because they let you inspect compatibility and decisions without executing anything.

Proof commands

Run the portability claims directly.

CommandWhat it exercises
bash ./demo/portability/run.shKV: memory, Redis, Cloudflare planning; same release identity
bash ./scripts/check-object-portability.shObject storage: memory ↔ S3-compatible
bash ./scripts/check-sql-portability.shSQL conformance + SQLite ↔ PostgreSQL
bash ./scripts/check-queue-portability.shQueue runtime/provider capability proof with leased delivery semantics

See the detailed proof walkthroughs →

Related documentation

Follow the command into the concept.