@plutojl/cli 0.6.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +6 -4
  2. package/dist/cli.cjs +149 -105
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -69,12 +69,13 @@ npx @plutojl/cli tools [name] [--mcp-port <port>]
69
69
 
70
70
  ### `call`
71
71
 
72
- Call a notebook tool from the command line. The tool name and JSON arguments may appear before or after the options.
72
+ Call a notebook tool from the command line. The tool name and JSON arguments may appear before or after the options. The JSON may also come from a file (`@args.json`) or stdin (`-`), which avoids shell quoting for multi-line cell code. Relative `path`, `output_path`, and `new_path` arguments are resolved against the current directory before they are sent, since the server needs absolute notebook paths.
73
73
 
74
74
  ```bash
75
- npx @plutojl/cli call <tool_name> [json_args] [options]
75
+ npx @plutojl/cli call <tool_name> [json_args | @file | -] [options]
76
76
 
77
77
  # Examples
78
+ npx @plutojl/cli call learn_pluto_basics # read this first
78
79
  npx @plutojl/cli call get_notebook_status
79
80
  npx @plutojl/cli call open_notebook '{"path": "/tmp/nb.pluto.jl"}'
80
81
  npx @plutojl/cli call execute_code '{"code": "sqrt(2)"}'
@@ -124,7 +125,7 @@ Example `.plutomcp.json`:
124
125
  }
125
126
  ```
126
127
 
127
- Cell outputs returned by tools are trimmed for the terminal: byte bodies are decoded (text, SVG) or base64-encoded (images), and bodies longer than 32,000 characters are truncated with a `body_note`; `export_notebook_html` writes the complete output.
128
+ Cell results keep outputs small: text is cut at 4,000 characters, Pluto tree views at 8,000, and images and other binary outputs are replaced by their size with a `body_note`. `read_cell_output` fetches the whole thing — `as: "text"` for markup and long text, `as: "file"` to write it next to the notebook (`<notebook>.assets/<cell_id>.<ext>`; an `output_path` ending in `.png` renders SVG plots to PNG), or `as: "image"` to get a picture; SVG plots and other non-raster values are rendered to PNG inside the notebook. From the CLI, image results are saved to a file (`--out`) rather than printed.
128
129
 
129
130
  Unknown options, options that do not apply to the command, and invalid values are errors (exit code 2). Set `PLUTO_CLI_DEBUG=1` to see stack traces for unexpected failures. Colors follow `NO_COLOR` / `FORCE_COLOR`.
130
131
 
@@ -149,7 +150,8 @@ These tools are callable from the command line via `call`, and exposed to AI ass
149
150
  | `get_notebook_url` | Get the Pluto web UI URL for a notebook |
150
151
  | `list_cells` | List cells with IDs and execution status |
151
152
  | `create_cell` | Create and execute a new cell |
152
- | `read_cell` | Read cell code and output |
153
+ | `read_cell` | Read cell code and output (summarized) |
154
+ | `read_cell_output` | Full output as text, a file, or an image |
153
155
  | `edit_cell` | Update cell code |
154
156
  | `execute_cell` | Run an existing cell |
155
157
  | `delete_cell` | Remove a cell |