{"_id":"@apd-spec/cli","_rev":"3-a6cf8eb9e04d5654ec8f511889665665","name":"@apd-spec/cli","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@apd-spec/cli","version":"0.1.0","keywords":["apd","agent-procedure-definition","procedure-definition","workflow-specification","agent-workflow","approval-workflow","provenance","sop","cli","validator","workflow"],"license":"Apache-2.0","_id":"@apd-spec/cli@0.1.0","maintainers":[{"name":"shawnc7208","email":"ShawnC7208@gmail.com"}],"homepage":"https://github.com/ShawnC7208/APD#readme","bugs":{"url":"https://github.com/ShawnC7208/APD/issues"},"bin":{"apd":"bin/apd.js","apd-validate":"bin/apd-validate.js"},"dist":{"shasum":"12d9ebfe13771e88ac080022020e40019769cb8d","tarball":"https://registry.npmjs.org/@apd-spec/cli/-/cli-0.1.0.tgz","fileCount":6,"integrity":"sha512-HWsgLvwFJHIBmkWYDpRbOMWWgUCMq3xGDz22aEsR0ysnG0q5CJJ9Th1zz3um6PUrSDUp5+UvBeZbBba1cQ7A8w==","signatures":[{"sig":"MEQCIFRrtesnDjGvZNsGAi/RAJlunTvCd5P1TbgGf9w4nKv9AiArn28tN7Y2q5igFwF72SZYazDpSEtwvrcDIkD+yRgsbA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24827},"engines":{"node":">=20"},"gitHead":"0349a7934a137432313f1c43ad0eb194a5a9a277","scripts":{"test":"node test/run-tests.js"},"_npmUser":{"name":"shawnc7208","email":"ShawnC7208@gmail.com"},"repository":{"url":"git+https://github.com/ShawnC7208/APD.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.8.2","description":"CLI for creating, validating, comparing, visualizing, and exporting APD procedure definitions and AER receipts","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@apd-spec/sdk":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1776475158317_0.19833467787081904","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apd-spec/cli","version":"0.2.0","keywords":["apd","agent-procedure-definition","procedure-definition","workflow-specification","agent-workflow","approval-workflow","provenance","sop","cli","validator","workflow"],"license":"Apache-2.0","_id":"@apd-spec/cli@0.2.0","maintainers":[{"name":"shawnc7208","email":"ShawnC7208@gmail.com"}],"homepage":"https://github.com/ShawnC7208/APD#readme","bugs":{"url":"https://github.com/ShawnC7208/APD/issues"},"bin":{"apd":"bin/apd.js","apd-validate":"bin/apd-validate.js"},"dist":{"shasum":"64345532ff7a42a64dfbf013a5bd0cd183f2205d","tarball":"https://registry.npmjs.org/@apd-spec/cli/-/cli-0.2.0.tgz","fileCount":6,"integrity":"sha512-/yHviPVJu9dr/V0/3XrFa3FlMenNKUh579AtJaN8MDA1dQ7GBUv0HEYl0gqiJzgwck60XiftrbaCR9pdgGRCOA==","signatures":[{"sig":"MEUCICWiMWjNMK44unniO5aFAvZBpwxtDK+p3Pifn/W97xEqAiEA1xTt33Jjph6VzlMkRlzJ6O5wbxunfV+OpSMzfX3Mnrc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34751},"engines":{"node":">=20"},"gitHead":"b5f29d50d8757559e1616e3cbbe7e9f24e8a13ef","scripts":{"test":"node test/run-tests.js"},"_npmUser":{"name":"shawnc7208","email":"ShawnC7208@gmail.com"},"repository":{"url":"git+https://github.com/ShawnC7208/APD.git","type":"git","directory":"packages/cli"},"_npmVersion":"10.8.2","description":"CLI for creating, validating, comparing, visualizing, and exporting APD procedure definitions and AER receipts","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@apd-spec/sdk":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.0_1777601827230_0.6380184158135904","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@apd-spec/cli","version":"0.3.0","description":"CLI for creating, validating, comparing, visualizing, and exporting APD procedure definitions and AER receipts","license":"Apache-2.0","bin":{"apd":"bin/apd.js","apd-validate":"bin/apd-validate.js"},"publishConfig":{"access":"public"},"scripts":{"test":"node test/run-tests.js"},"keywords":["apd","agent-procedure-definition","procedure-definition","workflow-specification","agent-workflow","approval-workflow","provenance","sop","cli","validator","workflow"],"repository":{"type":"git","url":"git+https://github.com/ShawnC7208/APD.git","directory":"packages/cli"},"homepage":"https://github.com/ShawnC7208/APD#readme","bugs":{"url":"https://github.com/ShawnC7208/APD/issues"},"engines":{"node":">=20"},"dependencies":{"@apd-spec/sdk":"0.3.0"},"_id":"@apd-spec/cli@0.3.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-bQ6y3fk5ZiEWPkbFDPsxRzpbQDh17zht3Pri+ZCdZkjsTUkbFV1LyXMTpjv+lEiB2QoZe+2PvyPKPryH2/hIUA==","shasum":"45817cb0f2be5d9eda47ceecacb5a424c1068b12","tarball":"https://registry.npmjs.org/@apd-spec/cli/-/cli-0.3.0.tgz","fileCount":6,"unpackedSize":39706,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHUEBPX7rE1zDK1AGFpDGCVEHdsStwbSaI9af1np3bfFAiAip9CcKeN8UxxaoLPWK+AOdOwu4bKRP9aOX167BLhMYA=="}]},"_npmUser":{"name":"shawnc7208","email":"ShawnC7208@gmail.com"},"directories":{},"maintainers":[{"name":"shawnc7208","email":"ShawnC7208@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.3.0_1777726452313_0.5640144572659713"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T01:19:18.240Z","modified":"2026-05-02T12:54:12.626Z","0.1.0":"2026-04-18T01:19:18.490Z","0.2.0":"2026-05-01T02:17:07.399Z","0.3.0":"2026-05-02T12:54:12.495Z"},"bugs":{"url":"https://github.com/ShawnC7208/APD/issues"},"license":"Apache-2.0","homepage":"https://github.com/ShawnC7208/APD#readme","keywords":["apd","agent-procedure-definition","procedure-definition","workflow-specification","agent-workflow","approval-workflow","provenance","sop","cli","validator","workflow"],"repository":{"type":"git","url":"git+https://github.com/ShawnC7208/APD.git","directory":"packages/cli"},"description":"CLI for creating, validating, comparing, visualizing, and exporting APD procedure definitions and AER receipts","maintainers":[{"name":"shawnc7208","email":"ShawnC7208@gmail.com"}],"readme":"# `@apd-spec/cli`\n\n`@apd-spec/cli` is the command-line interface for creating, validating, comparing, summarizing, visualizing, and exporting APD procedure definitions and AER receipts.\n\n## Install from npm\n\nInstall the CLI if you want the `apd` command:\n\n```bash\nnpm install -g @apd-spec/cli\n```\n\nThat installs the stable `apd` command:\n\n```bash\napd init my-procedure.apd.json\napd validate my-procedure.apd.json --strict\n```\n\nIf you are working from a local clone of this repo:\n\n```bash\nnpm install\nnpm run build\nnode packages/cli/bin/apd.js validate examples/invoice-logging.apd.json\n```\n\n## Command overview\n\n```text\napd init <output.apd.json> [--title <title>] [--procedure-id <id>] [--summary <summary>] [--source-type observed|authored|converted|generated] [--force]\napd generate \"describe your workflow\" [--provider openai|anthropic] [--model <id>] [--output <file.apd.json>] [--title <title>] [--procedure-id <id>] [--force] [--json] [--strict] [--api-key-env <NAME>] [--repair-attempts <n>]\napd validate <file.apd.json> [--json] [--quiet] [--strict]\napd info <file.apd.json> [--json]\napd export <file.apd.json> --format sop-md [--output <file.sop.md>]\napd visualize <file.apd.json> --format mermaid|svg\napd aer validate <file.aer.json> [--json] [--quiet] [--strict]\napd aer info <file.aer.json> [--json]\napd aer compare <file.apd.json> <file.aer.json> [--json]\napd aer seal <file.aer-v0.3.json> [--private-key <pem-or-base64-or-path>] [--public-key <pem-or-base64-or-path>] [--previous-hash <sha256:...>] [--attest-executor] [--output <file>] [--force]\napd aer verify <file.aer.json> [--public-key <pem-or-base64-or-path>] [--json]\n```\n\nCompatibility bridge:\n\n```text\napd-validate <file.apd.json> [--json] [--quiet] [--strict]\n```\n\n## `validate`\n\n```bash\napd validate my-procedure.apd.json --strict\n```\n\nCheckout-based example:\n\n```bash\nnode packages/cli/bin/apd.js validate examples/invoice-logging.apd.json\n```\n\nBehavior:\n\n- exit code `0` when the document has no validation errors\n- exit code `1` when schema or graph validation errors exist\n- `--quiet` prints nothing and relies on exit code only\n- `--strict` adds best-practice warnings without turning warnings into failures\n\n## `init`\n\n```bash\napd init refund-review.apd.json\n```\n\nThis creates a strict-clean minimal APD scaffold with a starter action node and terminal node.\n\n## `generate`\n\n```bash\napd generate \"Review a refund request, approve high-value refunds, then notify the customer\" --provider openai --output refund-review.apd.json\n```\n\nThis asks an LLM provider to create a validated APD scaffold from a natural-language workflow description. Use `--provider openai` with `OPENAI_API_KEY`, or `--provider anthropic` with `ANTHROPIC_API_KEY`. To keep secrets out of shell history, the CLI does not accept a literal API key flag; use `--api-key-env <NAME>` when your key lives in a custom environment variable.\n\nGenerated APDs use `provenance.source_type: \"generated\"` and mark generated nodes as inferred so reviewers know the scaffold needs review before runtime use.\n\n## `info`\n\n```bash\napd info my-procedure.apd.json\n```\n\nThis prints the procedure id, start node, node counts, transitions, and a path preview.\n\nCheckout-based example:\n\n```bash\napd info examples/invoice-logging.apd.json\n```\n\n## `export`\n\nPrint SOP markdown to stdout:\n\n```bash\napd export my-procedure.apd.json --format sop-md\n```\n\nWrite it to a file:\n\n```bash\napd export my-procedure.apd.json --format sop-md --output /tmp/my-procedure.sop.md\n```\n\nThe exporter validates the APD first. Invalid APDs fail before any markdown is written.\n\nCheckout-based example:\n\n```bash\napd export examples/invoice-logging.apd.json --format sop-md\n```\n\n## `visualize`\n\n```bash\napd visualize my-procedure.apd.json --format mermaid\napd visualize my-procedure.apd.json --format svg > /tmp/my-procedure.svg\n```\n\nCheckout-based example:\n\n```bash\napd visualize examples/invoice-logging.apd.json --format mermaid\n```\n\n## `aer validate`\n\n```bash\napd aer validate my-procedure.aer-v0.2.json --strict\n```\n\nThis validates AER v0.1, v0.2, and v0.3 receipts.\n\nCheckout-based example:\n\n```bash\napd aer validate examples/invoice-logging.aer-v0.2.json --strict\n```\n\n## `aer info`\n\n```bash\napd aer info my-procedure.aer-v0.2.json\n```\n\nThis prints the execution id, referenced procedure, outcome, node count, transition count, approval count, and final output keys.\n\nCheckout-based example:\n\n```bash\napd aer info examples/invoice-logging.aer-v0.2.json\n```\n\n## `aer compare`\n\n```bash\napd aer compare my-procedure.apd.json my-procedure.aer-v0.2.json\n```\n\nThis compares an AER v0.2 or v0.3 receipt against the APD contract and reports structured differences.\n\nCheckout-based example:\n\n```bash\napd aer compare examples/invoice-logging.apd.json examples/invoice-logging.aer-v0.2.json\n```\n\n## `aer seal`\n\n```bash\napd aer seal my-procedure.aer-v0.3.json --private-key adapter.pkcs8.b64 --public-key adapter.spki.b64 --attest-executor\n```\n\nThis fills in `integrity.chain_hash`, optional `integrity.previous_chain_hash`, optional Ed25519 signature metadata, and optional `executor.recorder_attestation` for AER v0.3 documents. It writes in place unless `--output` is provided, and refuses to reseal an existing chain hash unless `--force` is set.\n\n## `aer verify`\n\n```bash\napd aer verify my-procedure.aer-v0.3.json --public-key adapter.spki.b64\n```\n\nThis verifies the AER chain hash, signature, and recorder attestation when present. It exits `0` on pass and `1` on failure.\n\nSigned receipts require `--public-key` from a trusted source. The public key embedded in the AER identifies the claimed signer but is not trusted by the verifier on its own.\n\n## Related docs\n\n- [`../../docs/getting-started.md`](../../docs/getting-started.md)\n- [`../../docs/apd-for-agents.md`](../../docs/apd-for-agents.md)\n- [`../../docs/apd-to-sop-example.md`](../../docs/apd-to-sop-example.md)\n- [`../../adapters/sop-md-mapping.md`](../../adapters/sop-md-mapping.md)\n- [`../sdk-typescript/README.md`](../sdk-typescript/README.md)\n","readmeFilename":"README.md"}