azerclaw 1.0.1 → 1.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/bin/azerclaw.ts +348 -18
- package/dist/bin/azerclaw.d.ts +14 -8
- package/dist/bin/azerclaw.d.ts.map +1 -1
- package/dist/bin/azerclaw.js +311 -17
- package/dist/bin/azerclaw.js.map +1 -1
- package/dist/src/cli/animations/fish.d.ts +10 -7
- package/dist/src/cli/animations/fish.d.ts.map +1 -1
- package/dist/src/cli/animations/fish.js +116 -122
- package/dist/src/cli/animations/fish.js.map +1 -1
- package/dist/src/cli/commands/chat.d.ts +16 -0
- package/dist/src/cli/commands/chat.d.ts.map +1 -1
- package/dist/src/cli/commands/chat.js +142 -33
- package/dist/src/cli/commands/chat.js.map +1 -1
- package/dist/src/cli/commands/config.d.ts +1 -0
- package/dist/src/cli/commands/config.d.ts.map +1 -1
- package/dist/src/cli/commands/config.js +28 -11
- package/dist/src/cli/commands/config.js.map +1 -1
- package/dist/src/cli/commands/onboard.d.ts +12 -1
- package/dist/src/cli/commands/onboard.d.ts.map +1 -1
- package/dist/src/cli/commands/onboard.js +384 -64
- package/dist/src/cli/commands/onboard.js.map +1 -1
- package/dist/src/cli/commands/run.d.ts.map +1 -1
- package/dist/src/cli/commands/run.js +0 -2
- package/dist/src/cli/commands/run.js.map +1 -1
- package/dist/src/cli/commands/settings.d.ts +31 -0
- package/dist/src/cli/commands/settings.d.ts.map +1 -0
- package/dist/src/cli/commands/settings.js +566 -0
- package/dist/src/cli/commands/settings.js.map +1 -0
- package/dist/src/cli/commands/tui.d.ts +3 -0
- package/dist/src/cli/commands/tui.d.ts.map +1 -1
- package/dist/src/cli/commands/tui.js +197 -69
- package/dist/src/cli/commands/tui.js.map +1 -1
- package/dist/src/config/manager.d.ts +110 -8
- package/dist/src/config/manager.d.ts.map +1 -1
- package/dist/src/config/manager.js +331 -10
- package/dist/src/config/manager.js.map +1 -1
- package/dist/src/config/schema.d.ts +303 -1
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +70 -7
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/core/runtime.d.ts +8 -0
- package/dist/src/core/runtime.d.ts.map +1 -1
- package/dist/src/core/runtime.js +36 -14
- package/dist/src/core/runtime.js.map +1 -1
- package/dist/src/core/server.d.ts +15 -0
- package/dist/src/core/server.d.ts.map +1 -0
- package/dist/src/core/server.js +127 -0
- package/dist/src/core/server.js.map +1 -0
- package/dist/src/providers/router.d.ts.map +1 -1
- package/dist/src/providers/router.js +16 -0
- package/dist/src/providers/router.js.map +1 -1
- package/dist/src/tools/advanced.d.ts.map +1 -1
- package/dist/src/tools/advanced.js +3 -0
- package/dist/src/tools/advanced.js.map +1 -1
- package/dist/src/tools/filesystem.d.ts.map +1 -1
- package/dist/src/tools/filesystem.js +4 -0
- package/dist/src/tools/filesystem.js.map +1 -1
- package/dist/src/tools/index.d.ts +9 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +73 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/loader.d.ts +14 -0
- package/dist/src/tools/loader.d.ts.map +1 -0
- package/dist/src/tools/loader.js +115 -0
- package/dist/src/tools/loader.js.map +1 -0
- package/dist/src/tools/registry.d.ts +27 -0
- package/dist/src/tools/registry.d.ts.map +1 -1
- package/dist/src/tools/registry.js +80 -5
- package/dist/src/tools/registry.js.map +1 -1
- package/dist/src/tools/shell.d.ts.map +1 -1
- package/dist/src/tools/shell.js +1 -0
- package/dist/src/tools/shell.js.map +1 -1
- package/package.json +6 -4
package/bin/azerclaw.ts
CHANGED
|
@@ -7,39 +7,73 @@
|
|
|
7
7
|
* Inspired by OpenClaw, themed with a fish 🐟 instead of a lobster.
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
|
-
* azerclaw
|
|
11
|
-
* azerclaw chat
|
|
12
|
-
* azerclaw run "task"
|
|
13
|
-
* azerclaw tui
|
|
14
|
-
* azerclaw onboard
|
|
15
|
-
* azerclaw config
|
|
16
|
-
* azerclaw
|
|
17
|
-
* azerclaw
|
|
10
|
+
* azerclaw — Launch interactive session (or onboard if first run)
|
|
11
|
+
* azerclaw chat — Interactive chat
|
|
12
|
+
* azerclaw run "task" — Execute a task
|
|
13
|
+
* azerclaw tui — Premium terminal UI
|
|
14
|
+
* azerclaw onboard — Setup wizard
|
|
15
|
+
* azerclaw config — Manage configuration
|
|
16
|
+
* azerclaw config provider — Switch provider
|
|
17
|
+
* azerclaw config model — Switch model
|
|
18
|
+
* azerclaw config apikey — Set API key
|
|
19
|
+
* azerclaw config fallback — Configure fallback
|
|
20
|
+
* azerclaw init — Initialize project (AZERCLAW.md)
|
|
21
|
+
* azerclaw models — Manage AI models
|
|
22
|
+
* azerclaw doctor — Health check
|
|
23
|
+
* azerclaw status — Show current status
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
26
|
const { Command } = require('commander');
|
|
21
|
-
const
|
|
27
|
+
const chalk = require('chalk');
|
|
28
|
+
const { playSplashScreen, printQuickSplash, fishError, fishInfo, fishSuccess } = require('../src/cli/animations/fish');
|
|
22
29
|
const { getConfigManager } = require('../src/config/manager');
|
|
23
30
|
|
|
24
|
-
const VERSION = '1.
|
|
31
|
+
const VERSION = '1.1.0';
|
|
25
32
|
const program = new Command();
|
|
26
33
|
|
|
27
34
|
// ─── Program Setup ──────────────────────────────────────────────
|
|
28
35
|
|
|
29
36
|
program
|
|
30
37
|
.name('azerclaw')
|
|
31
|
-
.description('🐟 AZERCLAW —
|
|
38
|
+
.description('🐟 AZERCLAW — Diabolical AI · Scorched Earth · Your Way')
|
|
32
39
|
.version(VERSION, '-v, --version', 'Display version')
|
|
33
40
|
.option('--no-splash', 'Skip the splash screen')
|
|
34
|
-
.option('--no-color', 'Disable colors')
|
|
41
|
+
.option('--no-color', 'Disable colors')
|
|
42
|
+
.hook('preAction', async () => {
|
|
43
|
+
// Global initialization
|
|
44
|
+
const { registerAllTools } = require('../src/tools');
|
|
45
|
+
await registerAllTools();
|
|
46
|
+
});
|
|
35
47
|
|
|
36
48
|
// ─── Default Action (no command) ────────────────────────────────
|
|
37
49
|
|
|
38
50
|
program
|
|
39
|
-
.
|
|
51
|
+
.argument('[task]', 'Optional task to execute immediately (one-off mode)')
|
|
52
|
+
.action(async (task: string | undefined, opts: any) => {
|
|
40
53
|
const config = getConfigManager();
|
|
41
54
|
config.resolveEnvOverrides();
|
|
42
55
|
|
|
56
|
+
// Check for positional task
|
|
57
|
+
if (task) {
|
|
58
|
+
const { runTask } = require('../src/cli/commands/run');
|
|
59
|
+
await runTask(task.trim(), opts);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check for piped input (stdin)
|
|
64
|
+
if (!process.stdin.isTTY) {
|
|
65
|
+
let input = '';
|
|
66
|
+
process.stdin.setEncoding('utf-8');
|
|
67
|
+
for await (const chunk of process.stdin) {
|
|
68
|
+
input += chunk;
|
|
69
|
+
}
|
|
70
|
+
if (input.trim()) {
|
|
71
|
+
const { runTask } = require('../src/cli/commands/run');
|
|
72
|
+
await runTask(input.trim(), opts);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
43
77
|
if (config.isFirstRun()) {
|
|
44
78
|
// First run: show full splash + onboard
|
|
45
79
|
await playSplashScreen(VERSION);
|
|
@@ -59,16 +93,30 @@ program
|
|
|
59
93
|
.description('Start an interactive chat session')
|
|
60
94
|
.option('-m, --model <model>', 'Override the default model')
|
|
61
95
|
.option('-p, --provider <provider>', 'Override the default provider')
|
|
96
|
+
.option('-f, --file <path>', 'Include a file in the conversation context')
|
|
62
97
|
.action(async (opts: any) => {
|
|
63
98
|
const config = getConfigManager();
|
|
64
99
|
config.resolveEnvOverrides();
|
|
65
100
|
|
|
101
|
+
// Apply CLI flag overrides
|
|
102
|
+
if (opts.model || opts.provider) {
|
|
103
|
+
config.applyRuntimeOverrides(opts);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (opts.file) {
|
|
107
|
+
const fs = require('fs');
|
|
108
|
+
if (fs.existsSync(opts.file)) {
|
|
109
|
+
const content = fs.readFileSync(opts.file, 'utf-8');
|
|
110
|
+
opts.initialMessage = `I've attached the file: ${opts.file}\n\n\`\`\`\n${content}\n\`\`\``;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
66
114
|
if (!opts.parent?.splash === false) {
|
|
67
115
|
printQuickSplash(VERSION);
|
|
68
116
|
}
|
|
69
117
|
|
|
70
118
|
if (config.isFirstRun()) {
|
|
71
|
-
fishInfo('First time?
|
|
119
|
+
fishInfo('First time? Running setup wizard...');
|
|
72
120
|
const { runOnboard } = require('../src/cli/commands/onboard');
|
|
73
121
|
await runOnboard();
|
|
74
122
|
return;
|
|
@@ -81,17 +129,61 @@ program
|
|
|
81
129
|
// ─── Run Command ────────────────────────────────────────────────
|
|
82
130
|
|
|
83
131
|
program
|
|
84
|
-
.command('run
|
|
132
|
+
.command('run [task]')
|
|
85
133
|
.description('Execute a single task')
|
|
86
134
|
.option('-m, --model <model>', 'Override the default model')
|
|
135
|
+
.option('-p, --provider <provider>', 'Override the default provider')
|
|
136
|
+
.option('-f, --file <path>', 'Include a file in the task context')
|
|
87
137
|
.option('-V, --verbose', 'Show tool calls in detail')
|
|
88
|
-
.action(async (task: string, opts: any) => {
|
|
138
|
+
.action(async (task: string | undefined, opts: any) => {
|
|
89
139
|
const config = getConfigManager();
|
|
90
140
|
config.resolveEnvOverrides();
|
|
141
|
+
|
|
142
|
+
if (opts.model || opts.provider) {
|
|
143
|
+
config.applyRuntimeOverrides(opts);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let finalTask = task || '';
|
|
147
|
+
|
|
148
|
+
// Handle piped input if task is missing
|
|
149
|
+
if (!finalTask && !process.stdin.isTTY) {
|
|
150
|
+
process.stdin.setEncoding('utf-8');
|
|
151
|
+
for await (const chunk of process.stdin) {
|
|
152
|
+
finalTask += chunk;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!finalTask.trim()) {
|
|
157
|
+
fishError('No task provided. Usage: azerclaw run "your task" or echo "task" | azerclaw run');
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (opts.file) {
|
|
162
|
+
const fs = require('fs');
|
|
163
|
+
if (fs.existsSync(opts.file)) {
|
|
164
|
+
const content = fs.readFileSync(opts.file, 'utf-8');
|
|
165
|
+
finalTask = `Context from file ${opts.file}:\n\`\`\`\n${content}\n\`\`\`\n\nTask: ${finalTask}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
91
169
|
printQuickSplash(VERSION);
|
|
92
170
|
|
|
93
171
|
const { runTask } = require('../src/cli/commands/run');
|
|
94
|
-
await runTask(
|
|
172
|
+
await runTask(finalTask.trim(), opts);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// ─── Serve Command ──────────────────────────────────────────────
|
|
176
|
+
|
|
177
|
+
program
|
|
178
|
+
.command('serve')
|
|
179
|
+
.description('Start the AZERCLAW local WebSocket daemon for desktop apps')
|
|
180
|
+
.option('-p, --port <port>', 'Port to listen on', '8080')
|
|
181
|
+
.action((opts: any) => {
|
|
182
|
+
printQuickSplash(VERSION);
|
|
183
|
+
const { AzerclawServer } = require('../src/core/server');
|
|
184
|
+
const port = parseInt(opts.port, 10) || 8080;
|
|
185
|
+
const server = new AzerclawServer(port);
|
|
186
|
+
server.start();
|
|
95
187
|
});
|
|
96
188
|
|
|
97
189
|
// ─── TUI Command ────────────────────────────────────────────────
|
|
@@ -99,10 +191,16 @@ program
|
|
|
99
191
|
program
|
|
100
192
|
.command('tui')
|
|
101
193
|
.description('Launch the premium terminal UI')
|
|
102
|
-
.
|
|
194
|
+
.option('-m, --model <model>', 'Override the default model')
|
|
195
|
+
.option('-p, --provider <provider>', 'Override the default provider')
|
|
196
|
+
.action(async (opts: any) => {
|
|
103
197
|
const config = getConfigManager();
|
|
104
198
|
config.resolveEnvOverrides();
|
|
105
199
|
|
|
200
|
+
if (opts.model || opts.provider) {
|
|
201
|
+
config.applyRuntimeOverrides(opts);
|
|
202
|
+
}
|
|
203
|
+
|
|
106
204
|
const { runTUI } = require('../src/cli/commands/tui');
|
|
107
205
|
await runTUI();
|
|
108
206
|
});
|
|
@@ -118,6 +216,28 @@ program
|
|
|
118
216
|
await runOnboard();
|
|
119
217
|
});
|
|
120
218
|
|
|
219
|
+
// ─── Init Command (Project) ────────────────────────────────────
|
|
220
|
+
|
|
221
|
+
program
|
|
222
|
+
.command('init')
|
|
223
|
+
.description('Initialize AZERCLAW for this project (creates AZERCLAW.md + .azerclaw/)')
|
|
224
|
+
.action(() => {
|
|
225
|
+
const { initProject } = require('../src/cli/commands/settings');
|
|
226
|
+
initProject();
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// ─── Status Command ─────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
program
|
|
232
|
+
.command('status')
|
|
233
|
+
.description('Show current model, provider, auth, and project status')
|
|
234
|
+
.action(() => {
|
|
235
|
+
const config = getConfigManager();
|
|
236
|
+
config.resolveEnvOverrides();
|
|
237
|
+
const { showStatus } = require('../src/cli/commands/settings');
|
|
238
|
+
showStatus();
|
|
239
|
+
});
|
|
240
|
+
|
|
121
241
|
// ─── Config Command ─────────────────────────────────────────────
|
|
122
242
|
|
|
123
243
|
const configCmd = program
|
|
@@ -156,6 +276,67 @@ configCmd
|
|
|
156
276
|
configReset();
|
|
157
277
|
});
|
|
158
278
|
|
|
279
|
+
configCmd
|
|
280
|
+
.command('provider [name]')
|
|
281
|
+
.description('Switch the active AI provider (interactive if no name given)')
|
|
282
|
+
.action(async (name?: string) => {
|
|
283
|
+
if (name) {
|
|
284
|
+
const { cliSwitchProvider } = require('../src/cli/commands/settings');
|
|
285
|
+
cliSwitchProvider(name);
|
|
286
|
+
} else {
|
|
287
|
+
const { interactiveProviderSwitch } = require('../src/cli/commands/settings');
|
|
288
|
+
await interactiveProviderSwitch();
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
configCmd
|
|
293
|
+
.command('model [id]')
|
|
294
|
+
.description('Switch the default model (interactive if no id given)')
|
|
295
|
+
.option('-p, --provider <provider>', 'Target provider (defaults to active)')
|
|
296
|
+
.action(async (id?: string, opts?: any) => {
|
|
297
|
+
if (id) {
|
|
298
|
+
const { cliSwitchModel } = require('../src/cli/commands/settings');
|
|
299
|
+
cliSwitchModel(id, opts?.provider);
|
|
300
|
+
} else {
|
|
301
|
+
const { interactiveModelSwitch } = require('../src/cli/commands/settings');
|
|
302
|
+
await interactiveModelSwitch();
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
configCmd
|
|
307
|
+
.command('apikey [provider] [key]')
|
|
308
|
+
.description('Set or change an API key (interactive if no args given)')
|
|
309
|
+
.action(async (provider?: string, key?: string) => {
|
|
310
|
+
if (provider && key) {
|
|
311
|
+
const { cliSetApiKey } = require('../src/cli/commands/settings');
|
|
312
|
+
cliSetApiKey(provider, key);
|
|
313
|
+
} else {
|
|
314
|
+
const { interactiveApiKeyChange } = require('../src/cli/commands/settings');
|
|
315
|
+
await interactiveApiKeyChange();
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
configCmd
|
|
320
|
+
.command('fallback [provider]')
|
|
321
|
+
.description('Set or change the fallback provider (interactive if no arg given)')
|
|
322
|
+
.action(async (provider?: string) => {
|
|
323
|
+
if (provider) {
|
|
324
|
+
const { cliSetFallback } = require('../src/cli/commands/settings');
|
|
325
|
+
cliSetFallback(provider);
|
|
326
|
+
} else {
|
|
327
|
+
const { interactiveFallbackConfig } = require('../src/cli/commands/settings');
|
|
328
|
+
await interactiveFallbackConfig();
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
configCmd
|
|
333
|
+
.command('settings')
|
|
334
|
+
.description('Open the full interactive settings menu')
|
|
335
|
+
.action(async () => {
|
|
336
|
+
const { interactiveSettingsMenu } = require('../src/cli/commands/settings');
|
|
337
|
+
await interactiveSettingsMenu();
|
|
338
|
+
});
|
|
339
|
+
|
|
159
340
|
// Default config action (no sub-command) shows list
|
|
160
341
|
configCmd.action(() => {
|
|
161
342
|
const { configList } = require('../src/cli/commands/config');
|
|
@@ -285,6 +466,155 @@ agentsCmd.action(() => {
|
|
|
285
466
|
agentsList();
|
|
286
467
|
});
|
|
287
468
|
|
|
469
|
+
// ─── Workflow Command ───────────────────────────────────────────
|
|
470
|
+
|
|
471
|
+
const workflowCmd = program
|
|
472
|
+
.command('workflow')
|
|
473
|
+
.description('Manage and run Fishbone workflows');
|
|
474
|
+
|
|
475
|
+
workflowCmd
|
|
476
|
+
.command('run <file>')
|
|
477
|
+
.description('Run a .fishbone workflow file')
|
|
478
|
+
.action(async (file: string) => {
|
|
479
|
+
printQuickSplash(VERSION);
|
|
480
|
+
const { parseFishboneFile, FishboneEngine } = require('../src/workflow/engine');
|
|
481
|
+
const path = require('path');
|
|
482
|
+
const fs = require('fs');
|
|
483
|
+
|
|
484
|
+
const filePath = path.resolve(process.cwd(), file);
|
|
485
|
+
if (!fs.existsSync(filePath)) {
|
|
486
|
+
fishError(`Workflow file not found: ${filePath}`);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const workflow = parseFishboneFile(filePath);
|
|
491
|
+
fishInfo(`Running workflow: ${workflow.name} (v${workflow.version})`);
|
|
492
|
+
|
|
493
|
+
const engine = new FishboneEngine();
|
|
494
|
+
await engine.execute(workflow, {}, async (event: any) => {
|
|
495
|
+
if (event.type === 'step_start') console.log(chalk.hex('#60a5fa')(`[Step] ${event.stepName}...`));
|
|
496
|
+
if (event.type === 'approval_needed') {
|
|
497
|
+
console.log(chalk.hex('#fbbf24')(`[Approval] Needed for: ${event.content}`));
|
|
498
|
+
console.log(chalk.hex('#34d399')(`Resume token: ${event.resumeToken}`));
|
|
499
|
+
}
|
|
500
|
+
if (event.type === 'step_error') console.log(chalk.hex('#ef4444')(`[Error] ${event.content}`));
|
|
501
|
+
if (event.type === 'workflow_complete') fishSuccess('Workflow completed successfully');
|
|
502
|
+
if (event.type === 'workflow_error') fishError(`Workflow failed: ${event.content}`);
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
workflowCmd
|
|
507
|
+
.command('resume <id> <token>')
|
|
508
|
+
.description('Resume a paused workflow')
|
|
509
|
+
.action(async (id: string, token: string) => {
|
|
510
|
+
printQuickSplash(VERSION);
|
|
511
|
+
const { FishboneEngine } = require('../src/workflow/engine');
|
|
512
|
+
const engine = new FishboneEngine();
|
|
513
|
+
const resumed = await engine.resume(id, token);
|
|
514
|
+
if (resumed) {
|
|
515
|
+
fishSuccess(`Workflow ${id} resumed successfully.`);
|
|
516
|
+
} else {
|
|
517
|
+
fishError(`Failed to resume workflow ${id}. Invalid token or session not found.`);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
// ─── Tools Command ──────────────────────────────────────────────
|
|
522
|
+
|
|
523
|
+
const toolsCmd = program
|
|
524
|
+
.command('tools')
|
|
525
|
+
.description('Manage AZERCLAW tools and plugins');
|
|
526
|
+
|
|
527
|
+
toolsCmd
|
|
528
|
+
.command('list')
|
|
529
|
+
.description('List all registered tools')
|
|
530
|
+
.action(() => {
|
|
531
|
+
const { getToolRegistry } = require('../src/tools/registry');
|
|
532
|
+
const registry = getToolRegistry();
|
|
533
|
+
const tools = registry.getAll();
|
|
534
|
+
|
|
535
|
+
console.log('');
|
|
536
|
+
fishInfo(`Registered Tools (${tools.length})`);
|
|
537
|
+
console.log('');
|
|
538
|
+
|
|
539
|
+
const Table = require('cli-table3');
|
|
540
|
+
const table = new Table({
|
|
541
|
+
head: [chalk.hex('#60a5fa')('Name'), chalk.hex('#60a5fa')('Version'), chalk.hex('#60a5fa')('Description')],
|
|
542
|
+
colWidths: [20, 10, 50],
|
|
543
|
+
wordWrap: true,
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
tools.forEach((tool: any) => {
|
|
547
|
+
table.push([
|
|
548
|
+
chalk.hex('#34d399')(tool.name),
|
|
549
|
+
chalk.dim(tool.version),
|
|
550
|
+
tool.description.slice(0, 100) + (tool.description.length > 100 ? '...' : '')
|
|
551
|
+
]);
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
console.log(table.toString());
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
toolsCmd
|
|
558
|
+
.command('info <name>')
|
|
559
|
+
.description('Show detailed information about a tool')
|
|
560
|
+
.action((name: string) => {
|
|
561
|
+
const { getToolRegistry } = require('../src/tools/registry');
|
|
562
|
+
const tool = getToolRegistry().get(name);
|
|
563
|
+
if (!tool) {
|
|
564
|
+
fishError(`Tool not found: ${name}`);
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
console.log('');
|
|
569
|
+
console.log(chalk.hex('#60a5fa').bold(`Tool: ${tool.name}`));
|
|
570
|
+
console.log(chalk.dim(`Version: ${tool.version}`));
|
|
571
|
+
if (tool.author) console.log(chalk.dim(`Author: ${tool.author}`));
|
|
572
|
+
console.log('');
|
|
573
|
+
console.log(tool.description);
|
|
574
|
+
console.log('');
|
|
575
|
+
console.log(chalk.hex('#fbbf24')('Parameters:'));
|
|
576
|
+
console.log(JSON.stringify(tool.parameters, null, 2));
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
toolsCmd
|
|
580
|
+
.command('docs')
|
|
581
|
+
.description('Generate markdown documentation for all tools')
|
|
582
|
+
.option('-o, --output <file>', 'Output file path', 'TOOLS.md')
|
|
583
|
+
.action(async (opts: any) => {
|
|
584
|
+
const { getToolRegistry } = require('../src/tools/registry');
|
|
585
|
+
const fs = require('fs');
|
|
586
|
+
const path = require('path');
|
|
587
|
+
|
|
588
|
+
const tools = getToolRegistry().getAll();
|
|
589
|
+
let markdown = `# 🐟 AZERCLAW Tools Documentation\n\n`;
|
|
590
|
+
markdown += `Generated on ${new Date().toLocaleDateString()}\n\n`;
|
|
591
|
+
|
|
592
|
+
tools.forEach((tool: any) => {
|
|
593
|
+
markdown += `## ${tool.name} (v${tool.version})\n\n`;
|
|
594
|
+
markdown += `${tool.description}\n\n`;
|
|
595
|
+
markdown += `### Parameters\n\n\`\`\`json\n${JSON.stringify(tool.parameters, null, 2)}\n\`\`\`\n\n`;
|
|
596
|
+
markdown += `---\n\n`;
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
const outputPath = path.resolve(process.cwd(), opts.output);
|
|
601
|
+
fs.writeFileSync(outputPath, markdown);
|
|
602
|
+
fishSuccess(`Documentation generated at ${outputPath}`);
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
toolsCmd
|
|
606
|
+
.command('install <url_or_path>')
|
|
607
|
+
.description('Install a tool plugin from a URL or local file (coming soon)')
|
|
608
|
+
.action((src: string) => {
|
|
609
|
+
fishInfo(`Plugin installation for '${src}' will be available in the next release.`);
|
|
610
|
+
fishInfo('For now, manually place your .js/.ts files in the ./plugins directory.');
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
toolsCmd.action(() => {
|
|
614
|
+
program.helpInformation();
|
|
615
|
+
});
|
|
616
|
+
|
|
288
617
|
// ─── Parse & Run ────────────────────────────────────────────────
|
|
289
618
|
|
|
619
|
+
|
|
290
620
|
program.parse(process.argv);
|
package/dist/bin/azerclaw.d.ts
CHANGED
|
@@ -6,14 +6,20 @@
|
|
|
6
6
|
* Inspired by OpenClaw, themed with a fish 🐟 instead of a lobster.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* azerclaw
|
|
10
|
-
* azerclaw chat
|
|
11
|
-
* azerclaw run "task"
|
|
12
|
-
* azerclaw tui
|
|
13
|
-
* azerclaw onboard
|
|
14
|
-
* azerclaw config
|
|
15
|
-
* azerclaw
|
|
16
|
-
* azerclaw
|
|
9
|
+
* azerclaw — Launch interactive session (or onboard if first run)
|
|
10
|
+
* azerclaw chat — Interactive chat
|
|
11
|
+
* azerclaw run "task" — Execute a task
|
|
12
|
+
* azerclaw tui — Premium terminal UI
|
|
13
|
+
* azerclaw onboard — Setup wizard
|
|
14
|
+
* azerclaw config — Manage configuration
|
|
15
|
+
* azerclaw config provider — Switch provider
|
|
16
|
+
* azerclaw config model — Switch model
|
|
17
|
+
* azerclaw config apikey — Set API key
|
|
18
|
+
* azerclaw config fallback — Configure fallback
|
|
19
|
+
* azerclaw init — Initialize project (AZERCLAW.md)
|
|
20
|
+
* azerclaw models — Manage AI models
|
|
21
|
+
* azerclaw doctor — Health check
|
|
22
|
+
* azerclaw status — Show current status
|
|
17
23
|
*/
|
|
18
24
|
export {};
|
|
19
25
|
//# sourceMappingURL=azerclaw.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azerclaw.d.ts","sourceRoot":"","sources":["../../bin/azerclaw.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"azerclaw.d.ts","sourceRoot":"","sources":["../../bin/azerclaw.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|