Skip to content

Commit 3bb54bf

Browse files
Add CLI entry point and tests for agents package (#624)
* Add CLI entry point and tests for agents package Introduces a new CLI for the agents package using yargs, with 'init' and 'mcp' commands stubbed. Adds CLI test suite and configuration for Vitest, updates package.json to register the CLI binary, and includes related dependencies. * Add dev and deploy commands to agents CLI Introduces 'dev' and 'deploy' stub commands to the agents CLI, updates tests for comprehensive coverage of these commands, and adds 'create' as an alias for 'init'. Help output and command descriptions are updated accordingly.
1 parent 3668b9c commit 3bb54bf

File tree

6 files changed

+461
-3
lines changed

6 files changed

+461
-3
lines changed

.changeset/soft-beds-rescue.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"agents": patch
3+
---
4+
5+
Add CLI entry point and tests for agents package
6+
7+
Introduces a new CLI for the agents package using yargs with the following commands (currently stubs, not yet implemented):
8+
9+
- `init` / `create` - Initialize an agents project
10+
- `dev` - Start development server
11+
- `deploy` - Deploy agents to Cloudflare
12+
- `mcp` - The agents mcp server
13+
14+
Adds CLI test suite with comprehensive coverage for all commands and configurations. Updates package.json to register the CLI binary, adds test scripts for CLI testing, and includes yargs dependencies.

package-lock.json

Lines changed: 141 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/agents/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"nanoid": "^5.1.6",
1515
"partyserver": "^0.0.75",
1616
"partysocket": "1.1.6",
17+
"yargs": "^18.0.0",
1718
"zod": "^3.25.76",
1819
"zod-to-ts": "^1.2.0"
1920
},
@@ -23,6 +24,7 @@
2324
"description": "A home for your AI agents",
2425
"devDependencies": {
2526
"@cloudflare/workers-oauth-provider": "^0.0.12",
27+
"@types/yargs": "^17.0.34",
2628
"react": "*",
2729
"vitest-browser-react": "^1.0.1"
2830
},
@@ -123,13 +125,18 @@
123125
"type": "git",
124126
"url": "git+https://github.com/cloudflare/agents.git"
125127
},
128+
"bin": {
129+
"agents": "dist/cli.js"
130+
},
126131
"scripts": {
127132
"build": "tsx ./scripts/build.ts",
128-
"check:test": "npm run check:test:workers && npm run check:test:react",
133+
"check:test": "npm run check:test:workers && npm run check:test:react && npm run check:test:cli",
134+
"check:test:cli": "vitest -r src/cli-tests --watch false",
129135
"check:test:react": "vitest -r src/react-tests --watch false",
130136
"check:test:workers": "vitest -r src/tests --watch false",
131137
"evals": "(cd evals; evalite)",
132-
"test": "npm run test:workers && npm run test:react",
138+
"test": "npm run test:workers && npm run test:react && npm run test:cli",
139+
"test:cli": "vitest -r src/cli-tests",
133140
"test:react": "vitest -r src/react-tests",
134141
"test:e2e": "vitest run src/e2e/e2e.test.ts --sequence.concurrent",
135142
"test:workers": "vitest -r src/tests"

0 commit comments

Comments
 (0)