Skip to content
Documentation
1.0.0-beta.9 · exact release

CLI reference

Source fda16de1b352 · Published v1.0.0-beta.9

The pulse CLI in @pulse-compute/cli@1.0.0-beta.9 is the supported project workflow. One command specification generates this page, installed help, and the shipped Bash, Zsh, and Fish completion scripts, so a public command or option cannot drift between those surfaces.

  • pulse --help | pulse -h | pulse help — Print public help.
  • pulse --version | pulse -v | pulse version — Print the installed CLI package version.
  • pulse completion <bash|zsh|fish> — Print a shell completion script generated from the public command specification.
OptionBehavior
--help, -hPrint public CLI help and exit.
--jsonEmit machine-readable JSON. pulse dev emits one JSON event per line.
--dry-run, --planResolve and report the command plan without executing it.

Completion output is generated from the same public command and option specification as help and this reference. Tooling can consume the generated machine-readable command specification.

Terminal window
source <(pulse completion bash)

The package also ships completions/pulse.bash.

Terminal window
source <(pulse completion zsh)

The package also ships completions/_pulse.

Terminal window
pulse completion fish | source

The package also ships completions/pulse.fish.

Create a conventional .pulse workspace with an async Pulse application and dedicated test harness.

Syntax:

pulse init [directory] [--name <package-name>] [--force]
  • directory — Target directory. Defaults to the current directory.
OptionBehavior
--forceAllow generated files to replace entries in a non-empty target directory.
--name <package-name>Set the generated npm package name.
Terminal window
pulse init ./my-pulse-app
pulse init ./edge-app --name @example/edge-app
  • Human output lists generated files and next steps.
  • With --json, emits one initialization result object.
  • Creates .pulse/config.ts, an async Pulse application, a dedicated test harness, package scripts, and documentation.
  • Does not install dependencies or run npm, pnpm, or any network operation.

0 on success; 2 for invalid usage, provider selection, or unsafe overwrite conditions.

Audit project shape, compilation, schemas, provider bindings, output safety, and required tools.

Syntax:

pulse doctor [directory] [--profile <name>] [--strict]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--strictTreat doctor warnings as failed checks.
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
Terminal window
pulse doctor ./my-pulse-app
pulse doctor ./edge-app --strict --json
  • Human output prints every check.
  • With --json, emits one completed audit object including failed and warning checks.
  • Reads and compiles the project.
  • Does not write the build output.

0 when the audit passes; 1 when a completed audit contains failed checks; 2–5 only when the audit command itself cannot be completed.

Report canonical compiler, schema, effect, continuation, capability, provider, and build-mode details.

Supported signatures:

pulse inspect [directory] [--profile <name>]
pulse inspect --artifact <file.json>
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--artifact <file.json>Inspect an existing JSON build or compiler artifact instead of a project.
Terminal window
pulse inspect ./my-pulse-app --json
pulse inspect --artifact ./dist/pulse-build.json
  • Human output prints a compact project/compiler summary.
  • With --json, emits one inspection or artifact object.
  • Compiles and validates the project in memory.
  • Does not write the build output.

0 on success; 2–5 according to the emitted stable diagnostic.

Run configured cases through the selected provider local-conformance runtime.

Syntax:

pulse test [directory] [--profile <name>] [--case <name>]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--case <name>Run one named project test case.
Terminal window
pulse test ./my-pulse-app
pulse test ./my-pulse-app --case smoke --json
  • Human output uses TAP-like case lines and a summary.
  • With --json, emits one test-run object; expected stable errors remain inside their case results.
  • Compiles the project and executes configured deterministic or live fixtures.
  • Does not write the build output.

0 when all selected cases pass; 1 when the completed test run has failed cases; 2–5 when setup, compilation, runtime, or toolchain execution fails before a normal result.

Start the foreground local server with the selected provider conformance runtime.

Syntax:

