sketchi 0.4.3 → 0.6.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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <strong>Typed, deterministic diagrams from your terminal.</strong><br />
9
- Create, inspect, revise, and export local flowcharts and mindmaps—or turn one prompt into validated, editable Excalidraw.
9
+ Create, inspect, revise, and export local flowcharts, mindmaps, and sequence diagrams—or turn one prompt into validated, editable Excalidraw.
10
10
  </p>
11
11
 
12
12
  <p align="center">
@@ -17,7 +17,7 @@
17
17
 
18
18
  Sketchi stores canonical diagram documents and authoritative Excalidraw artifacts
19
19
  under `~/.sketchi/diagrams`. Its manual and recovery workflows stay local;
20
- generation and encrypted snapshot exchange are explicit, credential-free network
20
+ generation, Universal Canvas compilation, and encrypted snapshot exchange are explicit, credential-free network
21
21
  commands.
22
22
 
23
23
  ## Install
@@ -53,7 +53,7 @@ sketchi generate --prompt "Map release approval with pass and revise branches"
53
53
 
54
54
  With no `--prompt`, Sketchi opens a short wizard only when both standard input
55
55
  and standard output are human terminals, output is text, and CI is absent. It
56
- asks for prompt text, flowchart (the default) or mind map, and where to save the
56
+ asks for prompt text, flowchart (the default), mind map, or sequence diagram, and where to save the
57
57
  PNG. The choices are the current directory, a `diagrams/` folder under exactly
58
58
  the directory where Sketchi was run, or a custom path with the same semantics as
59
59
  `--dest`. Sketchi does not inspect Git, and it creates `diagrams/` only after
@@ -64,12 +64,18 @@ that wizard question. Explicit `--format png` may proceed; another format or
64
64
  Scripts, pipes, redirected streams, CI, and `--output json` never prompt or
65
65
  block. They must pass `--prompt`; omitting it retains the deterministic usage
66
66
  error. Passing `--prompt` is always direct and noninteractive.
67
+ Without `--type`, the generation model selects flowchart, mindmap, or sequence
68
+ from the request. An explicit supported `--type` remains authoritative.
69
+ Explicit ER, architecture, swimlane, and state-machine requests return a typed
70
+ unsupported-type error instead of being coerced into a flowchart.
67
71
 
68
72
  The PNG is rendered locally from the returned validated artifacts and is not
69
73
  written back into the record. Choose another artifact or destination explicitly:
70
74
 
71
75
  ```sh
72
76
  sketchi generate --prompt "Organize launch readiness" --type mindmap --format excalidraw --dest launch.excalidraw
77
+
78
+ sketchi generate --prompt "Show Browser calling API and API returning success" --type sequence --dest request-sequence.png
73
79
  sketchi generate --prompt "Map release approval" --dest - > release.png
74
80
  sketchi generate --prompt "Map release approval" --output json
75
81
  ```
@@ -77,7 +83,27 @@ sketchi generate --prompt "Map release approval" --output json
77
83
  `--format` accepts `png`, `excalidraw`, or `scene`; their default names are
78
84
  `<id>.png`, `<id>.excalidraw`, and `<id>.scene.json`. With `--dest -`, stdout
79
85
  contains artifact bytes only and the text or JSON status envelope moves to
80
- stderr. Generation, sharing, and pulling are the CLI's three network commands.
86
+ stderr. Generation, Universal Canvas compilation, sharing, and pulling are the CLI's four network commands.
87
+
88
+ ## Build a Universal CanvasSpec
89
+
90
+ `canvas` sends an already-authored, typed CanvasSpec to Sketchi's public
91
+ create-canvas API, validates the response, preserves the normalized scene and
92
+ editable Excalidraw artifact in the local store, and exports PNG by default:
93
+
94
+ ```sh
95
+ sketchi canvas --file canvas.json --output json
96
+ printf '%s' "$CANVAS_SPEC" | sketchi canvas --file - --format excalidraw --dest canvas.excalidraw
97
+ ```
98
+
99
+ The input is the CanvasSpec object itself—not a request wrapper and not raw
100
+ Excalidraw JSON. The command never prompts, so files and piped stdin are safe for
101
+ agents and scripts. `--format` and `--dest` have the same behavior as `generate`.
102
+ The endpoint defaults to
103
+ `https://playground.sketchi.app/api/v1/canvases/create`; use `--endpoint URL` or
104
+ `SKETCHI_CANVAS_ENDPOINT` only for preview and local testing. The existing
105
+ `create` command remains the separate, strictly offline command for accepted
106
+ flowchart, mindmap, and sequence documents.
81
107
 
82
108
  ## Create and work with a diagram offline
83
109
 
@@ -253,7 +279,7 @@ to human text TTYs and is never enabled by JSON output, pipes, redirects, or CI.
253
279
  After exporting PNG to a file, agents can follow the returned hint to display
254
280
  that path as an inline Markdown image for the user.
255
281
 
256
- `generate`, `share`, and `pull` are deliberately separate, explicit network
282
+ `generate`, `canvas`, `share`, and `pull` are deliberately separate, explicit network
257
283
  commands. They remain credential-free and each makes one HTTPS request. Share
258
284
  is randomized by its key and IV; pull depends on remote availability and
259
285
  untrusted input, so neither belongs to determinism claims.
@@ -273,6 +299,7 @@ sketchi docs
273
299
  sketchi create --help
274
300
  sketchi patch --help
275
301
  sketchi generate --help
302
+ sketchi canvas --help
276
303
  sketchi share --help
277
304
  sketchi pull --help
278
305
  sketchi restore --help