Skip to content

Add CLI scripting and repeatable screenshot editing workflows - #7

Open
douglance wants to merge 5 commits into
modem-dev:mainfrom
douglance:main
Open

douglance wants to merge 5 commits into
modem-dev:mainfrom
douglance:main

Conversation

@douglance

@douglance douglance commented Oct 5, 2026 •

Copy link
Copy Markdown

What changed

Adds direct shell commands and durable multi-step automation around Glance's existing native editor API. Users can save repeatable editing workflows, and AI clients can run the same operations through MCP (Model Context Protocol).

  • Script everyday image work: import images, crop or resize them, edit annotations, set framing and animation, and export PNG, GIF, or MP4. JSON output makes document state and results usable from scripts.
  • Keep edits native and editable: the CLI covers all 19 published editor tools, including the shared action dispatcher for toolbar and inspector settings. Edits retain native validation, undo/redo, and revision checks.
  • Compose inspectable workflows: Code Mode accepts multi-step JavaScript programs with async calls and branching. Clients can discover typed operations, inspect persisted execution history, approve pending writes, and cancel programs.
Before                       After
+------------------+         +------------------+
| Desktop / MCP    |         | CLI / MCP / code |
+--------+---------+         +--------+---------+
         |                            |
         v                            v
+------------------+         +------------------+
| Native editor    |         | Native editor    |
+------------------+         +------------------+

For example, after opening the editor with glance desktop --automation:

glance get-document --filter-output revision,width,height
glance resize-image --scale 0.5 --smart=false
glance export-png --path /absolute/new-image.png

The shell command now defaults to the CLI; glance desktop opens the editor. macOS app launches and legacy --cli/desktop flags remain supported, and Linux desktop launchers are updated. Editing and exports require the running, opted-in native editor.

Incurs is the Rust library used here to expose a shared command catalog through the CLI and MCP; no JavaScript build toolchain is added.

Validation

  • Formatting, Clippy, and tests pass: cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings, and cargo test --locked (176 passed, 17 opt-in tests ignored).

  • User-visible changes are recorded under Unreleased in CHANGELOG.md.

  • Usage docs are updated.

  • CLI/MCP smoke checks cover direct commands, both MCP transports, shared execution history, approval/rejection, and CPU-loop cancellation.

  • The routing test catches a deliberate regression to GUI-by-default behavior.

  • Ad-hoc macOS bundle build and bundle/installed command checks pass.

  • Fork CI for the merge resolution is running; local checks above passed.

  • Tokio resolves to 1.53.2 for Glance and Incurs. RustSec audit found no Tokio advisories; Socket's PR check reports no new dependency alerts. Its supply-chain score of 58 is separate from the vulnerability score of 100.

tl;dr: Automate screenshot edits and exports from scripts or AI clients, with native undo and inspectable multi-step workflows.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedtokio@​1.53.1 ⏵ 1.53.25810093100100
Addedrmcp@​3.0.0-beta.589100100100100
Addedfs2@​0.4.310010090100100
Addedincurs@​0.10.392100100100100
Addedincurs-codemode@​0.8.010010093100100
Addedincurs-codemode-local@​0.8.010010093100100
Addedincurs-codemode-mcp@​0.8.010010093100100
Addedrusqlite@​0.37.010010093100100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant