@3ns/cli 1.2.0 → 1.2.1

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 CHANGED
@@ -227,11 +227,21 @@ Your agent's brain lives in Markdown files. These instruction files control your
227
227
 
228
228
  ---
229
229
 
230
- ### `3ns chats` -- Chat History
230
+ ### `3ns chats` -- Chat with Your Agent
231
231
 
232
- Browse and manage your agent's conversation history.
232
+ Send a message and get an AI response. The chat folder is auto-detected so you can just send a message.
233
233
 
234
234
  ```bash
235
+ # Send a message and get an AI response
236
+ 3ns chats send "What can you help me with?"
237
+
238
+ # Use a specific AI model for this message
239
+ 3ns chats send "Summarise this document" --model openai/gpt-5.2
240
+ 3ns chats send "Write a poem" --model anthropic/claude-4-opus
241
+
242
+ # Continue an existing conversation
243
+ 3ns chats send "Tell me more about that" --chat-id 1743435000000
244
+
235
245
  # List all conversations (most recent first)
236
246
  3ns chats list
237
247
  3ns chats list --json
@@ -240,22 +250,16 @@ Browse and manage your agent's conversation history.
240
250
  3ns chats history CHAT_ID
241
251
  3ns chats history CHAT_ID --json
242
252
 
243
- # Send a message to start or continue a conversation
244
- 3ns chats send --folder FOLDER_ID "What can you help me with?"
245
- 3ns chats send --folder FOLDER_ID "Tell me about cooking" --agent-type NORM
246
-
247
- # Specify which AI model to use for this message
248
- 3ns chats send --folder FOLDER_ID "Summarise this document" --model openai/gpt-5.2
249
- 3ns chats send --folder FOLDER_ID "Write a poem" --model anthropic/claude-4-opus
250
-
251
253
  # Delete a chat and all its messages
252
254
  3ns chats delete CHAT_ID
253
255
  ```
254
256
 
255
- Agent types: `NORM` (standard), `AMPS` (amplified), `CUST` (custom).
256
-
257
257
  Use `--model` to override the default model for a single message. Run `3ns models` to see all valid model names. Ollama models are also supported with `ollamadynamic/MODEL_NAME`.
258
258
 
259
+ **Sending images/files with a chat message (raw API):**
260
+ 1. Upload the file first: `3ns files upload ./photo.jpg --folder FOLDER_ID`
261
+ 2. Use the returned URL in the raw API: `POST /openclaw/chats` with `"attachments": [{"url": "FILE_URL", "mimeType": "image/jpeg"}]`
262
+
259
263
  ---
260
264
 
261
265
  ### `3ns files` -- File Management
@@ -368,7 +372,7 @@ The CLI provides complete parity with the 3NS web dashboard. Everything you can
368
372
  | Config folders | `3ns config folders` | `/openclaw/config/folders` | GET |
369
373
  | Config documents | `3ns config read/write` | `/openclaw/config/documents` | GET / PUT / POST |
370
374
  | Available AI models | `3ns models` | `/openclaw/models` | GET |
371
- | Chat conversations | `3ns chats` | `/openclaw/chats` | GET / POST / DELETE |
375
+ | Chat (send + AI reply) | `3ns chats send` | `/openclaw/chats` | GET / POST / DELETE |
372
376
  | File management | `3ns files` | `/openclaw/files` | GET / POST / DELETE |
373
377
  | Agent search | `3ns agents search` | `/openclaw/agents/search` | GET |
374
378
  | Agent card | `3ns agents card` | `/openclaw/agents/:id/card` | GET |
package/SKILL.md CHANGED
@@ -76,18 +76,23 @@ These Markdown files define your agent's personality, knowledge, capabilities, a
76
76
  3ns models --json # Machine-readable output
77
77
  ```
78
78
 
79
- ## Chat History
79
+ ## Chat (Send a Message, Get an AI Response)
80
80
 
81
81
  ```bash
