@moxt-ai/cli 0.8.2 → 0.9.0-beta.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.
package/README.md CHANGED
@@ -152,6 +152,10 @@ moxt file read -w <workspace-id> --teammate-id <teammateId> -p <path>
152
152
  # Read file content by URL
153
153
  moxt file read --url <moxt-url>
154
154
 
155
+ # Read file content and metadata as JSON (path or URL mode)
156
+ moxt file read -w <workspace-id> -p <path> --json
157
+ moxt file read --url <moxt-url> --json
158
+
155
159
  # Resolve the shareable browser URL for a file by path
156
160
  moxt file get-url -w <workspace-id> -p <path>
157
161
 
@@ -312,12 +316,38 @@ Workflow status type values are `1=todo`, `2=in-progress`, and `3=done`.
312
316
  | `--teammate-id <id>` | Teammate ID (teammate space) |
313
317
  | `-p, --path <path>` | File or directory path |
314
318
  | `-u, --url <url>` | Moxt file URL (e.g., `https://moxt.ai/w/{workspaceId}/{fileId}`) |
319
+ | `--json` | Emit `file read` content and metadata as JSON |
315
320
  | `-l, --local-path <path>` | Local file path (for upload) |
316
321
  | `-r, --recursive` | Create parent directories if needed (path mode only) |
317
322
 
318
323
  > **Note**: `-s`, `--personal`, `--team-space-id`, and `--teammate-id` are mutually exclusive.
319
324
  > For `file read` and `file put`, use either `--url` or `--workspace` with `--path`. They are mutually exclusive.
320
325
  > `--url` with `file put` overwrites an existing file identified by the URL; it never creates new files. Use `--recursive` is not allowed in URL mode.
326
+
327
+ #### `file read` output
328
+
329
+ Without `--json`, a successful `file read` writes only the file content to stdout. With
330
+ `--json`, success writes exactly one JSON object to stdout using this shape:
331
+
332
+ ```json
333
+ {"path":"/notes/today.md","type":"file","entries":null,"content":"Hello\n","updatedAt":1785830950000}
334
+ ```
335
+
336
+ `updatedAt` is always a non-null Unix epoch-millisecond integer for a successful JSON
337
+ read. JSON mode writes no progress or color sequences.
338
+
339
+ Every `file read --json` failure exits with status 1, leaves stdout empty, and writes
340
+ exactly one uncolored JSON object to stderr:
341
+
342
+ ```json
343
+ {"error":{"code":"not_found","message":"/missing.md does not exist","status":404,"details":{"message":"not found"}}}
344
+ ```
345
+
346
+ The `error` object always contains `code`, `message`, `status`, and `details`. `status`
347
+ is the HTTP status for API responses and `null` for local or protocol failures;
348
+ `details` is the API response body when available and otherwise `null`. Stable error
349
+ codes are `invalid_arguments`, `configuration_error`, `authentication_failed`,
350
+ `not_found`, `not_a_file`, `api_error`, and `request_failed`.
321
351
  > `file get-url` returns a stable Moxt URL (e.g., `https://moxt.ai/w/{workspaceId}/{fileId}`) for the given path; the URL is unchanged across writes to the same path and can be fed back into `file read --url` or `file put --url`.
322
352
 
323
353
  ## Configuration