ai-todo-cli 0.1.2 → 0.3.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 +11 -0
- package/dist/index.js +9 -2
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -36,6 +36,17 @@ ai-todo spaces:list
|
|
|
36
36
|
|
|
37
37
|
Run `ai-todo --help` to see all available commands (fetched from server).
|
|
38
38
|
|
|
39
|
+
## Release
|
|
40
|
+
|
|
41
|
+
This package is published to npm via GitHub Actions when a tag like `v0.1.3` is pushed.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm version patch
|
|
45
|
+
git push origin main --follow-tags
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The workflow will verify that the Git tag matches `package.json` before publishing.
|
|
49
|
+
|
|
39
50
|
## For AI Agents
|
|
40
51
|
|
|
41
52
|
This CLI is designed for AI agent integration. Key features:
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
+
import { createRequire } from "module";
|
|
5
6
|
|
|
6
7
|
// src/auth.ts
|
|
7
8
|
import { createServer } from "http";
|
|
@@ -219,7 +220,11 @@ function registerDynamicCommands(program2, operations) {
|
|
|
219
220
|
bodyParams,
|
|
220
221
|
op.fixed_body
|
|
221
222
|
);
|
|
222
|
-
|
|
223
|
+
if (op.format === "text" && typeof data === "object" && data !== null && "output" in data) {
|
|
224
|
+
console.log(data.output);
|
|
225
|
+
} else {
|
|
226
|
+
console.log(JSON.stringify(data, null, 2));
|
|
227
|
+
}
|
|
223
228
|
});
|
|
224
229
|
}
|
|
225
230
|
}
|
|
@@ -242,8 +247,10 @@ function coerceValue(value, type) {
|
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
// src/index.ts
|
|
250
|
+
var require2 = createRequire(import.meta.url);
|
|
251
|
+
var { version } = require2("../package.json");
|
|
245
252
|
var program = new Command();
|
|
246
|
-
program.name("ai-todo").description("CLI for AI agents to interact with ai-todo").version(
|
|
253
|
+
program.name("ai-todo").description("CLI for AI agents to interact with ai-todo").version(version);
|
|
247
254
|
program.command("login").description("Authenticate with ai-todo via browser").option("--token <jwt>", "Directly provide a JWT token (for headless environments)").action(async (opts) => {
|
|
248
255
|
await login(opts.token);
|
|
249
256
|
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-todo-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI tool for AI agents to interact with ai-todo",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/strzhao/ai-todo-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/strzhao/ai-todo-cli#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/strzhao/ai-todo-cli/issues"
|
|
13
|
+
},
|
|
6
14
|
"bin": {
|
|
7
|
-
"ai-todo": "
|
|
15
|
+
"ai-todo": "dist/index.js"
|
|
8
16
|
},
|
|
9
17
|
"files": [
|
|
10
18
|
"dist"
|
|
@@ -18,9 +26,9 @@
|
|
|
18
26
|
"open": "^10.0.0"
|
|
19
27
|
},
|
|
20
28
|
"devDependencies": {
|
|
29
|
+
"@types/node": "^22.0.0",
|
|
21
30
|
"tsup": "^8.0.0",
|
|
22
|
-
"typescript": "^5.9.0"
|
|
23
|
-
"@types/node": "^22.0.0"
|
|
31
|
+
"typescript": "^5.9.0"
|
|
24
32
|
},
|
|
25
33
|
"engines": {
|
|
26
34
|
"node": ">=18"
|