Reference · Sop2Harness CLI

Sop2Harness CLI

Command reference for s2h: scaffold a project, author a harness from SOPs through a pi session, version it, and export a runnable API, web chat, and MCP server.

Install npm install -g deepclause-sop2harness installs the s2h command. init, create, test, check, commit, export, list, and status are implemented; run, config, and doctor are planned helpers.

Commands

s2h <command> [options]
CommandEffect
s2h initScaffold an s2h project
s2h create [request]Author or update a harness from a prompt and/or SOP files
s2h testValidate, inspect diagrams, and smoke-run skills (mock by default, --live for a real model)
s2h checkValidate the harness without changing it
s2h commitVersion, commit, tag, and record history
s2h exportGenerate a runnable API, web chat, MCP server, and Dockerfile
s2h listList skills, SOPs, and versions
s2h statusShow project, harness, and version state

init

s2h init [--name <name>] [--model <provider/id>] [--force]

Creates s2h.json, .gitignore, .s2h/, and harness/, seeds .pi/deepclause/ non-destructively, writes harness/harness.json, and initializes git if needed. Existing files are never overwritten without --force.

create

s2h create [request] [--file <path>...] [--name <slug>] [--update]
           [--model <provider/id>] [--context <turn|branch|isolated>]
           [--headless] [--json] [--debug]

Ingests SOP inputs into harness/sops/, starts a pi session with the pi extension loaded, authors one DML Skill per procedure, registers the router rows, and validates every artifact deterministically. Without --update it writes new skills only.

Bash is not enabled for authoring by default; SOP ingestion is done by the CLI itself.

commit

s2h commit [-m <message>] [--major|--minor|--patch] [--no-tag] [--dry-run]

Runs s2h check first and refuses to commit an invalid harness. Bumps harness.json.version (patch by default), commits at the project root, tags v<version>, and appends a provenance record to .s2h/versions.json.

export

s2h export [--out <dir>] [--tag <version>] [--llm pi|openai-compatible]
           [--sandbox agentvm|none] [--mcp|--no-mcp] [--no-web]
           [--allow-effects] [--port <n>]

Generates a standalone project: server, web chat, MCP server, Dockerfile, compose file, .env.example, and a copy of the harness. --allow-effects is required to export a harness that writes external state; the default export is read-only.

Helpers

  • s2h test — validate, inspect diagrams, and smoke-run skills (--live for a real model).
  • s2h list — skills, SOPs, and versions.
  • s2h status — project, harness, and version state.
  • s2h check — deterministic validation only, no writes.

Planned helpers, wired into the CLI but not implemented yet: s2h run, s2h config, and s2h doctor.

Config and models

s2h create and s2h run use pi's model runtime: --model, else s2h.json, else the pi default, with credentials reused from pi. The exported server selects its backend with S2H_LLM_* environment variables.