pulse dev [directory] [--profile <name>] [--host <host>] [--port <port>] [--watch|--no-watch] [--once]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--onceClose the development server after the first completed request.
--watch, --no-watchEnable or disable entry and schema dependency watching. Watching is enabled by default.
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--host <host>Override the development listen host.
--port <port>Override the development listen port. Use 0 to request an ephemeral port.
Terminal window
pulse dev ./my-pulse-app
pulse dev ./my-pulse-app --port 0 --once --json
  • Human output reports the ready URL and reload or error messages.
  • With --json, stdout is newline-delimited JSON events: compiled, ready, reloaded, request, compile-error, and request-error. It is not one enclosing JSON document.
  • Binds a foreground HTTP listener.
  • Watches the entry and schema dependency graph by default.
  • Configuration-file changes require restarting the command.

0 after a normal server close; 2–5 when setup, compilation, provider, runtime, or toolchain initialization fails.

Compile the canonical project into provider-neutral Pulse-owned WebAssembly.

Syntax:

pulse compile [directory] [--profile <name>] [--out <dir>] [--clean|--no-clean] [--experimental-native-size|--experimental-native-bounded-size] [--emit-wat] [--elide-json-cache-arena]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--clean, --no-cleanRemove or preserve the selected output directory before writing artifacts. Cleaning is enabled by default.
--elide-json-cache-arenaOpt in to omitting the json-as arena when string caching is disabled. Native only; preserves enabled caches. May increase peak memory for allocation-heavy workloads.
--emit-watAlso emit diagnostic WebAssembly text (WAT). Native builds omit it by default; large text emission can exhaust compiler string capacity.
--experimental-native-bounded-sizeExperimentally optimize Native Wasm with shrink level 2 without convergence. JavaScript build targets reject this flag.
--experimental-native-sizeExperimentally optimize Native Wasm for size. JavaScript build targets reject this flag.
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--out <dir>Override the project-relative artifact output directory.
Terminal window
pulse compile ./my-pulse-app
pulse compile ./edge-app --out ./dist --json
pulse compile ./edge-app --experimental-native-size
pulse compile ./edge-app --experimental-native-bounded-size
  • Writes pulse-compile.json, the canonical program, native plan, generated AssemblyScript, compact Wasm, and native manifest; --emit-wat adds diagnostic WAT.
  • The output is provider-neutral and does not package a deployment provider runtime.
  • Experimental size builds record the exact non-default Native compiler optimization settings.
  • With --json, emits one compile result object containing exact artifact paths and native metadata.
  • Cleans the output directory by default.
  • Invokes the lockfile-pinned AssemblyScript compiler.
  • Refuses absolute, parent-traversal, and symbolic-link traversal outside the project root.

0 on success; 2–5 according to the emitted stable diagnostic.

Compile the canonical project and realize the deployment provider selected by the active project profile.

Syntax:

pulse build [directory] [--profile <name>] [--out <dir>] [--clean|--no-clean] [--experimental-native-size|--experimental-native-bounded-size] [--emit-wat] [--elide-json-cache-arena]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--clean, --no-cleanRemove or preserve the selected output directory before writing artifacts. Cleaning is enabled by default.
--elide-json-cache-arenaOpt in to omitting the json-as arena when string caching is disabled. Native only; preserves enabled caches. May increase peak memory for allocation-heavy workloads.
--emit-watAlso emit diagnostic WebAssembly text (WAT). Native builds omit it by default; large text emission can exhaust compiler string capacity.
--experimental-native-bounded-sizeExperimentally optimize Native Wasm with shrink level 2 without convergence. JavaScript build targets reject this flag.
--experimental-native-sizeExperimentally optimize Native Wasm for size. JavaScript build targets reject this flag.
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--out <dir>Override the project-relative artifact output directory.
Terminal window
pulse build ./my-pulse-app
pulse build ./edge-app --out ./dist --json
pulse build ./edge-app --experimental-native-size
pulse build ./edge-app --experimental-native-bounded-size
  • Writes pulse-build.json, the provider-neutral native module, and the configured provider realization; Native --emit-wat builds also write diagnostic WAT.
  • Fastly builds write generated AssemblyScript and direct-host-ABI native Wasm at bin/main.wasm; no JavaScript runtime image is packaged.
  • Experimental size builds record the exact non-default Native compiler optimization settings in portable, provider, and build metadata.
  • With --json, emits one build result object containing exact portable and provider artifact paths.
  • Cleans the output directory by default.
  • Invokes the native compiler and configured provider realization.
  • Refuses absolute, parent-traversal, and symbolic-link traversal outside the project root.

