{"_id":"@apisynq/cli","_rev":"3-2f433862f1445ab5c95fcb5f3419289a","name":"@apisynq/cli","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@apisynq/cli","version":"0.1.0","keywords":["apisynq","api","openapi","ci","cd","cli","publish"],"license":"MIT","_id":"@apisynq/cli@0.1.0","maintainers":[{"name":"apisynq","email":"apisynq@gmail.com"}],"bin":{"apisynq":"src/index.js"},"dist":{"shasum":"5f2eeff523b70b9c040e2077bec29cce6c341bf6","tarball":"https://registry.npmjs.org/@apisynq/cli/-/cli-0.1.0.tgz","fileCount":6,"integrity":"sha512-CAdzzwyFghoyvk/EOEc4p0DA2GI7OZ0uXphf+5ShYk1o29wqRHAq9zHOBjT/tX3wzuTB83jIoKI9HgI92DzbvA==","signatures":[{"sig":"MEUCIBs7OWa29sXvOZCp8Qd3uzkN2WiSZxA5h5K/Z+z1Q+RqAiEAhWLX+y5DX5hIZ528RS7N97jEaGjqop0PTc6NvtjmVdI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13738},"type":"module","engines":{"node":">=18"},"gitHead":"3c14112dc2148b332c319d32521d66874e5b0de8","scripts":{"start":"node src/index.js"},"_npmUser":{"name":"apisynq","email":"apisynq@gmail.com"},"_npmVersion":"11.6.2","description":"Official APISynq CLI — run Developer Studio version/package operations (set spec, publish, deploy, sync) from your CI/CD pipeline.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.7.0","js-yaml":"^4.1.0","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1785131488671_0.8898236220496514","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apisynq/cli","version":"0.2.0","keywords":["apisynq","api","openapi","ci","cd","cli","publish"],"license":"MIT","_id":"@apisynq/cli@0.2.0","maintainers":[{"name":"apisynq","email":"apisynq@gmail.com"}],"bin":{"apisynq":"src/index.js"},"dist":{"shasum":"d4c201c55589855def71d0700ae7d54c29ee8242","tarball":"https://registry.npmjs.org/@apisynq/cli/-/cli-0.2.0.tgz","fileCount":8,"integrity":"sha512-Pv2WwGqIhfMTpRBLbppvKtrDbo92OKLI+cX/XpbygkFGKt1/4K8yzKASF7APUC+/Xk9WQeurk/SIf/DiXmmDvA==","signatures":[{"sig":"MEYCIQDYcwps7BTNLv+uEH7eWPHa8/ekzk/lwyBsKTxVMFVS+AIhALdFRbO79VmwgFM5X3YW9JWaa9ChqTSWYNGapi5CJgTx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46879},"type":"module","engines":{"node":">=18"},"gitHead":"a862bf844faa39f25537740d3de8568c33c3eac9","scripts":{"start":"node src/index.js"},"_npmUser":{"name":"apisynq","email":"apisynq@gmail.com"},"_npmVersion":"11.6.2","description":"Official APISynq CLI — spec diff/lint/impact gates, verified-PR runs, contract-ledger acks, and Developer Studio version/package operations (set spec, publish, deploy) from your CI/CD pipeline.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"axios":"^1.7.0","js-yaml":"^4.1.0","commander":"^12.1.0","@stoplight/spectral-core":"^1.19.4","@stoplight/spectral-formats":"^1.8.2","@stoplight/spectral-parsers":"^1.0.5","@stoplight/spectral-rulesets":"^1.21.3","@stoplight/spectral-functions":"^1.9.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.0_1785134228657_0.811082225339951","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@apisynq/cli","version":"0.2.1","description":"Official APISynq CLI — spec diff/lint/impact gates, verified-PR runs, contract-ledger acks, and Developer Studio version/package operations (set spec, publish, deploy) from your CI/CD pipeline.","type":"module","bin":{"apisynq":"src/index.js"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"scripts":{"start":"node src/index.js"},"keywords":["apisynq","api","openapi","ci","cd","cli","publish"],"license":"MIT","dependencies":{"@stoplight/spectral-core":"^1.19.4","@stoplight/spectral-formats":"^1.8.2","@stoplight/spectral-functions":"^1.9.3","@stoplight/spectral-parsers":"^1.0.5","@stoplight/spectral-rulesets":"^1.21.3","axios":"^1.7.0","commander":"^12.1.0","js-yaml":"^4.1.0"},"gitHead":"a7daab55ab3ad1fe7660e7640c2dcbcce4177a8d","_id":"@apisynq/cli@0.2.1","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-hfvOqisGoozOL/D9EG5gGBVFEma5y99BZxIpj6XJ/+bVXXCgJ4+7UrBIuRS6QhLFfqwokLF0bTgqOHE3aQuKpQ==","shasum":"50bae017e6c471507c00cf9646344c92812a3b30","tarball":"https://registry.npmjs.org/@apisynq/cli/-/cli-0.2.1.tgz","fileCount":8,"unpackedSize":47028,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB2ArJlod2YLkVRXl4BMqzfrmZqD59ud0jt9tQ1qbBfpAiEAuhnCMHMmMt/4H8RY9FeiKMrSvHgPvIgsJPWGvwzVkbk="}]},"_npmUser":{"name":"apisynq","email":"apisynq@gmail.com"},"directories":{},"maintainers":[{"name":"apisynq","email":"apisynq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.2.1_1785136450417_0.553960154389078"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-27T05:51:28.470Z","modified":"2026-07-27T07:14:10.734Z","0.1.0":"2026-07-27T05:51:28.809Z","0.2.0":"2026-07-27T06:37:08.837Z","0.2.1":"2026-07-27T07:14:10.570Z"},"license":"MIT","keywords":["apisynq","api","openapi","ci","cd","cli","publish"],"description":"Official APISynq CLI — spec diff/lint/impact gates, verified-PR runs, contract-ledger acks, and Developer Studio version/package operations (set spec, publish, deploy) from your CI/CD pipeline.","maintainers":[{"name":"apisynq","email":"apisynq@gmail.com"}],"readme":"# @apisynq/cli\n\nOfficial APISynq command-line tool. Gate your builds on spec diffs, lint, and\nconsumer impact; run Developer Studio version/package operations — attach an\nOpenAPI spec, publish, deploy; and drive the sync loop (verified-PR runs,\ndeploy announcements, contract-ledger acks) straight from your CI/CD pipeline\ninstead of clicking through the portal.\n\n## Install\n\n```bash\nnpm install -g @apisynq/cli\n# or run without installing:\nnpx @apisynq/cli whoami\n```\n\n## Authenticate\n\nCreate a **CI token** in the portal (Integrations → CI tokens) with the scopes\nyou need (`studio:read`, `package:write`, `package:publish`, `package:deploy`,\n`sync:run`), then provide it to the CLI one of three ways (highest precedence\nfirst):\n\n```bash\napisynq --token ata_pk_… whoami          # per-command flag\nexport APISYNQ_TOKEN=ata_pk_…            # environment (recommended in CI)\napisynq login --token ata_pk_…          # saved to ~/.apisynq/config.json\n```\n\nPoint at your APISynq API with `APISYNQ_API_URL` (or `--url`); defaults to the\npublic API host.\n\n## CI gates\n\n```bash\n# Classified spec diff. Sides are file paths or spec/package ids.\napisynq diff ./openapi-old.yaml ./openapi.yaml             # exits 1 on breaking\napisynq diff <packageId> ./openapi.yaml --fail-on none     # report only\napisynq diff <packageId> ./openapi.yaml --format sarif --out diff.sarif.json\napisynq diff <packageId> ./openapi.yaml --format codeclimate --out gl-code-quality.json\n\n# Which consumers break if this change ships (dependency-graph resolved).\napisynq impact --spec ./openapi.yaml --against <packageId> --fail-on-impact\n\n# Spectral lint. Local file needs no token; a package id lints its attached\n# spec with its attached governance policies.\napisynq lint ./openapi.yaml                                 # spectral:oas\napisynq lint <packageId>                                    # package's policies\napisynq lint ./openapi.yaml --policy <id1>,<id2> --fail-on warning\n```\n\n## Studio operations\n\n```bash\napisynq whoami                                  # show the token's company + scopes\napisynq package list [--application <id>] [--app-version <id>] [--status ACTIVE]\napisynq package get <packageId>\napisynq spec set <packageId> <openapi.json|yaml>  # attach/replace the package spec\napisynq publish <packageId>                     # mark the package published\napisynq publish <packageId> --with-notes --wait # + release notes/spec/docs generation (sync:run)\napisynq publish-job <jobId>                     # poll a generation job\napisynq release-notes <packageId> [--out NOTES.md]\napisynq env list                                # list target environments\napisynq deploy <packageId> --env <envId> [--version-url <url>] [--date YYYY-MM-DD]\n```\n\n## The sync loop\n\n```bash\n# Announce from your pipeline that a deploy is live. Signs the verified-PR\n# webhook (HMAC) for you and triggers the verification run.\napisynq deployed <applicationId> [--base-url https://qa.myapp.internal]\n\n# Trigger/watch verification runs directly (Postman collection / OpenAPI check).\napisynq verified-pr run <applicationId> --wait   # exits 1 when the run fails\napisynq verified-pr runs <applicationId>\napisynq verified-pr config <applicationId>\n\n# Contract Ledger from the consumer's side.\napisynq edges --app <applicationId> --role consumer --gate  # exits 1 on breaking/drifted edges\napisynq ack <edgeId>                             # \"we adapted\" — recorded as a CI claim\n```\n\nAdd `--json` to any command for raw JSON (scripting). Every command exits\nnon-zero on failure, so a broken step fails the pipeline.\n\n## Use in CI/CD\n\n### GitHub Actions\n\n```yaml\n- name: Gate + publish API to APISynq\n  env:\n    APISYNQ_TOKEN: ${{ secrets.APISYNQ_TOKEN }}\n    APISYNQ_API_URL: https://governance-api.apisynq.com\n  run: |\n    npm install -g @apisynq/cli\n    apisynq lint ./openapi.json\n    apisynq diff \"$PACKAGE_ID\" ./openapi.json          # fails the job on breaking\n    apisynq spec set \"$PACKAGE_ID\" ./openapi.json\n    apisynq publish \"$PACKAGE_ID\" --with-notes\n\n- name: Announce deploy (after your deploy step)\n  env:\n    APISYNQ_TOKEN: ${{ secrets.APISYNQ_TOKEN }}\n  run: npx @apisynq/cli deployed \"$APPLICATION_ID\" --base-url \"$DEPLOY_URL\"\n```\n\n### GitLab CI\n\n```yaml\npublish_api:\n  image: node:20\n  variables:\n    APISYNQ_API_URL: https://governance-api.apisynq.com\n  script:\n    - npm install -g @apisynq/cli\n    - apisynq diff \"$PACKAGE_ID\" ./openapi.json --format codeclimate --out gl-code-quality.json || true\n    - apisynq diff \"$PACKAGE_ID\" ./openapi.json\n    - apisynq spec set \"$PACKAGE_ID\" ./openapi.json\n    - apisynq publish \"$PACKAGE_ID\"\n  artifacts:\n    reports:\n      codequality: gl-code-quality.json\n  # APISYNQ_TOKEN provided as a masked CI variable\n```\n\n## Exit codes\n\n`0` success · `1` any error (auth, missing scope, not found, network) or a\nfailed gate (breaking diff, lint findings at/above the threshold, impacted\nconsumers with `--fail-on-impact`, red verification run, breaking edges with\n`--gate`). The server's message is printed to stderr.\n","readmeFilename":"README.md"}