{"_id":"@anyportal/cli","name":"@anyportal/cli","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anyportal/cli","version":"0.1.0","description":"AnyPortal CLI — log in, scaffold, and publish PWAs to the AnyPortal app store","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/I-develop-bugs-for-a-living/AnyPortalV2.git","directory":"packages/cli"},"publishConfig":{"access":"public"},"bin":{"anyportal":"dist/anyportal.js","anyportal-mcp":"dist/anyportal-mcp.js"},"engines":{"node":">=20"},"scripts":{"build":"tsup","dev":"tsup --watch","check":"tsc --noEmit","start":"node ./dist/anyportal.js"},"dependencies":{"@clack/prompts":"^0.8.2","@modelcontextprotocol/sdk":"^1.0.4","commander":"^13.0.0","picocolors":"^1.1.1","zod":"^3.24.1"},"devDependencies":{"@types/node":"^22.10.2","tsup":"^8.3.5","typescript":"^5.7.2"},"gitHead":"2f11c5130d1eb25cdcf76ff0e96d5be70ae4491e","bugs":{"url":"https://github.com/I-develop-bugs-for-a-living/AnyPortalV2/issues"},"homepage":"https://github.com/I-develop-bugs-for-a-living/AnyPortalV2#readme","_id":"@anyportal/cli@0.1.0","_nodeVersion":"24.12.0","_npmVersion":"9.4.2","dist":{"integrity":"sha512-N8gt8II2cRqmAPFvMrhjvGfwxr2fxc16Db5Z052ss5FaVcx8Q+GuzEGdwPL73WhvKSGkGksLkMOyLh+Dmx1MWA==","shasum":"d99fc1992ca2a3b64b6f6f177118568c82bb885d","tarball":"https://registry.npmjs.org/@anyportal/cli/-/cli-0.1.0.tgz","fileCount":12,"unpackedSize":127066,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCSWrapt0ZPHAyPcN+cMx10XHwWThpgRzpQ/a6vBAAKMgIgZeNU80PW3qNea0H0hhE9EPMM7GEfbuI9d6Nv9Ee3J/g="}]},"_npmUser":{"name":"i_develop_bugs_for_a_living","email":"jan.buehne@outlook.com"},"directories":{},"maintainers":[{"name":"i_develop_bugs_for_a_living","email":"jan.buehne@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.1.0_1781817822998_0.22778502085472563"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-18T21:23:42.814Z","0.1.0":"2026-06-18T21:23:43.129Z","modified":"2026-06-18T21:23:43.387Z"},"maintainers":[{"name":"i_develop_bugs_for_a_living","email":"jan.buehne@outlook.com"}],"description":"AnyPortal CLI — log in, scaffold, and publish PWAs to the AnyPortal app store","homepage":"https://github.com/I-develop-bugs-for-a-living/AnyPortalV2#readme","repository":{"type":"git","url":"git+https://github.com/I-develop-bugs-for-a-living/AnyPortalV2.git","directory":"packages/cli"},"bugs":{"url":"https://github.com/I-develop-bugs-for-a-living/AnyPortalV2/issues"},"license":"MIT","readme":"# @anyportal/cli\r\n\r\nThe command-line tool (and MCP server) for publishing PWAs to the\r\n[AnyPortal](../../README.md) app store. Built for both human developers and AI agents.\r\n\r\n```bash\r\nnpm install -g @anyportal/cli\r\n# or run ad-hoc:\r\nnpx @anyportal/cli <command>\r\n```\r\n\r\n## Quick start\r\n\r\n```bash\r\nanyportal login                 # email + password for your AnyPortal account\r\nanyportal init                  # scaffold anyportal.json + agent-instruction files\r\n#   …build your PWA, fill in anyportal.json…\r\nanyportal publish               # create-or-update the app (upserts by slug)\r\nanyportal apps list             # see your apps\r\n```\r\n\r\n## Commands\r\n\r\n| Command                                                    | Description                                                                                                 |\r\n| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |\r\n| `login` / `logout` / `whoami`                              | Manage the stored session (GoTrue email/password).                                                          |\r\n| `init [dir]`                                               | Scaffold `anyportal.json`, `ANYPORTAL.md`, `AGENTS.md`, `.cursor/rules`, `.github/copilot-instructions.md`. |\r\n| `publish [dir]`                                            | Create or update the app described by `anyportal.json`. Auto-provisions an OAuth client for embedded apps.  |\r\n| `apps list` / `apps get <slug>` / `apps delete <slugOrId>` | Manage your published apps.                                                                                 |\r\n| `clients list` / `create` / `delete <id>` / `rotate <id>`  | Manage OAuth clients (for embedded \"Login with AnyPortal\" apps).                                            |\r\n| `link <slug> [dir]`                                        | Pull an existing published app into a local `anyportal.json`.                                               |\r\n\r\nGlobal flags: `--registry <url>`, `--anon-key <key>`, `--json`.\r\n\r\n## Configuration\r\n\r\nResolved in order: command flags → environment → `~/.anyportal/config.json` → defaults.\r\n\r\n| Setting                | Env                  | Default                                    |\r\n| ---------------------- | -------------------- | ------------------------------------------ |\r\n| Backend URL            | `ANYPORTAL_URL`      | `http://127.0.0.1:54321` (local stack)     |\r\n| Publishable (anon) key | `ANYPORTAL_ANON_KEY` | prompted on first `login`, saved to config |\r\n\r\nState lives under `~/.anyportal/` (override with `ANYPORTAL_HOME`):\r\n`config.json` (registry) and `credentials.json` (session, chmod 600).\r\n\r\n## The manifest (`anyportal.json`)\r\n\r\nSee [`templates/ANYPORTAL.md`](./templates/ANYPORTAL.md) — shipped by `init` — for the full\r\nschema, the PWA requirements, and how embedded apps integrate `@anyportal/portal-sdk`.\r\n\r\n## MCP server\r\n\r\nThe package also ships an MCP server (`anyportal-mcp`) exposing the same operations as tools\r\n(`login`, `init_project`, `publish_app`, `list_apps`, `get_app`, `delete_app`,\r\n`create_oauth_client`, …) over stdio. It reuses the CLI's stored credentials.\r\n\r\n```jsonc\r\n// e.g. in an MCP client config\r\n{\r\n  \"mcpServers\": {\r\n    \"anyportal\": { \"command\": \"anyportal-mcp\" },\r\n  },\r\n}\r\n```\r\n\r\n## How it talks to the backend\r\n\r\n`publish`/`apps` call the `publish-app` edge function; `clients` call the `oauth-clients` edge\r\nfunction. Both authenticate with the stored GoTrue bearer token (auto-refreshed). The function\r\nenforces ownership, slug uniqueness, and URL safety server-side, so the CLI never couples to the\r\ndatabase schema.\r\n","readmeFilename":"README.md","_rev":"1-0a455ecebb431c3566d6d82315ee84db"}