{"_id":"@api-frenzy/cli","_rev":"7-663876df71cf2031db7544bd523cafcb","name":"@api-frenzy/cli","dist-tags":{"latest":"1.1.6"},"versions":{"1.0.0":{"name":"@api-frenzy/cli","version":"1.0.0","keywords":["api-frenzy","cli","tunnel","wstunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.0.0","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/api-frenzy/af-cli#readme","bugs":{"url":"https://github.com/api-frenzy/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"5967126b6fb535502f45a7b7df3c2ad1ff370e35","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.0.0.tgz","fileCount":23,"integrity":"sha512-M+Ys58td/ESXu868G7x2QYAN7P7yVNbMAJhh1pbKrnmKFe4kafa0BYX+3pR0p9eAbuG/GU3dZH/cTo56yoB4Mw==","signatures":[{"sig":"MEYCIQC9t8rljGWz1XwakHv1T5HnYglO86omCKj0AkM0wo2oiQIhAOgm71Lgst6qMATYGPBgl/D+6mgfMbakXbREZjtXmQIr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6001935},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node --check bin/af-cli.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/profile.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check scripts/build-profile.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/api-frenzy/af-cli.git","type":"git"},"_npmVersion":"11.13.0","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"24.16.0","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.0.0_1780487517785_0.9282894626724896","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@api-frenzy/cli","version":"1.1.1","keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.1.1","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/api-frenzy/af-cli#readme","bugs":{"url":"https://github.com/api-frenzy/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"fb7bafa122dd299943da2ed9fca9d6c86a6bcc49","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.1.tgz","fileCount":27,"integrity":"sha512-+cKuPpwizcdQWY3T0SGxVg51u+G71+rKmnCXSOhNigw4XXgL7BctXNbREyp3aYHga7hP6XdTLNCtU1W79mbkEA==","signatures":[{"sig":"MEUCIQDTCpvdh9imS35bue7U9W9qjMbrolQXJ365bg533XWAOQIgTMcSiPi+r5REFzAwk4+Li1bEfn9OCSbcz1hW5/bGx6E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6021496},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node --check bin/af-cli.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/profile.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check scripts/build-profile.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","release":"bash scripts/publish.sh","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local","postinstall":"node scripts/ensure-node-pty-helper.js"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/api-frenzy/af-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","node-pty":"^1.1.0","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.1_1784398716329_0.08669024264351433","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@api-frenzy/cli","version":"1.1.2","keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.1.2","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/api-frenzy/af-cli#readme","bugs":{"url":"https://github.com/api-frenzy/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"47d3430cfd145b99bf43242d1e820a7afbc19d02","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.2.tgz","fileCount":29,"integrity":"sha512-HvfSvDzCgeh2ZImGplberp+99qvC6QAPO4xA0pKZGPtgz0oCIWeKbYoLwjos/fza/9aivqR1LOCpMt4ULcZncg==","signatures":[{"sig":"MEYCIQCYID09UIp1TbwdlOCxZwcLaChQma/1POlCDqqmLAwG4AIhAIEMIqMgdO0cLWS1eYxRH0bYz62qiHTFT+Kfhk1afiRV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6027524},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node --check bin/af-cli.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/profile.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check lib/tunnel-reconnector.js && node --check scripts/build-profile.js && node --test test/*.test.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","release":"bash scripts/publish.sh","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local","postinstall":"node scripts/ensure-node-pty-helper.js"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/api-frenzy/af-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","node-pty":"^1.1.0","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.2_1785059877791_0.8674881520402742","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@api-frenzy/cli","version":"1.1.3","keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.1.3","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/neverwannafly/af-cli#readme","bugs":{"url":"https://github.com/neverwannafly/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"f675ef1d9831b4e99812c0628479a68b2480cb2c","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.3.tgz","fileCount":31,"integrity":"sha512-PvxdcVegAcFU96dF6e0hF8+nKus1Yw0Rswfx0qrfw9s/yn6FaU6Pwwpu5K70EBRq+h/vzeX1LzQ2xe2E7PYquA==","signatures":[{"sig":"MEYCIQDEuL1XQGs1EQnX6YxFxiQYj3Cs3SsF+IJxMxYe/o1YfwIhAOVof1muwiNbBkyTCYcFrA1Ilshey7b3I7qwDesklcYT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109357},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node scripts/lint-stdout.js && node --check bin/af-cli.js && node --check commands/deploy.js && node --check commands/doctor.js && node --check commands/list.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/logs.js && node --check commands/profile.js && node --check commands/releases.js && node --check commands/rollback.js && node --check commands/status.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/command-utils.js && node --check lib/errors.js && node --check lib/exit-codes.js && node --check lib/output.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check lib/tunnel-reconnector.js && node --check scripts/build-profile.js && node --check scripts/lint-stdout.js && node --test test/*.test.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","release":"bash scripts/publish.sh","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local","lint:stdout":"node scripts/lint-stdout.js","postinstall":"node scripts/ensure-node-pty-helper.js"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/neverwannafly/af-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","node-pty":"^1.1.0","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.3_1787265070621_0.6862570784184256","host":"s3://npm-registry-packages-npm-production"}},"1.1.4":{"name":"@api-frenzy/cli","version":"1.1.4","keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.1.4","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/neverwannafly/af-cli#readme","bugs":{"url":"https://github.com/neverwannafly/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"66099474148730682f866936181c75041dcaa662","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.4.tgz","fileCount":31,"integrity":"sha512-qcXqJut68knhInRPY/V+U1pkaow+Rn+C0mc5vwQ399zC2fwJgIgEDXaCyoxS4M+Yf6uyhFjmfde3JgFE10zksQ==","signatures":[{"sig":"MEQCIBmh07wmNzFPS0IivQiDbkzsL/WZyaWUB/9FSos24NICAiAHzofaqsBw1T8mKKgYEHJKpNlYEJNF9ANjIDCMHY0AKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110755},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node scripts/lint-stdout.js && node --check bin/af-cli.js && node --check commands/deploy.js && node --check commands/doctor.js && node --check commands/list.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/logs.js && node --check commands/profile.js && node --check commands/releases.js && node --check commands/rollback.js && node --check commands/status.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/command-utils.js && node --check lib/errors.js && node --check lib/exit-codes.js && node --check lib/output.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check lib/tunnel-reconnector.js && node --check scripts/build-profile.js && node --check scripts/lint-stdout.js && node --test test/*.test.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","release":"bash scripts/publish.sh","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local","lint:stdout":"node scripts/lint-stdout.js","postinstall":"node scripts/ensure-node-pty-helper.js"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/neverwannafly/af-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","node-pty":"^1.1.0","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.4_1788030125513_0.15569674077254825","host":"s3://npm-registry-packages-npm-production"}},"1.1.5":{"name":"@api-frenzy/cli","version":"1.1.5","keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","_id":"@api-frenzy/cli@1.1.5","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"homepage":"https://github.com/neverwannafly/af-cli#readme","bugs":{"url":"https://github.com/neverwannafly/af-cli/issues"},"bin":{"af-cli":"bin/af-cli.js"},"dist":{"shasum":"83ee8e28c6dc2bcb38886759c6745fa82b0f87e5","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.5.tgz","fileCount":31,"integrity":"sha512-lQ4MLdtZdR1EpLJNWJYRCXjaJ01HWVUo/Wbo+G4d2bZdJHaw/oIAp7ylpMKK/K7QEWo9xAm5P5v+yMnPSBNLVg==","signatures":[{"sig":"MEUCIQC3ydnfV1ZR7ZORfXsuIjn0yQdi38ZyXFcTIc7DiE3l1AIgVTJK8Uol+G/PMryluP8O+bqg/YVWJp8eT2YuVJ/eS18=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111035},"main":"index.js","engines":{"node":">=24"},"scripts":{"test":"node scripts/lint-stdout.js && node --check bin/af-cli.js && node --check commands/deploy.js && node --check commands/doctor.js && node --check commands/list.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/logs.js && node --check commands/profile.js && node --check commands/releases.js && node --check commands/rollback.js && node --check commands/status.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/command-utils.js && node --check lib/errors.js && node --check lib/exit-codes.js && node --check lib/output.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check lib/tunnel-reconnector.js && node --check scripts/build-profile.js && node --check scripts/lint-stdout.js && node --test test/*.test.js","build":"npm run build:prod","profile":"node bin/af-cli.js profile","release":"bash scripts/publish.sh","build:prod":"node scripts/build-profile.js prod","build:local":"node scripts/build-profile.js local","lint:stdout":"node scripts/lint-stdout.js","postinstall":"node scripts/ensure-node-pty-helper.js"},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"repository":{"url":"git+https://github.com/neverwannafly/af-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line interface for the API Frenzy platform","directories":{},"_nodeVersion":"18.20.8","dependencies":{"ws":"^8.17.1","chalk":"^4.1.2","node-pty":"^1.1.0","commander":"^11.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.5_1788073411027_0.3299380359557549","host":"s3://npm-registry-packages-npm-production"}},"1.1.6":{"name":"@api-frenzy/cli","version":"1.1.6","description":"Command-line interface for the API Frenzy platform","main":"index.js","bin":{"af-cli":"bin/af-cli.js"},"scripts":{"build":"npm run build:prod","build:local":"node scripts/build-profile.js local","build:prod":"node scripts/build-profile.js prod","release":"bash scripts/publish.sh","profile":"node bin/af-cli.js profile","postinstall":"node scripts/ensure-node-pty-helper.js","lint:stdout":"node scripts/lint-stdout.js","test":"node scripts/lint-stdout.js && node --check bin/af-cli.js && node --check commands/deploy.js && node --check commands/doctor.js && node --check commands/list.js && node --check commands/login.js && node --check commands/logout.js && node --check commands/logs.js && node --check commands/profile.js && node --check commands/releases.js && node --check commands/rollback.js && node --check commands/status.js && node --check commands/tunnel.js && node --check commands/version.js && node --check lib/api-client.js && node --check lib/command-utils.js && node --check lib/errors.js && node --check lib/exit-codes.js && node --check lib/output.js && node --check lib/build-profile.js && node --check lib/config.js && node --check lib/profiles.js && node --check lib/private-tcp-connection.js && node --check lib/remote-terminal-agent.js && node --check lib/tunnel-agent.js && node --check lib/tunnel-dashboard.js && node --check lib/tunnel-reconnector.js && node --check scripts/build-profile.js && node --check scripts/lint-stdout.js && node --test test/*.test.js"},"keywords":["api-frenzy","cli","tunnel"],"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","dependencies":{"chalk":"^4.1.2","commander":"^11.1.0","node-pty":"^1.1.0","ws":"^8.17.1"},"engines":{"node":">=24"},"repository":{"type":"git","url":"git+https://github.com/neverwannafly/af-cli.git"},"bugs":{"url":"https://github.com/neverwannafly/af-cli/issues"},"homepage":"https://github.com/neverwannafly/af-cli#readme","_id":"@api-frenzy/cli@1.1.6","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-zWJPFHRt9CWK8bkTtHMQ8xjqa8uAhrGklKjOFh1x+rqZR6Afs/UbvMDuOaAstuA2PTLB4xb/7Q8hYpmW/TIhtQ==","shasum":"7a2a5ae0ecb0e518f7cf8416186c032214984ecb","tarball":"https://registry.npmjs.org/@api-frenzy/cli/-/cli-1.1.6.tgz","fileCount":31,"unpackedSize":111074,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIErLfa8s6WJUbyR2GzSdG9gn8su/DSPSu0tvWvgnjUSLAiA+ze7FJ+VoPZ9Vhsuh82mWj0CzVmcn2CmJTGBo18DPvg=="}]},"_npmUser":{"name":"neverwannafly","email":"apifrenzy993@gmail.com"},"directories":{},"maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_1.1.6_1788074577413_0.38337820146937895"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-03T11:51:57.535Z","modified":"2026-08-30T07:22:57.717Z","1.0.0":"2026-06-03T11:51:58.019Z","1.1.1":"2026-07-18T18:18:36.578Z","1.1.2":"2026-07-26T09:57:58.003Z","1.1.3":"2026-08-20T22:31:10.755Z","1.1.4":"2026-08-29T19:02:05.637Z","1.1.5":"2026-08-30T07:03:31.155Z","1.1.6":"2026-08-30T07:22:57.549Z"},"bugs":{"url":"https://github.com/neverwannafly/af-cli/issues"},"author":{"name":"API Frenzy"},"license":"BSD-3-Clause","homepage":"https://github.com/neverwannafly/af-cli#readme","keywords":["api-frenzy","cli","tunnel"],"repository":{"type":"git","url":"git+https://github.com/neverwannafly/af-cli.git"},"description":"Command-line interface for the API Frenzy platform","maintainers":[{"name":"neverwannafly","email":"apifrenzy993@gmail.com"}],"readme":"# API Frenzy CLI\n\nCommand-line interface for the API Frenzy platform.\n\n## Installation\n\n### From npm (Recommended)\n\n```bash\nnpm install -g @api-frenzy/cli\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/neverwannafly/af-cli.git\ncd af-cli\nnpm install\nnpm link\n```\n\n### Prerequisites\n\nUse the Node version in `.nvmrc`.\n\n```bash\nnvm use\n```\n\n\n## Commands\n\n### Version\n\nDisplay version information.\n\n```bash\naf-cli version\n```\n\n### OAuth Login\n\nOpen the API Frenzy OAuth consent page, complete Authorization Code + PKCE, and store the returned access token for the active profile.\n\n```bash\naf-cli login\n```\n\nFor local development after `npm run build:local`, this logs in against:\n\n```text\nhttp://localhost:8000\n```\n\nFor production after `npm run build:prod`, this logs in against:\n\n```text\nhttps://apifrenzy.com\n```\n\nOptions:\n\n```bash\naf-cli login --api-base-url http://localhost:8000\n```\n\nLogout:\n\n```bash\naf-cli logout\n```\n\n### Tunnel HTTP\n\nPublish a local HTTP service through API Frenzy.\n\n```bash\naf-cli tunnel http <port> --name <name>\n```\n\nThe command reads configuration from:\n\n```text\n~/.config/api-frenzy/config.json\n```\n\nSupported config:\n\n```json\n{\n  \"apiBaseUrl\": \"https://apifrenzy.com\",\n  \"sessionToken\": \"Bearer ...\",\n  \"defaultTunnelVisibility\": \"public_access\"\n}\n```\n\nEnvironment overrides:\n\n- `AF_API_URL` and `AF_TOKEN` (recommended for CI; never persisted)\n- `AF_API_BASE_URL` or `API_FRENZY_API_BASE_URL`\n- `AF_SESSION_TOKEN` or `API_FRENZY_SESSION_TOKEN`\n- `AF_DEFAULT_TUNNEL_VISIBILITY`\n\nThe configured API base URL overrides the build profile default.\n\nExample:\n\n```bash\nAF_SESSION_TOKEN=\"Bearer ...\" af-cli tunnel http 3000 --name my-app\n```\n\n### Deploy and verify\n\nDeploy an existing image or a GitHub repository. Without `--wait`, success means the pipeline was accepted. With `--wait`, the CLI polls the pipeline and then trusts the durable server verification verdict; it never infers health from elapsed time.\n\n```bash\naf-cli deploy --image nginx:alpine --name web -o json\naf-cli deploy --image nginx:alpine --name web --wait --timeout 10m\n\naf-cli deploy --repo octocat/hello --installation-id 300 --branch main \\\n  --build-type node --start-command \"node server.js\" --port 3000 \\\n  --name api --wait\n```\n\nPlain environment variables can be repeated with `--env KEY=VALUE` or loaded with `--env-file`. Attach existing secrets by id with repeated `--secret-id`; the CLI does not accept secret values on deploy.\n\n### Observe and recover\n\n```bash\naf-cli status web-1234abcd -o json\naf-cli logs web-1234abcd --tail 200 -o json\naf-cli logs web-1234abcd --follow       # NDJSON stream\naf-cli logs build 4412 --tail-bytes 65536 -o json\naf-cli releases web-1234abcd -o json\naf-cli releases web-1234abcd --sequence 11 -o json\naf-cli rollback web-1234abcd 11 --wait --timeout 10m --yes -o json\naf-cli doctor -o json\naf-cli list deployments -o json\naf-cli list github-repos --installation-id 300 -o json\n```\n\nRollback creates a new forward release. It restores historical configuration using current secret values, and does not restore PVC size or volume contents.\n\n### Machine-readable contract\n\nAll finite commands accept `-o table|json|yaml` (table is the default). JSON mode writes exactly one stable-key-order document to stdout; YAML uses the JSON-compatible YAML 1.2 subset. Progress and diagnostics are stderr. `logs --follow` rejects YAML and writes one JSON object per line (NDJSON). Every result carries `output_version: 1`.\n\nCI credentials are process-only:\n\n```bash\nAF_API_URL=https://apifrenzy.com AF_TOKEN=\"$API_FRENZY_TOKEN\" \\\n  af-cli deploy --image ghcr.io/acme/app:sha-123 --name app --wait -o json\n```\n\n| Exit | Meaning |\n|---:|---|\n| 0 | success, including positive verification when waiting |\n| 1 | general, transport, or upstream failure |\n| 2 | authentication or authorization failure |\n| 3 | resource not found |\n| 4 | invalid arguments or rejected validation |\n| 5 | state or naming conflict |\n| 6 | quota/account activation decision required |\n| 7 | build or deployment verification failed |\n| 8 | wait timed out; outcome is inconclusive |\n| 130 | interrupted or confirmation unavailable/declined |\n\nThe tunnel will run until you press Ctrl+C. If the agent's gateway WebSocket disconnects, the CLI reconnects automatically with capped exponential backoff (up to 30 seconds between attempts) using the same tunnel token. While it is running, the CLI displays a live in-memory dashboard refreshed every 2 seconds with request count, errors, p50/p95/p99 latency, bytes in/out, a small throughput graph, and the last 100 HTTP/WebSocket events in a table. These logs are process-local and are not written to backend storage.\n\n### Remote Terminal\n\nOpen a private browser terminal to the machine running the CLI:\n\n```bash\naf-cli tunnel remote --name my-laptop\n```\n\nOpen the resulting Remote Terminal from the API Frenzy dashboard. It starts your normal login shell in the current directory, as the same OS user that ran the command. Interactive programs such as `tmux`, `vim`, and Codex are supported. Closing or refreshing the browser detaches it without stopping the shell; pressing Ctrl+C in the CLI stops the remote terminal and its shell. Terminal input and output are never written by the CLI's tunnel dashboard.\n\n### Profile\n\nShow the active build profile and API base URL.\n\n```bash\naf-cli profile\n```\n\n### Private TCP connection\n\nExpose a template-declared service on loopback for any native TCP client. This does not create a public endpoint or consume tunnel quota.\n\n```bash\naf-cli tunnel connect my-postgres\npsql -h 127.0.0.1 -p 5432\n\naf-cli tunnel connect cache\nredis-cli -h 127.0.0.1 -p 6379\n```\n\nThe deployment template selects the private TCP service and usual local port. Use `--local-port <port>` only to override a busy local port. The CLI never accepts an arbitrary internal host or port.\n\n## Project Structure\n\n```\naf-cli/\n├── bin/\n│   └── af-cli.js         # CLI entry point\n├── commands/\n│   ├── version.js        # Version command\n│   └── tunnel.js         # Tunnel command\n├── lib/\n│   ├── api-client.js     # API helper\n│   ├── config.js         # Config helper\n│   └── tunnel-agent.js   # Tunnel agent protocol/client\n├── package.json          # npm package configuration\n└── README.md             # Documentation\n```\n\n## Development\n\n### Adding New Commands\n\n1. Create a new file in `commands/` (e.g., `commands/deploy.js`)\n2. Export a function that registers the command:\n\n```javascript\nfunction deployCommand(program) {\n  program\n    .command('deploy')\n    .description('Deploy operations')\n    .action(() => {\n      // Your logic here\n    });\n}\n\nmodule.exports = { deployCommand };\n```\n\n3. Register it in `bin/af-cli.js`:\n\n```javascript\nconst { deployCommand } = require('../commands/deploy');\ndeployCommand(program);\n```\n\n### Build Profiles\n\nBuild profiles set the default API base URL when no config or environment override is present:\n\n- `npm run build:local` uses `http://localhost:8000`\n- `npm run build:prod` uses `https://apifrenzy.com`\n\nThe generated profile is written to `lib/build-profile.generated.json`. Runtime config still has priority over the generated default:\n\n1. `--api-base-url` / `--session-token` command options\n2. Environment variables\n3. `~/.config/api-frenzy/config.json`\n4. Generated build profile\n\nFor one-off runs without changing the generated build profile, set `AF_CLI_PROFILE=local` or `AF_CLI_PROFILE=prod`.\n\n### Local Development Build\n\n```bash\n# Install dependencies\nnpm install\n\n# Generate the local build profile\nnpm run build:local\n\n# Link for local testing\nnpm link\n\n# Confirm the CLI points at localhost by default\naf-cli version\naf-cli profile\n\n# Login against the local API/frontend at http://localhost:8000\naf-cli login\n\n# Publish a local service once your API Frenzy server is running\naf-cli tunnel http 3000 --name my-app\n```\n\nUse the local build when the API Frenzy web/API stack is already running on `localhost:8000`.\n\n### Production Build\n\n```bash\n# Install dependencies\nnpm install\n\n# Generate the production build profile\nnpm run build:prod\n\n# Confirm the CLI points at production by default\nnode bin/af-cli.js profile\n\n# Optional package dry run before publishing\nnpm pack --dry-run\n```\n\nUse the production build before publishing the npm package so a fresh install defaults to `https://apifrenzy.com`.\n\n### Publishing to npm\n\n```bash\n# Build the production profile first\nnpm run build:prod\n\n# Run syntax checks\nnpm test\n\n# Login to npm if needed\nnpm login\n\n# Inspect package contents\nnpm pack --dry-run\n\n# Publish the public package\nnpm publish --access public\n```\n\nAfter publishing, verify the package from a clean shell:\n\n```bash\nnpm install -g @api-frenzy/cli\naf-cli profile\naf-cli version\n```\n\n## Distribution\n\n### npm Package\n\nUsers can install via npm:\n\n```bash\nnpm install -g @api-frenzy/cli\n```\n\n### Update Instructions\n\n```bash\nnpm update -g @api-frenzy/cli\n```\n\n## Support\n\nFor issues and questions, please open an issue on GitHub.\n","readmeFilename":"README.md"}