{"_id":"@canopy-ai/create-canopy-agent","_rev":"3-dc68f362f87d3d9f5c0867dd6156ae36","name":"@canopy-ai/create-canopy-agent","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.2":{"name":"@canopy-ai/create-canopy-agent","version":"0.0.2","keywords":["canopy","agent","starter","scaffold","claude-agent-sdk","ai-agents","x402"],"license":"MIT","_id":"@canopy-ai/create-canopy-agent@0.0.2","maintainers":[{"name":"atifazam","email":"atif@dusk.so"}],"bin":{"create-canopy-agent":"dist/cli.js"},"dist":{"shasum":"ef0003b17b73d596fc7c4db12acba343c9b010b1","tarball":"https://registry.npmjs.org/@canopy-ai/create-canopy-agent/-/create-canopy-agent-0.0.2.tgz","fileCount":63,"integrity":"sha512-m22B9FmanoYhuEaXQUdx2rQsFgyC9sHZs+RL3vazkryWVe5SaEOXPXf8b/1CORd1L2lm40DoZUIAnrUw+PWKGg==","signatures":[{"sig":"MEYCIQCWKELtsipyQDDNg0YCEBH4B+n3rSAWJovIIKTiBvjQGwIhAOyFcOFSW0zkAjoKvuxQANEyomr16NLX+Yy7Vmj2Gkos","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125037},"type":"module","engines":{"node":">=18"},"gitHead":"822465b8e5024faca2d9baea129270bba9ffc308","scripts":{"build":"tsc && node scripts/copy-templates.mjs","start":"tsx src/cli.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"atifazam","email":"atif@dusk.so"},"_npmVersion":"10.9.4","description":"Scaffold a pre-configured Canopy agent starter (trading, research, lead-gen, content, treasury, travel).","directories":{},"_nodeVersion":"22.22.0","dependencies":{"@inquirer/prompts":"^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/create-canopy-agent_0.0.2_1777636310714_0.18689597747214592","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@canopy-ai/create-canopy-agent","version":"0.1.0","keywords":["canopy","agent","starter","scaffold","claude-agent-sdk","ai-agents","x402"],"license":"MIT","_id":"@canopy-ai/create-canopy-agent@0.1.0","maintainers":[{"name":"atifazam","email":"atif@dusk.so"}],"bin":{"create-canopy-agent":"dist/cli.js"},"dist":{"shasum":"e6c3d6ba7ff063fb0a4368e5866d82daf88ae2b0","tarball":"https://registry.npmjs.org/@canopy-ai/create-canopy-agent/-/create-canopy-agent-0.1.0.tgz","fileCount":64,"integrity":"sha512-BasIhm3hW6BpEPAS+p3UMM4yi5lSvLYxwWVwmBLqD9aMEwMZC+Ac7P7Be+lHK2JO0mIw3AhS/vgySheKCAKx7Q==","signatures":[{"sig":"MEUCIH8j/HsMyHWJBvXOO1Fxk3aMUil7DSQkrIltwqX5KaBhAiEA6pqnYh6ABzAILxpWTZeU09jqI+tdSuAUydUcLSVDBq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143894},"type":"module","engines":{"node":">=18"},"gitHead":"6d946cc001f4499188f39d7ce8afbeb329de14e6","scripts":{"test":"tsx --test test/**/*.test.ts","build":"tsc && node scripts/copy-templates.mjs","start":"tsx src/cli.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"atifazam","email":"atif@dusk.so"},"_npmVersion":"10.9.4","description":"Pre-built Canopy agent starter agents for common use cases.","directories":{},"_nodeVersion":"22.22.0","dependencies":{"@inquirer/prompts":"^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/create-canopy-agent_0.1.0_1777925412538_0.675819934233882","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@canopy-ai/create-canopy-agent","version":"0.1.1","description":"Pre-built Canopy agent starter agents for common use cases.","type":"module","publishConfig":{"access":"public"},"bin":{"create-canopy-agent":"dist/cli.js"},"scripts":{"build":"tsc && node scripts/copy-templates.mjs","test":"tsx --test test/**/*.test.ts","typecheck":"tsc --noEmit","start":"tsx src/cli.ts","prepublishOnly":"npm run build"},"dependencies":{"@inquirer/prompts":"^7.0.0"},"devDependencies":{"@types/node":"^22.10.0","tsx":"^4.19.0","typescript":"^5.7.0"},"engines":{"node":">=18"},"keywords":["canopy","agent","starter","scaffold","claude-agent-sdk","ai-agents","x402"],"license":"MIT","_id":"@canopy-ai/create-canopy-agent@0.1.1","gitHead":"3538c825c6ae5e075fc78820661ad892a38c66a1","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-mcPuny4vxGIg8k4zKDjWQLx/cySQMQImCOegskHBEjbwoHnCcm2Ewodn32WAnaBJZK8qt7MqKlc0CM0qBdfQ0Q==","shasum":"14cbd490008131078657d3a5ba984e8790f2a8ee","tarball":"https://registry.npmjs.org/@canopy-ai/create-canopy-agent/-/create-canopy-agent-0.1.1.tgz","fileCount":64,"unpackedSize":144338,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCghIUNVIPR0rQknh5hHJYFonCIsHMSRxZd9JxH7mKYUwIgaFQdvUuuUJiy6vzzKz0Gw7v5qFIOJpG3MsNtOXK8Fn0="}]},"_npmUser":{"name":"atifazam","email":"atif@dusk.so"},"directories":{},"maintainers":[{"name":"atifazam","email":"atif@dusk.so"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/create-canopy-agent_0.1.1_1778413264738_0.7740836996623865"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-01T11:51:50.578Z","modified":"2026-05-10T11:41:05.034Z","0.0.2":"2026-05-01T11:51:50.891Z","0.1.0":"2026-05-04T20:10:12.710Z","0.1.1":"2026-05-10T11:41:04.896Z"},"license":"MIT","keywords":["canopy","agent","starter","scaffold","claude-agent-sdk","ai-agents","x402"],"description":"Pre-built Canopy agent starter agents for common use cases.","maintainers":[{"name":"atifazam","email":"atif@dusk.so"}],"readme":"# create-canopy-agent\n\nScaffold a pre-configured Canopy agent starter and provision the matching policy + agent in your Canopy org — in one guided command.\n\n```bash\nnpx @canopy-ai/create-canopy-agent my-trading-bot\n```\n\n> **Already have an agent project?** Use `npx @canopy-ai/sdk connect` instead — that CLI connects an *existing* project (writes credentials + auto-configures installed MCP clients). `create-canopy-agent` is specifically for scaffolding a *new* project from one of the starters below.\n\nThe CLI will:\n\n1. Ask which starter to scaffold (trading-defi, research, lead-gen, content-creator, treasury-billpay, travel).\n2. Ask the agent name and approval threshold (with sensible per-starter defaults).\n3. **Authenticate.** Pick one of:\n   - **Browser** *(recommended)* — opens a consent page that previews the policy + agent that's about to be created. On Authorize, the **server** creates the policy + agent + grant with cleanup on failure and mints a revocable MCP token scoped to the new agent. The CLI never sees your org's primary API key.\n   - **Paste API key** — paste an `ak_live_…` from `dashboard/settings#api-keys`. The CLI then calls `/api/policies` + `/api/agents` itself with that key.\n   - **`--api-key <key>` flag or `CANOPY_API_KEY` env var** — non-interactive (CI / scripted). Same path as Paste, but no prompt.\n4. Scaffold the starter project locally, write `.env` with the appropriate Canopy creds (MCP token for the browser path, API key for the paste path) + `CANOPY_AGENT_ID` + `ANTHROPIC_API_KEY`.\n\nThe only key you paste manually is your Anthropic API key (`sk-ant-…`).\n\n**Audit trail.** In the browser path, the consent grant (`cli_grants` row) is bound to the new `agents` row, so `SELECT a.* FROM agents a JOIN cli_grants g ON g.agent_id = a.agent_id` resolves cleanly to \"agent created via this consent.\"\n\nAfter scaffolding, if you also want Canopy available in your dev tools (Claude Code, Cursor, etc.) while you build, run `npx @canopy-ai/sdk connect` from the project root.\n\n## Available starters\n\n| Starter | What it does |\n|---|---|\n| `trading-defi-agent` | Quote → validate → execute via price feeds + DEXes |\n| `research-agent` | Multi-source research; pays for gated data APIs |\n| `lead-gen-agent` | Enrich/verify B2B contacts via per-lead paid APIs |\n| `content-creator-agent` | Pay for stock assets + AI image/voice/video generation |\n| `treasury-billpay-agent` | Pay vendor invoices + recurring subs within budget |\n| `travel-agent` | Search flights/airport schedules; surface options before booking |\n\nAll starters are built on [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-typescript) with Canopy's hosted MCP server (`https://mcp.trycanopy.ai/mcp`). Zero Canopy code in the templates — the browser flow reaches Canopy via a revocable MCP token, while the API-key fallback uses your API key + agent id as auth headers.\n\n## Requirements\n\n- Node 18+\n- A Canopy account with a provisioned treasury (one-time dashboard setup at <https://trycanopy.ai>)\n- An Anthropic API key (Claude Agent SDK runs on Claude)\n\n## Local dev\n\n```bash\nnpm install\nnpm run start  # tsx src/cli.ts\n```\n\nFor source-tree dev, the scaffolder reads templates from `../../canopy-agent-starters/`. After `npm run build`, it reads from `dist/templates/`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}