@cello-protocol/cli 0.0.309 → 0.0.310

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
@@ -40,7 +40,7 @@ function usageLine(op) {
40
40
  return p.required ? text : `[${text}]`;
41
41
  });
42
42
  const signal = op.command === "send" ? [SIGNAL_FLAGS] : [];
43
- const scoped = [...(op.scoped ? ["[--agent <name-or-id>]"] : []), ...(op.acts ? ["[--force]"] : []), ...(op.plain ? ["[--json]"] : [])];
43
+ const scoped = [...(op.scoped ? ["[--agent <name-or-id>]"] : []), ...(op.acts ? ["[--force]"] : []), ...(op.plain ? ["[--json]"] : []), ...(op.command === "agents" ? ["[--labels]"] : [])];
44
44
  return `cello ${[op.command, ...positional, ...signal, ...flags, ...scoped].join(" ")}`;
45
45
  }
46
46
  function commandHelp(op) {
@@ -79,7 +79,7 @@ Usage: cello <command> [args]
79
79
  ${sections.join("\n\n")}
80
80
 
81
81
  Run 'cello <command> --help' for details on any command.
82
- Commands print JSON on one line, and --pretty indents it.
82
+ Commands print indented JSON.
83
83
  A failure prints {"error","message"} on standard error and exits ${EXIT_REFUSED}.
84
84
  A usage mistake exits ${EXIT_USAGE}, and wait exits ${EXIT_TIMEOUT} when its time runs out.
85
85
  Any agent that can run a shell command can use all of this with no MCP.
@@ -123,10 +123,13 @@ function readValue(param, raw) {
123
123
  usageError(`${flag(param.name)} must be one of ${param.allowed.join(", ")}, got ${raw}`);
124
124
  return raw;
125
125
  }
126
- // One line by default, because the usual reader is a program or an agent paying for every character.
127
- let pretty = false;
126
+ // Indented always: the few extra characters cost an agent next to nothing, and a person can read it.
128
127
  let asJson = false;
129
- const render = (value) => `${pretty ? JSON.stringify(value, null, 2) : JSON.stringify(value)}\n`;
128
+ // cello agents --labels: one line per agent, name then agent_id, for pasting into the account site.
129
+ // The person carries it there; the daemon never sends names anywhere.
130
+ let labels = false;
131
+ const render = (value) => `${JSON.stringify(value, null, 2)}\n`;
132
+ const labelLines = (value) => (value.agents ?? []).map((a) => `${a.name} ${a.agent_id}\n`).join("");
130
133
  // Fails on anything it doesn't recognise, so a mistyped flag can't quietly change what a command does.
131
134
  function parse(op, args) {
132
135
  const params = {};
@@ -143,8 +146,8 @@ function parse(op, args) {
143
146
  flagsEnded = true;
144
147
  continue;
145
148
  }
146
- if (arg === "--pretty") {
147
- pretty = true;
149
+ if (op.command === "agents" && arg === "--labels") {
150
+ labels = true;
148
151
  continue;
149
152
  }
150
153
  if (op.plain && arg === "--json") {
@@ -583,7 +586,7 @@ async function main() {
583
586
  }
584
587
  const result = answer;
585
588
  client.close();
586
- process.stdout.write(op.plain && !asJson ? op.plain(result) : render(result));
589
+ process.stdout.write(labels ? labelLines(result) : op.plain && !asJson ? op.plain(result) : render(result));
587
590
  // The id, never the name: a name is a label, and it could later mean a different agent.
588
591
  if (op.method === "use_agent")
589
592
  writeFileSync(currentAgentFile(), `${result.agent_id}\n`, { mode: 0o600 });
@@ -240,7 +240,7 @@ The code stops agents that are simply trying commands, and pipes and scripts wit
240
240
  summary: "List your agents, and whether each one is online.",
241
241
  scoped: false,
242
242
  acts: false,
243
- description: "List the agents on this machine, whether each one is online, and how much is unread for each.",
243
+ description: "List the agents on this machine, whether each one is online, and how much is unread for each. With --labels, print one line per agent, its name then its agent_id, to paste into the account site so it can show your agents' names. Nothing is sent: you carry it there.",
244
244
  params: [],
245
245
  },
246
246
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/cli",
3
- "version": "0.0.309",
3
+ "version": "0.0.310",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24.7"