@castari/cli 0.0.10 → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +112 -7
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/generate-client-id.js +1 -1
- package/dist/commands/init.js +3 -3
- package/package.json +4 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Castari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,20 +1,125 @@
|
|
|
1
1
|
# @castari/cli
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The command line interface for building and deploying Castari agents.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install -g @castari/cli
|
|
9
|
+
# or
|
|
10
|
+
bun add -g @castari/cli
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## Quick Start
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
```bash
|
|
16
|
+
# Create a new agent project
|
|
17
|
+
castari init
|
|
18
|
+
|
|
19
|
+
# Run locally for development
|
|
20
|
+
castari dev
|
|
21
|
+
|
|
22
|
+
# Deploy to Castari Platform
|
|
23
|
+
castari deploy
|
|
24
|
+
|
|
25
|
+
# Start a cloud sandbox
|
|
26
|
+
castari start
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Commands
|
|
30
|
+
|
|
31
|
+
### `castari init`
|
|
32
|
+
|
|
33
|
+
Scaffolds a new Castari agent project.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
castari init # Basic agent scaffold
|
|
37
|
+
castari init --demo # Full demo with agent + Next.js chat UI
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Creates:
|
|
41
|
+
- `package.json` - Configured with dependencies
|
|
42
|
+
- `tsconfig.json` - TypeScript configuration
|
|
43
|
+
- `src/agent.ts` - Starter agent code
|
|
44
|
+
- `.env.example` - Environment variable template
|
|
45
|
+
|
|
46
|
+
### `castari dev`
|
|
47
|
+
|
|
48
|
+
Runs the agent locally for development.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
castari dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Starts a local server at `http://localhost:3000` with hot reloading.
|
|
55
|
+
|
|
56
|
+
### `castari deploy`
|
|
57
|
+
|
|
58
|
+
Uploads your agent to the Castari Platform.
|
|
14
59
|
|
|
15
60
|
```bash
|
|
16
|
-
castari
|
|
17
|
-
castari
|
|
18
|
-
castari deploy # Deploy to Platform
|
|
19
|
-
castari start # Start sandbox
|
|
61
|
+
castari deploy
|
|
62
|
+
castari deploy --name my-custom-name
|
|
20
63
|
```
|
|
64
|
+
|
|
65
|
+
**Options:**
|
|
66
|
+
- `--name <name>` - Override the snapshot name (defaults to package.json name)
|
|
67
|
+
|
|
68
|
+
**Requires:** `CASTARI_CLIENT_ID` environment variable
|
|
69
|
+
|
|
70
|
+
### `castari start`
|
|
71
|
+
|
|
72
|
+
Starts a cloud sandbox and connects to your agent.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
castari start
|
|
76
|
+
castari start --snapshot my-agent --volume my-data
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Options:**
|
|
80
|
+
- `--snapshot <name>` - Snapshot to use (defaults to package.json name)
|
|
81
|
+
- `--volume <name>` - Volume to mount for persistent storage
|
|
82
|
+
|
|
83
|
+
**Requires:** `CASTARI_CLIENT_ID` and `ANTHROPIC_API_KEY` environment variables
|
|
84
|
+
|
|
85
|
+
Press `Ctrl+C` to gracefully shut down.
|
|
86
|
+
|
|
87
|
+
### `castari generate-client-id`
|
|
88
|
+
|
|
89
|
+
Creates a new Castari client ID and stores it in `~/.castari/client.json`.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
castari generate-client-id
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Configuration
|
|
96
|
+
|
|
97
|
+
### Environment Variables
|
|
98
|
+
|
|
99
|
+
Create a `.env` file in your project:
|
|
100
|
+
|
|
101
|
+
```env
|
|
102
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
103
|
+
CASTARI_CLIENT_ID=your-client-id
|
|
104
|
+
# CASTARI_PLATFORM_URL=https://castari-api-12511-04c55b73-g4p2s9om.onporter.run
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### package.json
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"name": "my-agent",
|
|
112
|
+
"castari": {
|
|
113
|
+
"volume": "my-volume-name"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Prerequisites
|
|
119
|
+
|
|
120
|
+
- [Bun](https://bun.sh) v1.0+
|
|
121
|
+
- [Anthropic](https://anthropic.com) API key
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
package/dist/commands/deploy.js
CHANGED
|
@@ -41,7 +41,7 @@ export async function deploy(options) {
|
|
|
41
41
|
});
|
|
42
42
|
const zipBuffer = zip.toBuffer();
|
|
43
43
|
console.log(chalk.blue(`🚀 Uploading to Castari Platform...`));
|
|
44
|
-
const platformUrl = process.env.CASTARI_PLATFORM_URL || '
|
|
44
|
+
const platformUrl = process.env.CASTARI_PLATFORM_URL || 'https://castari-api-12511-04c55b73-g4p2s9om.onporter.run';
|
|
45
45
|
const formData = new FormData();
|
|
46
46
|
formData.append('file', new Blob([zipBuffer]), 'source.zip');
|
|
47
47
|
formData.append('snapshot', snapshotName);
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { saveClientAuth } from '../utils/client-auth';
|
|
5
5
|
export async function generateClientId() {
|
|
6
|
-
const platformUrl = process.env.CASTARI_PLATFORM_URL || '
|
|
6
|
+
const platformUrl = process.env.CASTARI_PLATFORM_URL || 'https://castari-api-12511-04c55b73-g4p2s9om.onporter.run';
|
|
7
7
|
const mintOnline = async () => {
|
|
8
8
|
try {
|
|
9
9
|
const res = await fetch(`${platformUrl}/client-ids`, { method: 'POST' });
|
package/dist/commands/init.js
CHANGED
|
@@ -64,7 +64,7 @@ serve({
|
|
|
64
64
|
systemPrompt: 'You are a helpful Castari agent.',
|
|
65
65
|
})
|
|
66
66
|
`;
|
|
67
|
-
const envExample = `ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=https://api.
|
|
67
|
+
const envExample = `ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=https://castari-api-12511-04c55b73-g4p2s9om.onporter.run\n`;
|
|
68
68
|
await writeFile('package.json', JSON.stringify(packageJson, null, 2));
|
|
69
69
|
await writeFile('tsconfig.json', JSON.stringify(tsConfig, null, 2));
|
|
70
70
|
await writeFile('.env.example', envExample);
|
|
@@ -110,7 +110,7 @@ async function initDemo() {
|
|
|
110
110
|
},
|
|
111
111
|
include: ['src'],
|
|
112
112
|
});
|
|
113
|
-
await writeFile(join(agentDir, '.env.example'), 'ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=
|
|
113
|
+
await writeFile(join(agentDir, '.env.example'), 'ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=https://castari-api-12511-04c55b73-g4p2s9om.onporter.run\n');
|
|
114
114
|
await writeFile(join(agentDir, 'src', 'agent.ts'), `import { serve } from '@castari/sdk'
|
|
115
115
|
|
|
116
116
|
serve({
|
|
@@ -187,7 +187,7 @@ const nextConfig = {
|
|
|
187
187
|
|
|
188
188
|
export default nextConfig
|
|
189
189
|
`);
|
|
190
|
-
await writeFile(join(webDir, '.env.example'), 'ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=
|
|
190
|
+
await writeFile(join(webDir, '.env.example'), 'ANTHROPIC_API_KEY=sk-ant-...\nCASTARI_CLIENT_ID=your-client-id\nCASTARI_API_KEY=castari_your-api-key\n# CASTARI_PLATFORM_URL=https://castari-api-12511-04c55b73-g4p2s9om.onporter.run\n# CASTARI_DEBUG=false\n');
|
|
191
191
|
await writeFile(join(webDir, 'app', 'globals.css'), `:root {
|
|
192
192
|
color-scheme: dark;
|
|
193
193
|
--bg: #131418;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castari/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"castari": "./dist/index.js"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "MIT",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@anthropic-ai/claude-agent-sdk": "^0.1.44",
|
|
21
|
-
"@castari/sdk": "^0.
|
|
21
|
+
"@castari/sdk": "^0.1.1",
|
|
22
22
|
"adm-zip": "^0.5.16",
|
|
23
23
|
"cac": "^6.7.14",
|
|
24
24
|
"chalk": "^5.3.0",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/adm-zip": "^0.5.7",
|
|
31
|
+
"@types/bun": "^1.3.3",
|
|
31
32
|
"@types/form-data": "^2.5.2",
|
|
32
33
|
"@types/inquirer": "^9.0.7",
|
|
33
34
|
"@types/node": "^20.10.0",
|