@agentage/cli 0.1.18 → 0.2.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/README.md +107 -190
- package/dist/cli.js +20 -244
- package/dist/cli.js.map +1 -1
- package/dist/commands/agents.d.ts +3 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +45 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/daemon-cmd.d.ts +3 -0
- package/dist/commands/daemon-cmd.d.ts.map +1 -0
- package/dist/commands/daemon-cmd.js +26 -0
- package/dist/commands/daemon-cmd.js.map +1 -0
- package/dist/commands/login.d.ts +2 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +8 -65
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts +2 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +7 -26
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/logs.d.ts +3 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +45 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/machines.d.ts +3 -0
- package/dist/commands/machines.d.ts.map +1 -0
- package/dist/commands/machines.js +14 -0
- package/dist/commands/machines.js.map +1 -0
- package/dist/commands/run.d.ts +2 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +71 -27
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/runs.d.ts +3 -0
- package/dist/commands/runs.d.ts.map +1 -0
- package/dist/commands/runs.js +73 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +34 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/daemon/config.d.ts +32 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +57 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/daemon.d.ts +8 -0
- package/dist/daemon/daemon.d.ts.map +1 -0
- package/dist/daemon/daemon.js +106 -0
- package/dist/daemon/daemon.js.map +1 -0
- package/dist/daemon/logger.d.ts +10 -0
- package/dist/daemon/logger.d.ts.map +1 -0
- package/dist/daemon/logger.js +41 -0
- package/dist/daemon/logger.js.map +1 -0
- package/dist/daemon/routes.d.ts +7 -0
- package/dist/daemon/routes.d.ts.map +1 -0
- package/dist/daemon/routes.js +102 -0
- package/dist/daemon/routes.js.map +1 -0
- package/dist/daemon/run-manager.d.ts +13 -0
- package/dist/daemon/run-manager.d.ts.map +1 -0
- package/dist/daemon/run-manager.js +119 -0
- package/dist/daemon/run-manager.js.map +1 -0
- package/dist/daemon/server.d.ts +11 -0
- package/dist/daemon/server.d.ts.map +1 -0
- package/dist/daemon/server.js +59 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/websocket.d.ts +4 -0
- package/dist/daemon/websocket.d.ts.map +1 -0
- package/dist/daemon/websocket.js +88 -0
- package/dist/daemon/websocket.js.map +1 -0
- package/dist/daemon-entry.d.ts +2 -0
- package/dist/daemon-entry.d.ts.map +1 -0
- package/dist/daemon-entry.js +45 -0
- package/dist/daemon-entry.js.map +1 -0
- package/dist/discovery/code-factory.d.ts +3 -0
- package/dist/discovery/code-factory.d.ts.map +1 -0
- package/dist/discovery/code-factory.js +32 -0
- package/dist/discovery/code-factory.js.map +1 -0
- package/dist/discovery/markdown-factory.d.ts +3 -0
- package/dist/discovery/markdown-factory.d.ts.map +1 -0
- package/dist/discovery/markdown-factory.js +63 -0
- package/dist/discovery/markdown-factory.js.map +1 -0
- package/dist/discovery/scanner.d.ts +3 -0
- package/dist/discovery/scanner.d.ts.map +1 -0
- package/dist/discovery/scanner.js +50 -0
- package/dist/discovery/scanner.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/daemon-client.d.ts +5 -0
- package/dist/utils/daemon-client.d.ts.map +1 -0
- package/dist/utils/daemon-client.js +44 -0
- package/dist/utils/daemon-client.js.map +1 -0
- package/dist/utils/ensure-daemon.d.ts +2 -0
- package/dist/utils/ensure-daemon.d.ts.map +1 -0
- package/dist/utils/ensure-daemon.js +7 -0
- package/dist/utils/ensure-daemon.js.map +1 -0
- package/dist/utils/render.d.ts +3 -0
- package/dist/utils/render.d.ts.map +1 -0
- package/dist/utils/render.js +84 -0
- package/dist/utils/render.js.map +1 -0
- package/package.json +45 -58
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/cli.test.js +0 -67
- package/dist/cli.test.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -39
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/init.test.d.ts +0 -2
- package/dist/commands/init.test.d.ts.map +0 -1
- package/dist/commands/init.test.js +0 -79
- package/dist/commands/init.test.js.map +0 -1
- package/dist/commands/install.d.ts +0 -8
- package/dist/commands/install.d.ts.map +0 -1
- package/dist/commands/install.js +0 -90
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/install.test.d.ts +0 -2
- package/dist/commands/install.test.d.ts.map +0 -1
- package/dist/commands/install.test.js +0 -172
- package/dist/commands/install.test.js.map +0 -1
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -145
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/list.test.d.ts +0 -2
- package/dist/commands/list.test.d.ts.map +0 -1
- package/dist/commands/list.test.js +0 -120
- package/dist/commands/list.test.js.map +0 -1
- package/dist/commands/login.test.d.ts +0 -2
- package/dist/commands/login.test.d.ts.map +0 -1
- package/dist/commands/login.test.js +0 -157
- package/dist/commands/login.test.js.map +0 -1
- package/dist/commands/logout.test.d.ts +0 -2
- package/dist/commands/logout.test.d.ts.map +0 -1
- package/dist/commands/logout.test.js +0 -49
- package/dist/commands/logout.test.js.map +0 -1
- package/dist/commands/publish.d.ts +0 -10
- package/dist/commands/publish.d.ts.map +0 -1
- package/dist/commands/publish.js +0 -138
- package/dist/commands/publish.js.map +0 -1
- package/dist/commands/publish.test.d.ts +0 -2
- package/dist/commands/publish.test.d.ts.map +0 -1
- package/dist/commands/publish.test.js +0 -307
- package/dist/commands/publish.test.js.map +0 -1
- package/dist/commands/run.test.d.ts +0 -2
- package/dist/commands/run.test.d.ts.map +0 -1
- package/dist/commands/run.test.js +0 -105
- package/dist/commands/run.test.js.map +0 -1
- package/dist/commands/search.d.ts +0 -8
- package/dist/commands/search.d.ts.map +0 -1
- package/dist/commands/search.js +0 -41
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/search.test.d.ts +0 -2
- package/dist/commands/search.test.d.ts.map +0 -1
- package/dist/commands/search.test.js +0 -138
- package/dist/commands/search.test.js.map +0 -1
- package/dist/commands/update.d.ts +0 -8
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -28
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/update.test.d.ts +0 -2
- package/dist/commands/update.test.d.ts.map +0 -1
- package/dist/commands/update.test.js +0 -134
- package/dist/commands/update.test.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -2
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/whoami.js +0 -55
- package/dist/commands/whoami.js.map +0 -1
- package/dist/commands/whoami.test.d.ts +0 -2
- package/dist/commands/whoami.test.d.ts.map +0 -1
- package/dist/commands/whoami.test.js +0 -119
- package/dist/commands/whoami.test.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -17
- package/dist/index.test.js.map +0 -1
- package/dist/schemas/agent.schema.d.ts +0 -22
- package/dist/schemas/agent.schema.d.ts.map +0 -1
- package/dist/schemas/agent.schema.js +0 -9
- package/dist/schemas/agent.schema.js.map +0 -1
- package/dist/schemas/agent.schema.test.d.ts +0 -2
- package/dist/schemas/agent.schema.test.d.ts.map +0 -1
- package/dist/schemas/agent.schema.test.js +0 -80
- package/dist/schemas/agent.schema.test.js.map +0 -1
- package/dist/services/auth.service.d.ts +0 -10
- package/dist/services/auth.service.d.ts.map +0 -1
- package/dist/services/auth.service.js +0 -99
- package/dist/services/auth.service.js.map +0 -1
- package/dist/services/auth.service.test.d.ts +0 -2
- package/dist/services/auth.service.test.d.ts.map +0 -1
- package/dist/services/auth.service.test.js +0 -218
- package/dist/services/auth.service.test.js.map +0 -1
- package/dist/services/registry.service.d.ts +0 -13
- package/dist/services/registry.service.d.ts.map +0 -1
- package/dist/services/registry.service.js +0 -74
- package/dist/services/registry.service.js.map +0 -1
- package/dist/services/registry.service.test.d.ts +0 -2
- package/dist/services/registry.service.test.d.ts.map +0 -1
- package/dist/services/registry.service.test.js +0 -222
- package/dist/services/registry.service.test.js.map +0 -1
- package/dist/types/config.types.d.ts +0 -177
- package/dist/types/config.types.d.ts.map +0 -1
- package/dist/types/config.types.js +0 -22
- package/dist/types/config.types.js.map +0 -1
- package/dist/types/registry.types.d.ts +0 -65
- package/dist/types/registry.types.d.ts.map +0 -1
- package/dist/types/registry.types.js +0 -2
- package/dist/types/registry.types.js.map +0 -1
- package/dist/utils/agent-parser.d.ts +0 -26
- package/dist/utils/agent-parser.d.ts.map +0 -1
- package/dist/utils/agent-parser.js +0 -45
- package/dist/utils/agent-parser.js.map +0 -1
- package/dist/utils/agent-parser.test.d.ts +0 -2
- package/dist/utils/agent-parser.test.d.ts.map +0 -1
- package/dist/utils/agent-parser.test.js +0 -102
- package/dist/utils/agent-parser.test.js.map +0 -1
- package/dist/utils/config.d.ts +0 -21
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -99
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/config.test.d.ts +0 -2
- package/dist/utils/config.test.d.ts.map +0 -1
- package/dist/utils/config.test.js +0 -214
- package/dist/utils/config.test.js.map +0 -1
- package/dist/utils/version.d.ts +0 -10
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js +0 -33
- package/dist/utils/version.js.map +0 -1
- package/dist/utils/version.test.d.ts +0 -2
- package/dist/utils/version.test.d.ts.map +0 -1
- package/dist/utils/version.test.js +0 -30
- package/dist/utils/version.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# AgentKit CLI
|
|
2
2
|
|
|
3
|
+
[](https://github.com/agentage/cli/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/js/%40agentage%2Fcli)
|
|
5
|
+
|
|
3
6
|
Command-line interface for creating and managing AI agents.
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
@@ -35,22 +38,6 @@ agent list
|
|
|
35
38
|
|
|
36
39
|
Create a new agent configuration file.
|
|
37
40
|
|
|
38
|
-
#### Synopsis
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
agent init [name]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
#### Arguments
|
|
45
|
-
|
|
46
|
-
- `name` (optional): Name for the agent (default: `my-agent`)
|
|
47
|
-
|
|
48
|
-
#### Description
|
|
49
|
-
|
|
50
|
-
Creates a new agent YAML file in the `agents/` directory with a default template.
|
|
51
|
-
|
|
52
|
-
#### Examples
|
|
53
|
-
|
|
54
41
|
```bash
|
|
55
42
|
# Create agent with default name
|
|
56
43
|
agent init
|
|
@@ -58,250 +45,180 @@ agent init
|
|
|
58
45
|
# Create agent with custom name
|
|
59
46
|
agent init my-assistant
|
|
60
47
|
|
|
61
|
-
# Create
|
|
62
|
-
agent init
|
|
63
|
-
agent init data-analyzer
|
|
64
|
-
agent init customer-support
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
#### Output
|
|
68
|
-
|
|
69
|
-
Creates `agents/<name>.yml`:
|
|
70
|
-
|
|
71
|
-
```yaml
|
|
72
|
-
name: my-assistant
|
|
73
|
-
model: gpt-4
|
|
74
|
-
instructions: |
|
|
75
|
-
You are a helpful AI assistant.
|
|
76
|
-
Respond clearly and concisely.
|
|
77
|
-
tools: []
|
|
78
|
-
variables: {}
|
|
48
|
+
# Create in global directory
|
|
49
|
+
agent init my-agent --global
|
|
79
50
|
```
|
|
80
51
|
|
|
81
|
-
---
|
|
82
|
-
|
|
83
52
|
### `agent run <name> [prompt]`
|
|
84
53
|
|
|
85
54
|
Execute an agent with a prompt.
|
|
86
55
|
|
|
87
|
-
#### Synopsis
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
agent run <name> [prompt]
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### Arguments
|
|
94
|
-
|
|
95
|
-
- `name` (required): Name of the agent to run
|
|
96
|
-
- `prompt` (optional): Message to send to agent (default: `"Hello!"`)
|
|
97
|
-
|
|
98
|
-
#### Description
|
|
99
|
-
|
|
100
|
-
Loads an agent configuration from `agents/<name>.yml` and executes it with the provided prompt. Requires `OPENAI_API_KEY` environment variable.
|
|
101
|
-
|
|
102
|
-
#### Examples
|
|
103
|
-
|
|
104
56
|
```bash
|
|
105
57
|
# Run with default prompt
|
|
106
58
|
agent run my-assistant
|
|
107
59
|
|
|
108
60
|
# Run with custom prompt
|
|
109
61
|
agent run my-assistant "What is TypeScript?"
|
|
110
|
-
|
|
111
|
-
# Run specialized agents
|
|
112
|
-
agent run data-analyzer "Analyze sales trends for Q4"
|
|
113
|
-
agent run customer-support "How do I reset my password?"
|
|
114
62
|
```
|
|
115
63
|
|
|
116
|
-
#### Environment Variables
|
|
117
|
-
|
|
118
|
-
- `OPENAI_API_KEY`: Required. Your OpenAI API key
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
export OPENAI_API_KEY='sk-...'
|
|
122
|
-
agent run my-assistant "Hello"
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
64
|
### `agent list`
|
|
128
65
|
|
|
129
|
-
List all available agents.
|
|
130
|
-
|
|
131
|
-
#### Synopsis
|
|
66
|
+
List all available agents (local and global).
|
|
132
67
|
|
|
133
68
|
```bash
|
|
134
69
|
agent list
|
|
135
70
|
```
|
|
136
71
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Displays all agent configurations found in the `agents/` directory with their names and models.
|
|
72
|
+
### `agent publish [path]`
|
|
140
73
|
|
|
141
|
-
|
|
74
|
+
Publish an agent to the Agentage registry.
|
|
142
75
|
|
|
143
76
|
```bash
|
|
144
|
-
|
|
77
|
+
# Publish agent in current directory
|
|
78
|
+
agent publish
|
|
145
79
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
✅ data-analyzer (gpt-3.5-turbo)
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Agent Configuration File
|
|
154
|
-
|
|
155
|
-
### File Format
|
|
156
|
-
|
|
157
|
-
Agent configurations use YAML format and must be placed in the `agents/` directory.
|
|
80
|
+
# Publish specific agent file
|
|
81
|
+
agent publish agents/my-agent.agent.md
|
|
158
82
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
```yaml
|
|
162
|
-
name: agent-name
|
|
163
|
-
model: gpt-4
|
|
164
|
-
instructions: |
|
|
165
|
-
Multi-line instructions
|
|
166
|
-
for the agent
|
|
167
|
-
tools: []
|
|
168
|
-
variables: {}
|
|
83
|
+
# Dry run (validate without publishing)
|
|
84
|
+
agent publish --dry-run
|
|
169
85
|
```
|
|
170
86
|
|
|
171
|
-
###
|
|
87
|
+
### `agent install <owner/name>`
|
|
172
88
|
|
|
173
|
-
|
|
89
|
+
Install an agent from the registry.
|
|
174
90
|
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
instructions: |
|
|
179
|
-
You are a helpful AI assistant.
|
|
180
|
-
Provide clear and accurate information.
|
|
181
|
-
tools: []
|
|
182
|
-
variables: {}
|
|
183
|
-
```
|
|
91
|
+
```bash
|
|
92
|
+
# Install latest version
|
|
93
|
+
agent install user/my-agent
|
|
184
94
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
```yaml
|
|
188
|
-
name: code-reviewer
|
|
189
|
-
model: gpt-4
|
|
190
|
-
instructions: |
|
|
191
|
-
You are an expert code reviewer.
|
|
192
|
-
Review code for:
|
|
193
|
-
- Bugs and errors
|
|
194
|
-
- Security issues
|
|
195
|
-
- Best practices
|
|
196
|
-
- Performance concerns
|
|
197
|
-
Provide specific, actionable feedback.
|
|
198
|
-
tools: []
|
|
199
|
-
variables: {}
|
|
200
|
-
```
|
|
95
|
+
# Install specific version
|
|
96
|
+
agent install user/my-agent@2025-01-01
|
|
201
97
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
```yaml
|
|
205
|
-
name: data-analyzer
|
|
206
|
-
model: gpt-4
|
|
207
|
-
instructions: |
|
|
208
|
-
You are a data analysis expert.
|
|
209
|
-
Analyze data to find:
|
|
210
|
-
- Trends and patterns
|
|
211
|
-
- Anomalies
|
|
212
|
-
- Key insights
|
|
213
|
-
- Actionable recommendations
|
|
214
|
-
Present findings clearly with evidence.
|
|
215
|
-
tools: []
|
|
216
|
-
variables: {}
|
|
98
|
+
# Install globally
|
|
99
|
+
agent install user/my-agent --global
|
|
217
100
|
```
|
|
218
101
|
|
|
219
|
-
|
|
102
|
+
### `agent search <query>`
|
|
220
103
|
|
|
221
|
-
|
|
104
|
+
Search for agents in the registry.
|
|
222
105
|
|
|
223
|
-
|
|
106
|
+
```bash
|
|
107
|
+
# Search for agents
|
|
108
|
+
agent search "code review"
|
|
224
109
|
|
|
225
|
-
|
|
226
|
-
|
|
110
|
+
# Limit results
|
|
111
|
+
agent search "ai assistant" --limit 5
|
|
227
112
|
```
|
|
228
113
|
|
|
229
|
-
###
|
|
230
|
-
|
|
231
|
-
**Linux/macOS:**
|
|
232
|
-
```bash
|
|
233
|
-
export OPENAI_API_KEY='sk-...'
|
|
234
|
-
```
|
|
114
|
+
### `agent login`
|
|
235
115
|
|
|
236
|
-
|
|
237
|
-
```cmd
|
|
238
|
-
set OPENAI_API_KEY=sk-...
|
|
239
|
-
```
|
|
116
|
+
Authenticate with the Agentage registry.
|
|
240
117
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
$env:OPENAI_API_KEY='sk-...'
|
|
118
|
+
```bash
|
|
119
|
+
agent login
|
|
244
120
|
```
|
|
245
121
|
|
|
246
|
-
|
|
122
|
+
### `agent logout`
|
|
247
123
|
|
|
248
|
-
|
|
124
|
+
Log out from the registry.
|
|
249
125
|
|
|
250
|
-
**Solution:**
|
|
251
126
|
```bash
|
|
252
|
-
|
|
253
|
-
npm install -g @agentage/cli
|
|
254
|
-
|
|
255
|
-
# Or use npx
|
|
256
|
-
npx @agentage/cli init
|
|
127
|
+
agent logout
|
|
257
128
|
```
|
|
258
129
|
|
|
259
|
-
###
|
|
130
|
+
### `agent whoami`
|
|
260
131
|
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
# List available agents
|
|
264
|
-
agent list
|
|
132
|
+
Display the currently logged in user.
|
|
265
133
|
|
|
266
|
-
|
|
267
|
-
agent
|
|
134
|
+
```bash
|
|
135
|
+
agent whoami
|
|
268
136
|
```
|
|
269
137
|
|
|
270
|
-
###
|
|
138
|
+
### `agent update`
|
|
271
139
|
|
|
272
|
-
|
|
273
|
-
- Check API key is valid
|
|
274
|
-
- Verify internet connection
|
|
275
|
-
- Check OpenAI API status
|
|
140
|
+
Update the CLI to the latest version.
|
|
276
141
|
|
|
277
|
-
|
|
142
|
+
```bash
|
|
143
|
+
agent update
|
|
144
|
+
```
|
|
278
145
|
|
|
279
|
-
|
|
280
|
-
- [SDK Documentation](../../docs/api-reference.md)
|
|
281
|
-
- [Getting Started Guide](../../docs/getting-started.md)
|
|
146
|
+
## Development
|
|
282
147
|
|
|
283
|
-
|
|
148
|
+
### Prerequisites
|
|
284
149
|
|
|
285
|
-
- Node.js 20
|
|
286
|
-
- npm 10
|
|
287
|
-
- OpenAI API key
|
|
150
|
+
- Node.js >= 20.0.0
|
|
151
|
+
- npm >= 10.0.0
|
|
288
152
|
|
|
289
|
-
|
|
153
|
+
### Setup
|
|
290
154
|
|
|
291
155
|
```bash
|
|
292
156
|
# Install dependencies
|
|
293
157
|
npm install
|
|
294
158
|
|
|
159
|
+
# Run in development mode
|
|
160
|
+
npm run dev
|
|
161
|
+
|
|
295
162
|
# Build
|
|
296
163
|
npm run build
|
|
297
164
|
|
|
298
|
-
#
|
|
299
|
-
npm
|
|
165
|
+
# Run tests
|
|
166
|
+
npm test
|
|
167
|
+
|
|
168
|
+
# Run tests with coverage
|
|
169
|
+
npm run test:coverage
|
|
300
170
|
|
|
301
|
-
#
|
|
171
|
+
# Lint
|
|
172
|
+
npm run lint
|
|
173
|
+
|
|
174
|
+
# Type check
|
|
175
|
+
npm run type-check
|
|
176
|
+
|
|
177
|
+
# Full verification (type-check, lint, build, test)
|
|
302
178
|
npm run verify
|
|
303
179
|
```
|
|
304
180
|
|
|
181
|
+
### Project Structure
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
cli/
|
|
185
|
+
├── src/
|
|
186
|
+
│ ├── cli.ts # CLI entry point
|
|
187
|
+
│ ├── index.ts # Package exports
|
|
188
|
+
│ ├── commands/ # CLI command handlers
|
|
189
|
+
│ │ ├── init.ts
|
|
190
|
+
│ │ ├── run.ts
|
|
191
|
+
│ │ ├── list.ts
|
|
192
|
+
│ │ ├── publish.ts
|
|
193
|
+
│ │ ├── install.ts
|
|
194
|
+
│ │ ├── search.ts
|
|
195
|
+
│ │ ├── login.ts
|
|
196
|
+
│ │ ├── logout.ts
|
|
197
|
+
│ │ ├── whoami.ts
|
|
198
|
+
│ │ └── update.ts
|
|
199
|
+
│ ├── services/ # API services
|
|
200
|
+
│ │ ├── auth.service.ts
|
|
201
|
+
│ │ └── registry.service.ts
|
|
202
|
+
│ ├── utils/ # Utility functions
|
|
203
|
+
│ │ ├── agent-parser.ts
|
|
204
|
+
│ │ ├── config.ts
|
|
205
|
+
│ │ ├── lockfile.ts
|
|
206
|
+
│ │ └── version.ts
|
|
207
|
+
│ ├── schemas/ # Zod schemas
|
|
208
|
+
│ │ └── agent.schema.ts
|
|
209
|
+
│ ├── types/ # TypeScript types
|
|
210
|
+
│ │ ├── config.types.ts
|
|
211
|
+
│ │ ├── lockfile.types.ts
|
|
212
|
+
│ │ └── registry.types.ts
|
|
213
|
+
│ └── __mocks__/ # Jest mocks
|
|
214
|
+
│ └── chalk.ts
|
|
215
|
+
├── package.json
|
|
216
|
+
├── tsconfig.json
|
|
217
|
+
├── jest.config.js
|
|
218
|
+
├── eslint.config.js
|
|
219
|
+
└── README.md
|
|
220
|
+
```
|
|
221
|
+
|
|
305
222
|
## License
|
|
306
223
|
|
|
307
224
|
MIT
|
package/dist/cli.js
CHANGED
|
@@ -1,248 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import chalk from 'chalk';
|
|
3
2
|
import { Command } from 'commander';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { whoamiCommand } from './commands/whoami.js';
|
|
14
|
-
import { version } from './index.js';
|
|
15
|
-
import { AuthError, getMe } from './services/auth.service.js';
|
|
16
|
-
import { loadConfig } from './utils/config.js';
|
|
17
|
-
import { checkForUpdates } from './utils/version.js';
|
|
18
|
-
const displayBanner = () => {
|
|
19
|
-
console.log();
|
|
20
|
-
console.log(chalk.cyan.bold(' ╔═══════════════════════════════════════════╗'));
|
|
21
|
-
console.log(chalk.cyan.bold(' ║') +
|
|
22
|
-
chalk.white.bold(' 🤖 AgentKit CLI ') +
|
|
23
|
-
chalk.cyan.bold('║'));
|
|
24
|
-
console.log(chalk.cyan.bold(' ╚═══════════════════════════════════════════╝'));
|
|
25
|
-
console.log();
|
|
26
|
-
};
|
|
27
|
-
const displayVersionInfo = async () => {
|
|
28
|
-
console.log(chalk.gray(` Version: ${chalk.green.bold(version)}`));
|
|
29
|
-
try {
|
|
30
|
-
const config = await loadConfig();
|
|
31
|
-
if (config.auth?.token) {
|
|
32
|
-
const user = await getMe();
|
|
33
|
-
const displayName = user.name || user.email;
|
|
34
|
-
const aliasDisplay = user.verifiedAlias
|
|
35
|
-
? chalk.gray(' (@') +
|
|
36
|
-
chalk.green.bold(user.verifiedAlias) +
|
|
37
|
-
chalk.gray(')')
|
|
38
|
-
: '';
|
|
39
|
-
console.log(chalk.gray(' Logged in as: ') +
|
|
40
|
-
chalk.green.bold(displayName) +
|
|
41
|
-
aliasDisplay);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
console.log(chalk.gray(' Status: ') +
|
|
45
|
-
chalk.yellow('Not logged in') +
|
|
46
|
-
chalk.gray(' (run ') +
|
|
47
|
-
chalk.cyan('agent login') +
|
|
48
|
-
chalk.gray(')'));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
if (error instanceof AuthError && error.code === 'session_expired') {
|
|
53
|
-
console.log(chalk.gray(' Status: ') +
|
|
54
|
-
chalk.yellow('Session expired') +
|
|
55
|
-
chalk.gray(' (run ') +
|
|
56
|
-
chalk.cyan('agent login') +
|
|
57
|
-
chalk.gray(')'));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
console.log(chalk.gray(' Status: ') +
|
|
61
|
-
chalk.yellow('Not logged in') +
|
|
62
|
-
chalk.gray(' (run ') +
|
|
63
|
-
chalk.cyan('agent login') +
|
|
64
|
-
chalk.gray(')'));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
const result = await checkForUpdates(version);
|
|
69
|
-
if (result.updateAvailable) {
|
|
70
|
-
console.log();
|
|
71
|
-
console.log(chalk.yellow.bold(' ⚠️ Update available: ') +
|
|
72
|
-
chalk.red(version) +
|
|
73
|
-
chalk.gray(' → ') +
|
|
74
|
-
chalk.green.bold(result.latestVersion));
|
|
75
|
-
console.log(chalk.yellow(' Run ') +
|
|
76
|
-
chalk.cyan.bold('agent update') +
|
|
77
|
-
chalk.yellow(' to update to the latest version'));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
}
|
|
82
|
-
console.log();
|
|
83
|
-
};
|
|
84
|
-
const displayCustomHelp = () => {
|
|
85
|
-
console.log(chalk.white.bold(' Usage: ') +
|
|
86
|
-
chalk.cyan('agent') +
|
|
87
|
-
chalk.gray(' [command] [options]'));
|
|
88
|
-
console.log();
|
|
89
|
-
console.log(chalk.white.bold(' Commands:'));
|
|
90
|
-
console.log();
|
|
91
|
-
const commands = [
|
|
92
|
-
{ cmd: 'init', args: '[name]', desc: 'Initialize a new agent', icon: '🚀' },
|
|
93
|
-
{ cmd: 'run', args: '<name> [prompt]', desc: 'Run an agent', icon: '▶️ ' },
|
|
94
|
-
{ cmd: 'list', args: '', desc: 'List all agents', icon: '📋' },
|
|
95
|
-
{
|
|
96
|
-
cmd: 'publish',
|
|
97
|
-
args: '[path]',
|
|
98
|
-
desc: 'Publish agent to registry',
|
|
99
|
-
icon: '📤',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
cmd: 'install',
|
|
103
|
-
args: '<owner/name>',
|
|
104
|
-
desc: 'Install agent from registry',
|
|
105
|
-
icon: '📥',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
cmd: 'search',
|
|
109
|
-
args: '<query>',
|
|
110
|
-
desc: 'Search for agents',
|
|
111
|
-
icon: '🔍',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
cmd: 'login',
|
|
115
|
-
args: '',
|
|
116
|
-
desc: 'Login to the Agentage registry',
|
|
117
|
-
icon: '🔐',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
cmd: 'logout',
|
|
121
|
-
args: '',
|
|
122
|
-
desc: 'Logout from the Agentage registry',
|
|
123
|
-
icon: '🚪',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
cmd: 'whoami',
|
|
127
|
-
args: '',
|
|
128
|
-
desc: 'Display the currently logged in user',
|
|
129
|
-
icon: '👤',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
cmd: 'update',
|
|
133
|
-
args: '',
|
|
134
|
-
desc: 'Update the CLI to the latest version',
|
|
135
|
-
icon: '⬆️ ',
|
|
136
|
-
},
|
|
137
|
-
];
|
|
138
|
-
for (const { cmd, args, desc, icon } of commands) {
|
|
139
|
-
const cmdStr = chalk.cyan.bold(cmd.padEnd(10));
|
|
140
|
-
const argsStr = chalk.gray(args.padEnd(16));
|
|
141
|
-
console.log(` ${icon} ${cmdStr} ${argsStr} ${chalk.white(desc)}`);
|
|
142
|
-
}
|
|
143
|
-
console.log();
|
|
144
|
-
console.log(chalk.white.bold(' Options:'));
|
|
145
|
-
console.log();
|
|
146
|
-
console.log(` ${chalk.cyan.bold('-v, --version')} ${chalk.white('Display version number')}`);
|
|
147
|
-
console.log(` ${chalk.cyan.bold('-h, --help')} ${chalk.white('Display this help message')}`);
|
|
148
|
-
console.log();
|
|
149
|
-
console.log(chalk.white.bold(' Examples:'));
|
|
150
|
-
console.log();
|
|
151
|
-
console.log(chalk.white(' $ ') + chalk.cyan('agent init my-agent'));
|
|
152
|
-
console.log(chalk.white(' $ ') +
|
|
153
|
-
chalk.cyan('agent run my-agent') +
|
|
154
|
-
chalk.white(' "Hello, how are you?"'));
|
|
155
|
-
console.log(chalk.white(' $ ') + chalk.cyan('agent list'));
|
|
156
|
-
console.log();
|
|
157
|
-
};
|
|
3
|
+
import { registerRun } from './commands/run.js';
|
|
4
|
+
import { registerAgents } from './commands/agents.js';
|
|
5
|
+
import { registerRuns } from './commands/runs.js';
|
|
6
|
+
import { registerMachines } from './commands/machines.js';
|
|
7
|
+
import { registerStatus } from './commands/status.js';
|
|
8
|
+
import { registerLogin } from './commands/login.js';
|
|
9
|
+
import { registerLogout } from './commands/logout.js';
|
|
10
|
+
import { registerLogs } from './commands/logs.js';
|
|
11
|
+
import { registerDaemon } from './commands/daemon-cmd.js';
|
|
158
12
|
const program = new Command();
|
|
159
|
-
program
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
displayCustomHelp();
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
program
|
|
174
|
-
.command('init')
|
|
175
|
-
.description('Initialize a new agent')
|
|
176
|
-
.argument('[name]', 'Agent name')
|
|
177
|
-
.option('-g, --global', 'Initialize in global directory (~/.agentage)')
|
|
178
|
-
.action(initCommand);
|
|
179
|
-
program
|
|
180
|
-
.command('run')
|
|
181
|
-
.description('Run an agent')
|
|
182
|
-
.argument('<name>', 'Agent name')
|
|
183
|
-
.argument('[prompt]', 'Prompt to send to the agent')
|
|
184
|
-
.action(runCommand);
|
|
185
|
-
program.command('list').description('List all agents').action(listCommand);
|
|
186
|
-
program
|
|
187
|
-
.command('publish')
|
|
188
|
-
.description('Publish agent to registry')
|
|
189
|
-
.argument('[path]', 'Path to agent file')
|
|
190
|
-
.option('-v, --visibility <visibility>', 'Visibility (public or private)', 'public')
|
|
191
|
-
.option('--version <version>', 'Override version')
|
|
192
|
-
.option('-t, --tag <tag...>', 'Add tags')
|
|
193
|
-
.option('-c, --changelog <message>', 'Changelog message')
|
|
194
|
-
.option('--dry-run', 'Validate without publishing')
|
|
195
|
-
.action(publishCommand);
|
|
196
|
-
program
|
|
197
|
-
.command('install')
|
|
198
|
-
.description('Install agent from registry')
|
|
199
|
-
.argument('<name>', 'Agent name (owner/name[@version])')
|
|
200
|
-
.option('-g, --global', 'Install to global location')
|
|
201
|
-
.option('-l, --local', 'Install to local project')
|
|
202
|
-
.option('-f, --force', 'Overwrite existing')
|
|
203
|
-
.action(installCommand);
|
|
204
|
-
program
|
|
205
|
-
.command('search')
|
|
206
|
-
.description('Search for agents in registry')
|
|
207
|
-
.argument('<query>', 'Search query')
|
|
208
|
-
.option('-n, --limit <number>', 'Number of results', '10')
|
|
209
|
-
.option('-p, --page <number>', 'Page number', '1')
|
|
210
|
-
.option('--json', 'Output as JSON')
|
|
211
|
-
.action(searchCommand);
|
|
212
|
-
program
|
|
213
|
-
.command('login')
|
|
214
|
-
.description('Login to the Agentage registry')
|
|
215
|
-
.action(loginCommand);
|
|
216
|
-
program
|
|
217
|
-
.command('logout')
|
|
218
|
-
.description('Logout from the Agentage registry')
|
|
219
|
-
.action(logoutCommand);
|
|
220
|
-
program
|
|
221
|
-
.command('whoami')
|
|
222
|
-
.description('Display the currently logged in user')
|
|
223
|
-
.action(whoamiCommand);
|
|
224
|
-
program
|
|
225
|
-
.command('update')
|
|
226
|
-
.description('Update the CLI to the latest version')
|
|
227
|
-
.action(updateCommand);
|
|
228
|
-
if (process.argv.includes('-h') || process.argv.includes('--help')) {
|
|
229
|
-
if (process.argv.length === 3) {
|
|
230
|
-
displayBanner();
|
|
231
|
-
displayVersionInfo().then(() => {
|
|
232
|
-
displayCustomHelp();
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
program.parse();
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
else if (process.argv.length === 2) {
|
|
240
|
-
displayBanner();
|
|
241
|
-
displayVersionInfo().then(() => {
|
|
242
|
-
displayCustomHelp();
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
program.parse();
|
|
247
|
-
}
|
|
13
|
+
program.name('agentage').description('Agentage CLI — control plane for AI agents').version('0.2.0');
|
|
14
|
+
registerRun(program);
|
|
15
|
+
registerAgents(program);
|
|
16
|
+
registerRuns(program);
|
|
17
|
+
registerMachines(program);
|
|
18
|
+
registerStatus(program);
|
|
19
|
+
registerLogin(program);
|
|
20
|
+
registerLogout(program);
|
|
21
|
+
registerLogs(program);
|
|
22
|
+
registerDaemon(program);
|
|
23
|
+
program.parse();
|
|
248
24
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpG,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1B,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,cAAc,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,IAkDjD,CAAC"}
|