@jecpdev/cli 0.4.0 → 0.5.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/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ program.name("jecp").description("Command-line interface for JECP \u2014 Joint E
12
12
  if (cmd.opts().baseUrl) process.env.JECP_BASE_URL = cmd.opts().baseUrl;
13
13
  });
14
14
  program.command("register").description("Register a new agent (interactive or with flags)").option("-n, --name <name>", "Agent name (display label)").option("-t, --type <type>", "Agent type (research, coder, demo, etc.)").option("-d, --description <description>", "Optional description").action(async (opts) => {
15
- const { registerCmd } = await import("./register-XWWS42Z7.js");
15
+ const { registerCmd } = await import("./register-QMTWQSCX.js");
16
16
  await registerCmd(opts);
17
17
  });
18
18
  program.command("login").description("Save existing agent credentials to ~/.jecp/config.json").option("--agent-id <id>", "Agent ID").option("--api-key <key>", "API key").option("--base-url <url>", "Override Hub URL").action(async (opts) => {
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  bold,
3
+ dim,
3
4
  emit,
4
5
  fail,
5
6
  info,
6
7
  success
7
8
  } from "./chunk-AHQEKKK7.js";
8
9
  import {
10
+ configFilePath,
9
11
  loadConfig,
10
12
  saveConfig
11
13
  } from "./chunk-DZLDBWTB.js";
@@ -36,25 +38,37 @@ async function registerCmd(opts) {
36
38
  },
37
39
  baseUrl
38
40
  );
39
- success(`Agent registered.`);
40
- info("");
41
- info(bold("Save these credentials \u2014 the api_key is shown only once:"));
42
- info("");
43
- info(` AGENT_ID: ${reg.agent_id}`);
44
- info(` API_KEY: ${reg.api_key}`);
45
- info(` Free calls: ${reg.free_calls_remaining}`);
46
- info("");
47
41
  const cfg = loadConfig();
48
42
  cfg.agent_id = reg.agent_id;
49
43
  cfg.api_key = reg.api_key;
50
44
  if (baseUrl !== "https://jecp.dev") cfg.base_url = baseUrl;
51
45
  saveConfig(cfg);
52
- success(`Credentials saved to ~/.jecp/config.json (mode 0600)`);
46
+ success(`Agent registered. Credentials auto-saved to ${bold(configFilePath())} (mode 0600)`);
47
+ info(dim(` \u2192 All subsequent jecp commands authenticate automatically. No env-var setup needed.`));
48
+ info("");
49
+ const freeCalls = reg.free_calls_remaining ?? reg.benefits?.free_api_calls ?? 100;
50
+ info(bold("Credentials (api_key shown ONLY ONCE \u2014 store externally if you need it elsewhere):"));
51
+ info(` AGENT_ID: ${reg.agent_id}`);
52
+ info(` API_KEY: ${reg.api_key}`);
53
+ info(` Free calls: ${freeCalls}`);
54
+ info("");
55
+ info(bold("Try your first invocation now (uses 1 of your 100 free calls):"));
56
+ info(` ${dim("$")} jecp invoke jobdonebot/content-factory translate \\`);
57
+ info(` --input '{"text":"Hello","target_lang":"JA"}'`);
58
+ info("");
59
+ info(` Then explore the catalog:`);
60
+ info(` ${dim("$")} jecp catalog`);
61
+ info("");
53
62
  emit({
54
63
  agent_id: reg.agent_id,
55
64
  api_key: reg.api_key,
56
- name: reg.name,
57
- free_calls_remaining: reg.free_calls_remaining
65
+ name,
66
+ free_calls_remaining: freeCalls,
67
+ config_file: configFilePath(),
68
+ next_step: {
69
+ command: `jecp invoke jobdonebot/content-factory translate --input '{"text":"Hello","target_lang":"JA"}'`,
70
+ description: `Try your first invocation (uses 1 of ${freeCalls} free calls)`
71
+ }
58
72
  });
59
73
  }
60
74
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jecpdev/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Command-line interface for JECP — register agents, invoke capabilities, manage Providers from your terminal.",
5
5
  "type": "module",
6
6
  "bin": {