@lov3kaizen/agentsea-cli 0.1.0
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 +405 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +443 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/agent.d.ts +9 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +285 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/chat.d.ts +12 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +156 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +187 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +6 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +167 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/model.d.ts +4 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +107 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/provider.d.ts +6 -0
- package/dist/commands/provider.d.ts.map +1 -0
- package/dist/commands/provider.js +168 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/tool.d.ts +4 -0
- package/dist/commands/tool.d.ts.map +1 -0
- package/dist/commands/tool.js +80 -0
- package/dist/commands/tool.js.map +1 -0
- package/dist/commands/workflow.d.ts +6 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +175 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/config/manager.d.ts +62 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +114 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +62 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 lovekaizen
|
|
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
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# @agentsea/cli
|
|
2
|
+
|
|
3
|
+
**Command-line interface for AgentSea ADK** - Build and orchestrate AI agents from your terminal.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@agentsea/cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 🚀 **Quick Setup** - Initialize with interactive prompts
|
|
11
|
+
- 💬 **Interactive Chat** - Chat with agents in your terminal
|
|
12
|
+
- 🤖 **Agent Management** - Create, list, and manage agents
|
|
13
|
+
- 🔌 **Provider Support** - Cloud and local providers
|
|
14
|
+
- 📦 **Model Management** - Pull and manage Ollama models
|
|
15
|
+
- ⚙️ **Configuration** - Persistent configuration management
|
|
16
|
+
- 🎨 **Beautiful Output** - Colored, formatted terminal output
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Global installation
|
|
22
|
+
npm install -g @agentsea/cli
|
|
23
|
+
|
|
24
|
+
# Or use with npx
|
|
25
|
+
npx @agentsea/cli init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Initialize
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
agentsea init
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This will guide you through:
|
|
37
|
+
|
|
38
|
+
- Choosing a provider (cloud or local)
|
|
39
|
+
- Configuring API keys or endpoints
|
|
40
|
+
- Creating a default agent
|
|
41
|
+
|
|
42
|
+
### 2. Start Chatting
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
agentsea chat
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Interactive chat session with your default agent.
|
|
49
|
+
|
|
50
|
+
### 3. Run One-Off Commands
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
agentsea agent run default "What is the capital of France?"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
### `agentsea init`
|
|
59
|
+
|
|
60
|
+
Initialize AgentSea CLI configuration with interactive prompts.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
agentsea init
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `agentsea chat`
|
|
67
|
+
|
|
68
|
+
Start an interactive chat session.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
agentsea chat # Use default agent
|
|
72
|
+
agentsea chat --agent my-agent # Use specific agent
|
|
73
|
+
agentsea chat --model llama3 # Override model
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `agentsea agent`
|
|
77
|
+
|
|
78
|
+
Manage agents.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Create a new agent
|
|
82
|
+
agentsea agent create
|
|
83
|
+
|
|
84
|
+
# List all agents
|
|
85
|
+
agentsea agent list
|
|
86
|
+
|
|
87
|
+
# Get agent details
|
|
88
|
+
agentsea agent get <name>
|
|
89
|
+
|
|
90
|
+
# Run an agent with a message
|
|
91
|
+
agentsea agent run <name> "Your message"
|
|
92
|
+
|
|
93
|
+
# Set default agent
|
|
94
|
+
agentsea agent default <name>
|
|
95
|
+
|
|
96
|
+
# Delete an agent
|
|
97
|
+
agentsea agent delete <name>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### `agentsea provider`
|
|
101
|
+
|
|
102
|
+
Manage providers.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# List all providers
|
|
106
|
+
agentsea provider list
|
|
107
|
+
|
|
108
|
+
# Get provider details
|
|
109
|
+
agentsea provider get <name>
|
|
110
|
+
|
|
111
|
+
# Add a new provider
|
|
112
|
+
agentsea provider add
|
|
113
|
+
|
|
114
|
+
# Set default provider
|
|
115
|
+
agentsea provider default <name>
|
|
116
|
+
|
|
117
|
+
# Delete a provider
|
|
118
|
+
agentsea provider delete <name>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### `agentsea model`
|
|
122
|
+
|
|
123
|
+
Manage models (Ollama only).
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# List available models
|
|
127
|
+
agentsea model list
|
|
128
|
+
|
|
129
|
+
# Pull a model from Ollama
|
|
130
|
+
agentsea model pull llama2
|
|
131
|
+
|
|
132
|
+
# Show popular models
|
|
133
|
+
agentsea model popular
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### `agentsea config`
|
|
137
|
+
|
|
138
|
+
Show current configuration.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
agentsea config
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Examples
|
|
145
|
+
|
|
146
|
+
### Cloud Provider (Anthropic)
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Initialize with Anthropic
|
|
150
|
+
agentsea init
|
|
151
|
+
> Cloud Provider
|
|
152
|
+
> Anthropic
|
|
153
|
+
> [Enter API Key]
|
|
154
|
+
|
|
155
|
+
# Chat with Claude
|
|
156
|
+
agentsea chat
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Local Provider (Ollama)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Initialize with Ollama
|
|
163
|
+
agentsea init
|
|
164
|
+
> Local Provider
|
|
165
|
+
> Ollama
|
|
166
|
+
> http://localhost:11434
|
|
167
|
+
|
|
168
|
+
# Pull a model
|
|
169
|
+
agentsea model pull llama2
|
|
170
|
+
|
|
171
|
+
# Chat with local model
|
|
172
|
+
agentsea chat
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Multiple Agents
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Create a coding assistant
|
|
179
|
+
agentsea agent create
|
|
180
|
+
> Name: coder
|
|
181
|
+
> Model: codellama
|
|
182
|
+
> System Prompt: You are a coding assistant...
|
|
183
|
+
|
|
184
|
+
# Create a writer assistant
|
|
185
|
+
agentsea agent create
|
|
186
|
+
> Name: writer
|
|
187
|
+
> Model: llama2
|
|
188
|
+
> System Prompt: You are a creative writer...
|
|
189
|
+
|
|
190
|
+
# Use specific agent
|
|
191
|
+
agentsea chat --agent coder
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Configuration
|
|
195
|
+
|
|
196
|
+
Configuration is stored in:
|
|
197
|
+
|
|
198
|
+
- **Linux**: `~/.config/agentsea-cli/config.json`
|
|
199
|
+
- **macOS**: `~/Library/Preferences/agentsea-cli/config.json`
|
|
200
|
+
- **Windows**: `%APPDATA%\agentsea-cli\config.json`
|
|
201
|
+
|
|
202
|
+
### Configuration Structure
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"defaultProvider": "anthropic",
|
|
207
|
+
"defaultAgent": "default",
|
|
208
|
+
"providers": {
|
|
209
|
+
"anthropic": {
|
|
210
|
+
"name": "anthropic",
|
|
211
|
+
"type": "anthropic",
|
|
212
|
+
"apiKey": "sk-ant-...",
|
|
213
|
+
"timeout": 60000
|
|
214
|
+
},
|
|
215
|
+
"ollama": {
|
|
216
|
+
"name": "ollama",
|
|
217
|
+
"type": "ollama",
|
|
218
|
+
"baseUrl": "http://localhost:11434",
|
|
219
|
+
"timeout": 60000
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"agents": {
|
|
223
|
+
"default": {
|
|
224
|
+
"name": "default",
|
|
225
|
+
"description": "Default agent",
|
|
226
|
+
"model": "claude-sonnet-4-20250514",
|
|
227
|
+
"provider": "anthropic",
|
|
228
|
+
"systemPrompt": "You are a helpful assistant.",
|
|
229
|
+
"temperature": 0.7,
|
|
230
|
+
"maxTokens": 2048
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Environment Variables
|
|
237
|
+
|
|
238
|
+
API keys can also be set via environment variables:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
export ANTHROPIC_API_KEY=your_key_here
|
|
242
|
+
export OPENAI_API_KEY=your_key_here
|
|
243
|
+
export GEMINI_API_KEY=your_key_here
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Supported Providers
|
|
247
|
+
|
|
248
|
+
### Cloud Providers
|
|
249
|
+
|
|
250
|
+
- **Anthropic** - Claude models
|
|
251
|
+
- **OpenAI** - GPT models
|
|
252
|
+
- **Google** - Gemini models
|
|
253
|
+
|
|
254
|
+
### Local Providers
|
|
255
|
+
|
|
256
|
+
- **Ollama** - Local LLM runtime
|
|
257
|
+
- **LM Studio** - GUI for local models
|
|
258
|
+
- **LocalAI** - OpenAI-compatible local API
|
|
259
|
+
|
|
260
|
+
## Ollama Integration
|
|
261
|
+
|
|
262
|
+
The CLI has first-class support for Ollama:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Make sure Ollama is running
|
|
266
|
+
ollama serve
|
|
267
|
+
|
|
268
|
+
# Pull popular models
|
|
269
|
+
agentsea model pull llama2
|
|
270
|
+
agentsea model pull mistral
|
|
271
|
+
agentsea model pull codellama
|
|
272
|
+
|
|
273
|
+
# List available models
|
|
274
|
+
agentsea model list
|
|
275
|
+
|
|
276
|
+
# Show popular models
|
|
277
|
+
agentsea model popular
|
|
278
|
+
|
|
279
|
+
# Chat with local model
|
|
280
|
+
agentsea chat
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Tips & Tricks
|
|
284
|
+
|
|
285
|
+
### 1. Quick Chat
|
|
286
|
+
|
|
287
|
+
Create an alias for quick access:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
alias bc="agentsea chat"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### 2. Multiple Providers
|
|
294
|
+
|
|
295
|
+
Set up multiple providers for different use cases:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
agentsea provider add
|
|
299
|
+
> Name: anthropic-prod
|
|
300
|
+
> Type: Anthropic
|
|
301
|
+
|
|
302
|
+
agentsea provider add
|
|
303
|
+
> Name: ollama-dev
|
|
304
|
+
> Type: Ollama
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### 3. Specialized Agents
|
|
308
|
+
|
|
309
|
+
Create agents for specific tasks:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Coding agent
|
|
313
|
+
agentsea agent create
|
|
314
|
+
> Name: code
|
|
315
|
+
> Model: codellama
|
|
316
|
+
> System Prompt: You are an expert programmer...
|
|
317
|
+
|
|
318
|
+
# Writing agent
|
|
319
|
+
agentsea agent create
|
|
320
|
+
> Name: write
|
|
321
|
+
> Model: llama2
|
|
322
|
+
> System Prompt: You are a creative writer...
|
|
323
|
+
|
|
324
|
+
# Use them
|
|
325
|
+
agentsea chat --agent code
|
|
326
|
+
agentsea chat --agent write
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### 4. Verbose Mode
|
|
330
|
+
|
|
331
|
+
Get detailed output:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
agentsea agent run default "Hello" --verbose
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Troubleshooting
|
|
338
|
+
|
|
339
|
+
### "No providers configured"
|
|
340
|
+
|
|
341
|
+
Run `agentsea init` to set up your first provider.
|
|
342
|
+
|
|
343
|
+
### "Provider not found"
|
|
344
|
+
|
|
345
|
+
List providers: `agentsea provider list`
|
|
346
|
+
|
|
347
|
+
Add provider: `agentsea provider add`
|
|
348
|
+
|
|
349
|
+
### "Agent not found"
|
|
350
|
+
|
|
351
|
+
List agents: `agentsea agent list`
|
|
352
|
+
|
|
353
|
+
Create agent: `agentsea agent create`
|
|
354
|
+
|
|
355
|
+
### Ollama Connection Error
|
|
356
|
+
|
|
357
|
+
Make sure Ollama is running:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
ollama serve
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Check the base URL in your provider configuration:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
agentsea provider get ollama
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Model Not Found (Ollama)
|
|
370
|
+
|
|
371
|
+
Pull the model first:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
agentsea model pull llama2
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Development
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
# Install dependencies
|
|
381
|
+
pnpm install
|
|
382
|
+
|
|
383
|
+
# Build the CLI
|
|
384
|
+
pnpm build
|
|
385
|
+
|
|
386
|
+
# Link for local testing
|
|
387
|
+
pnpm link --global
|
|
388
|
+
|
|
389
|
+
# Test commands
|
|
390
|
+
agentsea--help
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## License
|
|
394
|
+
|
|
395
|
+
MIT License - see [LICENSE](../../LICENSE) for details
|
|
396
|
+
|
|
397
|
+
## See Also
|
|
398
|
+
|
|
399
|
+
- [@agentsea/core](../core) - Core AgentSea ADK
|
|
400
|
+
- [@agentsea/nestjs](../nestjs) - NestJS integration
|
|
401
|
+
- [AgentSea Documentation](../../docs)
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
Built with ❤️ by [lovekaizen](https://lovekaizen.com)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|