ai-todo-cli 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -263,18 +263,21 @@ program.command("whoami").description("Show current authenticated user").action(
263
263
  }));
264
264
  });
265
265
  async function main() {
266
- const authCommands = ["login", "logout", "whoami", "help", "--help", "-h", "--version", "-V"];
267
266
  const firstArg = process.argv[2];
268
- if (!firstArg || authCommands.includes(firstArg)) {
269
- await program.parseAsync(process.argv);
270
- return;
271
- }
272
- try {
273
- const manifest = await fetchManifest();
274
- registerDynamicCommands(program, manifest.operations);
275
- } catch {
276
- console.log(JSON.stringify({ error: "Failed to load commands from server" }));
277
- process.exit(1);
267
+ const skipCommands = ["login", "logout", "whoami"];
268
+ const isVersionFlag = firstArg === "--version" || firstArg === "-V";
269
+ const isBuiltinCommand = firstArg !== void 0 && skipCommands.includes(firstArg);
270
+ if (!isVersionFlag && !isBuiltinCommand) {
271
+ try {
272
+ const manifest = await fetchManifest();
273
+ registerDynamicCommands(program, manifest.operations);
274
+ } catch {
275
+ const isHelpOrEmpty = !firstArg || ["help", "--help", "-h"].includes(firstArg);
276
+ if (!isHelpOrEmpty) {
277
+ console.log(JSON.stringify({ error: "Failed to load commands from server" }));
278
+ process.exit(1);
279
+ }
280
+ }
278
281
  }
279
282
  await program.parseAsync(process.argv);
280
283
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-todo-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI tool for AI agents to interact with ai-todo",
5
5
  "type": "module",
6
6
  "bin": {