0 on success; 2–5 according to the emitted stable diagnostic.

Review retained evidence from a completed Native build without rebuilding or executing project code.

Supported signatures:

pulse report [directory] [--profile <name>] [--json | --html] [--out <file.html>]
pulse report --artifact <file.json> [--json | --html] [--out <file.html>]
  • directory — Project discovery start. Defaults to the current directory.
OptionBehavior
--htmlWrite a self-contained offline HTML report; mutually exclusive with --json.
--profile <profile>Select a project profile. Precedence: --profile, PULSE_PROFILE, pulse.defaultProfile.
--out <file.html>HTML destination under the selected root; requires --html. Defaults to .pulse/reports/pulse-report.html.
--artifact <file.json>Replay a saved Report capsule or supported completed-Wasm manifest without loading project code.
Terminal window
pulse report ./my-pulse-app
pulse report --artifact ./dist/pulse-compile.json --json
  • Default output is a bounded terminal overview; --json emits one complete authoritative Report capsule.
  • Historical capsule replay preserves evidence identity without claiming current-project freshness.
  • --html writes an offline route-first viewer with expandable schemas and full-capsule JSON export; it does not open a browser.
  • Reads retained local evidence only; does not build, run tests, load project code, access secrets or contact the network.
  • --plan and --dry-run describe intent without collecting or writing a report.
  • --out requires --html; destinations must be contained regular .html files. Artifact roots are the input JSON parent directory.
  • HTML writes a bounded .pulse-report-outputs receipt beside its destination; only matching generated bytes are excluded from project input scans. Recorded build inputs cannot be overwritten.
  • Reports are build-review artifacts; review contents before sharing publicly.

0 for an eligible report even when optional evidence is unavailable; 2 for usage or unsafe output; 3 for invalid, missing, stale or incompatible evidence or an output write failure.

Configuration discovery and command precedence

Section titled “Configuration discovery and command precedence”

Project commands start discovery from their optional positional [directory] or the current directory, then search upward for the single configuration entrypoint:

.pulse/config.ts

Profile selection follows --profile, PULSE_PROFILE, then pulse.defaultProfile. Command-line --out, --host, --port, and watch flags are invocation-local controls. Entry, provider, and target selection belong to .pulse/config.ts: pulse compile remains provider-neutral and pulse build realizes the selected provider. See Project configuration.

For completed commands, --json emits one JSON object followed by a newline. pulse dev --json is deliberately different: stdout is newline-delimited JSON, with one event object per line. Event names are compiled, ready, reloaded, request, compile-error, and request-error; consumers must not wait for one enclosing JSON document.

Raw configured secret values are not included in project JSON, diagnostics, or runtime error detail fields.

Providerinspect/buildtest/devBuild result
nodeYesYesPortable Pulse Wasm plus the configured Node-native realization and pulse-build.json.
fastlyYesYes, through local conformancePortable Pulse Wasm plus generated AssemblyScript and compact direct-host-ABI bin/main.wasm.
noneCompile onlyNopulse compile emits portable Pulse Wasm; pulse build rejects the missing deployment provider.

Build output is cleaned by default. --no-clean preserves the directory, but output safety still rejects absolute, parent-traversal, and symbolic-link traversal outside the project root.

ExitMeaning
0Command completed successfully.
1Completed audit/test failure where documented, or an unexpected uncatalogued internal failure.
2Usage, project configuration, provider selection, or output-safety error.
3Canonical/schema/package-lowering/provider-binding failure.
4Request, test, runtime, fetch, or continuation failure.
5External toolchain or Fastly local-execution failure.

pulse doctor completes with exit 1 when its audit contains failed checks. pulse test completes with exit 1 when a normal test run has failed cases. Setup failures use their diagnostic exit class.

Failed commands emit stable codes, categories, summaries, remediation, exit classes, and a versioned documentation URL. See Diagnostics and remediation.