82
- 3ns chats list [--json]
83
- 3ns chats history CHAT_ID [--json]
84
- 3ns chats send --folder FOLDER_ID "message" [--agent-type NORM|AMPS|CUST]
85
- 3ns chats send --folder FOLDER_ID "message" --model openai/gpt-5.2
86
- 3ns chats delete CHAT_ID
82
+ 3ns chats send "message" # Send message, get AI response (folder auto-detected)
83
+ 3ns chats send "message" --model openai/gpt-5.2 # Use a specific model
84
+ 3ns chats send "follow-up question" --chat-id CHAT_ID # Continue an existing conversation
85
+ 3ns chats list [--json] # List conversations
86
+ 3ns chats history CHAT_ID [--json] # View messages
87
+ 3ns chats delete CHAT_ID # Delete a conversation
87
88
  ```
88
89
 
89
90
  Use `--model` to override the default AI model for a single message. Run `3ns models` to see valid names. Ollama models: `ollamadynamic/MODEL_NAME`.
90
91
 
92
+ **Sending images/files with a chat message (raw API):**
93
+ 1. Upload the file first: `3ns files upload ./photo.jpg --folder FOLDER_ID`
94
+ 2. Use the returned URL in the raw API: `POST /openclaw/chats` with `"attachments": [{"url": "FILE_URL", "mimeType": "image/jpeg"}]`
95
+
91
96
  ## File Management
92
97
 
93
98
  ```bash
@@ -1 +1 @@
1
- {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqE5D"}
1
+ {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuE5D"}
@@ -41,25 +41,29 @@ function registerChatsCommands(program) {
41
41
  });
42
42
  chats
43
43
  .command("send")
44
- .description("Send a message to start or continue a chat")
45
- .requiredOption("--folder <id>", "Folder ID for the chat")
44
+ .description("Send a message and get an AI response")
46
45
  .argument("<message>", "Message text")
47
- .option("--agent-type <type>", "Agent type (NORM, AMPS, CUST)", "NORM")
46
+ .option("--folder <id>", "Folder ID for the chat (auto-detected if omitted)")
47
+ .option("--chat-id <id>", "Existing chat ID to continue a conversation")
48
48
  .option("--model <model>", "AI model to use (e.g. openai/gpt-5.2). Run '3ns models' to see options.")
49
49
  .action(async (message, opts) => {
50
- const body = {
51
- folderId: opts.folder,
52
- message,
53
- agentType: opts.agentType,
54
- };
50
+ const body = { message };
51
+ if (opts.folder)
52
+ body.folderId = opts.folder;
53
+ if (opts.chatId)
54
+ body.chatId = opts.chatId;
55
55
  if (opts.model)
56
56
  body.model = opts.model;
57
57
  const { data } = await (0, apiClient_1.api)("POST", "/chats", body);
58
- console.log(`Message sent to chat ${data.chatId}`);
58
+ if (data.response) {
59
+ console.log(`\n[Agent] ${data.response}\n`);
60
+ console.log(`Chat ID: ${data.chatId} (use --chat-id ${data.chatId} to continue)`);
61
+ }
62
+ else {
63
+ console.log(`Message sent to chat ${data.chatId}`);
64
+ }
59
65
  if (data.model)
60
66
  console.log(`Model: ${data.model}`);
61
- if (data.note)
62
- console.log(data.note);
63
67
  });
64
68
  chats
65
69
  .command("delete")
@@ -1 +1 @@
1
- {"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":";;AAGA,sDAqEC;AAvED,4CAA0D;AAE1D,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAEhF,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,qBAAqB,CAAC;SAClC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,EAAE;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,eAAG,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,IAAA,sBAAU,EACR,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC;gBAC1B,MAAM,EAAE,CAAC,CAAC,aAAa;gBACvB,IAAI,EAAE,CAAC,CAAC,SAAS,IAAI,MAAM;gBAC3B,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;aAC5C,CAAC,CAAC,EACH,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAC9B,CA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,GAAG,MAAM,IAAA,eAAG,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,MAAM,mBAAmB,IAAI,CAAC,MAAM,eAAe,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEL,KAAK;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;SACxC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,eAAG,EAAC,QAAQ,EAAE,UAAU,MAAM,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,MAAM,aAAa,IAAI,CAAC,eAAe,qBAAqB,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACP,CAAC"}
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ const program = new commander_1.Command();
16
16
  program
17
17
  .name("3ns")
18
18
  .description("Control your 3NS agent domain from the command line")
19
- .version("1.2.0");
19
+ .version("1.2.1");
20
20
  (0, auth_1.registerAuthCommands)(program);
21
21
  (0, links_1.registerLinksCommands)(program);
22
22
  (0, config_1.registerConfigCommands)(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3ns/cli",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Control your 3NS agent domain from the command line",
5
5
  "main": "dist/index.js",
6
6
  "bin": {