@an-sdk/cli 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +96 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # @an-sdk/cli
2
+
3
+ Deploy AI agents to [AN](https://an.dev) from your terminal.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # 1. Login with your API key (get one at an.dev)
9
+ npx @an-sdk/cli login
10
+
11
+ # 2. Create your agent
12
+ npm init -y && npm install @an-sdk/agent zod
13
+ ```
14
+
15
+ Create `src/agent.ts`:
16
+
17
+ ```ts
18
+ import { agent, tool } from "@an-sdk/agent"
19
+ import { z } from "zod"
20
+
21
+ export default agent({
22
+ model: "claude-sonnet-4-6",
23
+ systemPrompt: "You are a helpful assistant.",
24
+ tools: {
25
+ add: tool({
26
+ description: "Add two numbers",
27
+ inputSchema: z.object({ a: z.number(), b: z.number() }),
28
+ execute: async ({ a, b }) => ({
29
+ content: [{ type: "text", text: `${a + b}` }],
30
+ }),
31
+ }),
32
+ },
33
+ })
34
+ ```
35
+
36
+ ```bash
37
+ # 3. Deploy
38
+ npx @an-sdk/cli deploy
39
+ ```
40
+
41
+ That's it. Your agent is live.
42
+
43
+ ## Commands
44
+
45
+ ### `an login`
46
+
47
+ Authenticate with the AN platform.
48
+
49
+ ```bash
50
+ npx @an-sdk/cli login
51
+ # Enter your API key: an_sk_...
52
+ # Authenticated as John (team: my-team)
53
+ ```
54
+
55
+ Your key is saved to `~/.an/credentials`.
56
+
57
+ ### `an deploy`
58
+
59
+ Bundle and deploy your agent.
60
+
61
+ ```bash
62
+ npx @an-sdk/cli deploy
63
+ # Bundling src/agent.ts...
64
+ # Bundled (12.3kb)
65
+ # Deploying my-agent...
66
+ # https://api.an.dev/v1/chat/my-agent
67
+ ```
68
+
69
+ The CLI:
70
+ 1. Finds your entry point (`src/agent.ts`, `src/index.ts`, `agent.ts`, or `index.ts`)
71
+ 2. Bundles your code + dependencies with esbuild
72
+ 3. Deploys to a secure cloud sandbox
73
+ 4. Returns your agent's URL
74
+
75
+ ## How It Works
76
+
77
+ ```
78
+ Your code --> an deploy --> Cloud Sandbox --> Clients
79
+ (E2B + Claude)
80
+ ```
81
+
82
+ - Your agent runs in an isolated cloud sandbox with Node.js, git, and system tools
83
+ - The Claude Agent SDK executes your agent with the model and tools you defined
84
+ - Clients connect via SSE streaming at the returned URL
85
+
86
+ ## Project Linking
87
+
88
+ After first deploy, the CLI saves `.an/project.json` in your project directory. Subsequent deploys to the same project update the existing agent.
89
+
90
+ ## Environment Variables
91
+
92
+ `AN_API_URL` — Override the API endpoint (default: `https://an.dev/api/v1`)
93
+
94
+ ## License
95
+
96
+ MIT
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@an-sdk/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "AN CLI — deploy AI agents",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "an": "dist/index.js"
8
8
  },
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "README.md"
11
12
  ],
12
13
  "scripts": {
13
14
  "build": "tsup",