@stevederico/dotbot 0.21.0 → 0.23.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/CHANGELOG.md +8 -0
- package/bin/dotbot.js +17 -32
- package/dotbot.db +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/dotbot.js
CHANGED
|
@@ -13,12 +13,12 @@ process.emit = function (event, error) {
|
|
|
13
13
|
* dotbot CLI
|
|
14
14
|
*
|
|
15
15
|
* Usage:
|
|
16
|
-
* dotbot
|
|
17
|
-
* dotbot
|
|
18
|
-
* dotbot serve --port 3000
|
|
19
|
-
* dotbot --help
|
|
16
|
+
* dotbot "What's the weather?" One-shot query
|
|
17
|
+
* dotbot Interactive chat
|
|
18
|
+
* dotbot serve --port 3000 Start HTTP server
|
|
19
|
+
* dotbot --help Show help
|
|
20
20
|
*
|
|
21
|
-
* Requires Node.js 22
|
|
21
|
+
* Requires Node.js 22+
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { parseArgs } from 'node:util';
|
|
@@ -90,8 +90,8 @@ function printHelp() {
|
|
|
90
90
|
dotbot v${VERSION} — AI agent CLI
|
|
91
91
|
|
|
92
92
|
Usage:
|
|
93
|
-
dotbot "message"
|
|
94
|
-
dotbot
|
|
93
|
+
dotbot "message" One-shot query
|
|
94
|
+
dotbot Interactive chat
|
|
95
95
|
dotbot serve [--port N] Start HTTP server (default: ${DEFAULT_PORT})
|
|
96
96
|
|
|
97
97
|
Options:
|
|
@@ -111,8 +111,7 @@ Environment Variables:
|
|
|
111
111
|
|
|
112
112
|
Examples:
|
|
113
113
|
dotbot "What's the weather in SF?"
|
|
114
|
-
dotbot
|
|
115
|
-
dotbot repl
|
|
114
|
+
dotbot
|
|
116
115
|
dotbot serve --port 8080
|
|
117
116
|
`);
|
|
118
117
|
}
|
|
@@ -494,36 +493,22 @@ async function main() {
|
|
|
494
493
|
process.exit(0);
|
|
495
494
|
}
|
|
496
495
|
|
|
497
|
-
if (args.help
|
|
496
|
+
if (args.help) {
|
|
498
497
|
printHelp();
|
|
499
498
|
process.exit(0);
|
|
500
499
|
}
|
|
501
500
|
|
|
502
501
|
const command = args.positionals[0];
|
|
503
502
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
process.exit(1);
|
|
510
|
-
}
|
|
511
|
-
await runChat(chatMessage, args);
|
|
512
|
-
break;
|
|
513
|
-
|
|
514
|
-
case 'repl':
|
|
515
|
-
await runRepl(args);
|
|
516
|
-
break;
|
|
517
|
-
|
|
518
|
-
case 'serve':
|
|
519
|
-
await runServer(args);
|
|
520
|
-
break;
|
|
521
|
-
|
|
522
|
-
default:
|
|
523
|
-
// Default to chat if not a recognized command
|
|
524
|
-
const message = args.positionals.join(' ');
|
|
503
|
+
if (command === 'serve') {
|
|
504
|
+
await runServer(args);
|
|
505
|
+
} else {
|
|
506
|
+
const message = args.positionals.join(' ');
|
|
507
|
+
if (message) {
|
|
525
508
|
await runChat(message, args);
|
|
526
|
-
|
|
509
|
+
} else {
|
|
510
|
+
await runRepl(args);
|
|
511
|
+
}
|
|
527
512
|
}
|
|
528
513
|
}
|
|
529
514
|
|
package/dotbot.db
CHANGED
|
Binary file
|
package/package.json
CHANGED