@castari/cli 0.2.0 → 0.2.2

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 +140 -0
  2. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # Castari CLI
2
+
3
+ Deploy AI agents with one command.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@castari/cli.svg)](https://www.npmjs.com/package/@castari/cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install -g @castari/cli
12
+ ```
13
+
14
+ ## Quick Start
15
+
16
+ ```bash
17
+ # Authenticate with Castari
18
+ cast login
19
+
20
+ # Create an agent from a git repository
21
+ cast agents create my-agent https://github.com/user/my-agent --slug my-agent
22
+
23
+ # Deploy the agent
24
+ cast deploy my-agent
25
+
26
+ # Invoke the agent
27
+ cast invoke my-agent "Hello, world!"
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ ### Authentication
33
+
34
+ ```bash
35
+ cast login # Authenticate via browser (OAuth)
36
+ cast logout # Clear stored credentials
37
+ cast whoami # Show current user info
38
+ cast apikey create # Create an API key for CI/CD
39
+ cast apikey revoke # Revoke your API key
40
+ ```
41
+
42
+ ### Agent Management
43
+
44
+ ```bash
45
+ cast agents list # List all agents
46
+ cast agents create <name> <git-url> --slug <slug> # Create a new agent
47
+ cast agents get <slug> # Get agent details
48
+ cast agents delete <slug> [--force] # Delete an agent
49
+ ```
50
+
51
+ ### Deployment & Invocation
52
+
53
+ ```bash
54
+ cast deploy <slug> # Deploy an agent
55
+ cast invoke <slug> "<prompt>" # Invoke an agent
56
+ cast invoke <slug> --input <file> # Invoke with prompt from file
57
+ ```
58
+
59
+ ### Secrets
60
+
61
+ ```bash
62
+ cast secrets list <slug> # List secret keys
63
+ cast secrets set <slug> <key> <value> # Set a secret
64
+ cast secrets delete <slug> <key> # Delete a secret
65
+ ```
66
+
67
+ ### Usage Statistics
68
+
69
+ ```bash
70
+ cast usage # Show usage summary (last 30 days)
71
+ cast usage --days 7 # Show usage for specific period
72
+ cast usage --daily # Show daily breakdown
73
+ ```
74
+
75
+ ## Authentication
76
+
77
+ ### Interactive (OAuth)
78
+
79
+ For local development, authenticate via browser:
80
+
81
+ ```bash
82
+ cast login
83
+ ```
84
+
85
+ This opens your browser to sign in and stores credentials in `~/.castari/credentials.yaml`.
86
+
87
+ ### CI/CD (API Key)
88
+
89
+ For automated environments, use an API key:
90
+
91
+ ```bash
92
+ # Create an API key
93
+ cast apikey create
94
+
95
+ # Use it in CI/CD
96
+ export CASTARI_API_KEY="cast_..."
97
+ cast deploy my-agent
98
+ ```
99
+
100
+ ## SDK
101
+
102
+ The CLI is built on `@castari/sdk`, which you can use directly for programmatic access:
103
+
104
+ ```bash
105
+ npm install @castari/sdk
106
+ ```
107
+
108
+ ```typescript
109
+ import { CastariClient } from '@castari/sdk';
110
+
111
+ const client = new CastariClient({
112
+ apiKey: process.env.CASTARI_API_KEY,
113
+ });
114
+
115
+ // List agents
116
+ const agents = await client.agents.list();
117
+
118
+ // Deploy an agent
119
+ await client.agents.deploy('my-agent');
120
+
121
+ // Invoke an agent
122
+ const result = await client.agents.invoke('my-agent', {
123
+ prompt: 'Hello, world!',
124
+ });
125
+
126
+ console.log(result.response_content);
127
+ console.log(`Cost: $${result.total_cost_usd}`);
128
+ ```
129
+
130
+ ## Configuration
131
+
132
+ Credentials are stored in `~/.castari/credentials.yaml` (mode 0600).
133
+
134
+ Environment variables:
135
+ - `CASTARI_API_KEY` - API key for authentication
136
+ - `CASTARI_API_URL` - Override API base URL (default: https://api.castari.dev)
137
+
138
+ ## License
139
+
140
+ MIT - see [LICENSE](https://github.com/castari/cli/blob/main/LICENSE) for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castari/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Castari CLI - Deploy AI agents with one command",
5
5
  "author": "Castari <hello@castari.dev>",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/castari/cli.git",
10
10
  "directory": "packages/cli"
11
11
  },
12
- "homepage": "https://castari.dev",
12
+ "homepage": "https://github.com/castari/cli",
13
13
  "bugs": {
14
14
  "url": "https://github.com/castari/cli/issues"
15
15
  },
@@ -27,7 +27,7 @@
27
27
  "clean": "rm -rf dist"
28
28
  },
29
29
  "dependencies": {
30
- "@castari/sdk": "workspace:*",
30
+ "@castari/sdk": "^0.2.1",
31
31
  "chalk": "^5.3.0",
32
32
  "cli-table3": "^0.6.0",
33
33
  "commander": "^12.0.0",
@@ -39,7 +39,8 @@
39
39
  },
40
40
  "files": [
41
41
  "dist",
42
- "bin"
42
+ "bin",
43
+ "README.md"
43
44
  ],
44
45
  "engines": {
45
46
  "node": ">=18.0.0"