lynxpm apply
📖 Synopsis
Section titled “📖 Synopsis”lynxpm apply [--json] <Lynxfile.yml>Description
Section titled “Description”Apply a declarative Lynxfile to create and start one or more applications.
Each app entry in the file is converted into an AppSpec, saved securely,
and started via the daemon. Apply aborts on the first failure — any
successfully-started apps remain running. When --json is used and an
abort happens mid-file, the partial report is still emitted on stdout with
partial: true so callers can see exactly which apps started.
Lynxfile format
Section titled “Lynxfile format”version: "1"namespace: defaultapps: - name: my-api command: "node server.js" cwd: "/srv/my-api" env: PORT: "3000" logs: dir: "/var/log/lynx-pm" stdout: "stdout.log" stderr: "stderr.log" restart: policy: "on-failure" max_restarts: 10 delay_ms: 2000 backoff: "expo"⚙️ Flags
Section titled “⚙️ Flags”| Flag | Type | Default | Description |
|---|---|---|---|
--json | boolean | false | Emit a machine-readable {results, summary} batch report on stdout. |
-h, --help | - | - | Show help message. |
🚀 Examples
Section titled “🚀 Examples”Apply a Lynxfile:
lynxpm apply ./Lynxfile.ymlApply and collect outcomes:
lynxpm apply ./Lynxfile.yml --json | jq '.results[] | {id, status, extra}'- Specs are stored in
~/.config/lynx/appswith0600permissions. - If
namespaceis omitted per app, the file‑level namespace ordefaultis used.