Skip to main content

Stateful CLI for machine-embroidery digitization with Ink/Stitch.

Project description

cli-anything-inkstitch

Stateful CLI for machine-embroidery digitization with Ink/Stitch — built so an LLM (or a human at a terminal) can take a vector design from raw SVG to stitchable DST/PES/JEF without leaving the command line.

See SPEC.md for the full technical specification, skills/cli-anything-inkstitch/SKILL.md for agent-facing CLI usage, and skills/embroidery-digitization/SKILL.md for the parameter-decision wisdom that informs which settings to pick.

Install (dev)

pip install -e '.[dev]'

The CLI itself is pure Python (lxml + click + pyembroidery). For binary-backed commands (tools, preview generate, export, validate run/fix) install Ink/Stitch. For raster previews (preview generate --raster, preview rasterize) install Inkscape 1.0+.

Quick start

PROJ=/tmp/logo.inkstitch-cli.json

# Open an SVG into a project, prep it (assigns IDs, inlines CSS-class fills,
# detects Illustrator stroke-to-outline rings)
cli-anything-inkstitch document open --project $PROJ --svg /tmp/logo.svg
cli-anything-inkstitch document prep --project $PROJ --illustrator-rings satin

# Capture material/intent so subsequent param decisions are grounded
cli-anything-inkstitch document set-context --project $PROJ \
    --material "knit cotton t-shirt" --stretch high \
    --thread "40wt polyester" --stabilizer "medium cut-away" \
    --intent "wash-durable team logo"

# Get rich per-element context (size, position, neighbors, color name)
cli-anything-inkstitch --json element describe --project $PROJ

# Set stitch type and parameters
cli-anything-inkstitch params set --project $PROJ --id logo_outline \
    --stitch-type satin_column --pull-compensation-mm 0.4

# Validate and auto-fix what can be fixed
cli-anything-inkstitch --json validate fix --project $PROJ

# Preview the stitch plan as PNG so the LLM (or you) can visually evaluate
cli-anything-inkstitch preview generate --project $PROJ \
    --out /tmp/logo-preview.svg --raster --dpi 200

# Export
cli-anything-inkstitch export file --project $PROJ --format dst --out /tmp/logo.dst

What's in here

Core CLI (Python):

  • document — project & SVG management, prep for Illustrator-exported SVGs, design-intent context capture, palette + thread color enumeration
  • element — list, get, describe (with bbox/position/color/neighbors), classify, delete, clear-params
  • params — set, get, copy, presets — with full inkstitch param-schema validation
  • commands — attach/detach Ink/Stitch visual commands (stops, trims, fill markers)
  • validate — static schema checks, binary-backed troubleshoot run, fix dispatcher (auto + manual suggestions)
  • tools — binary-backed geometry rewrites (auto-satin, auto-run, convert satin↔stroke, cleanup)
  • preview — stitch-plan SVG generation, raster (PNG) output via Inkscape, parsed stats
  • export — single-format file, multi-format ZIP with optional threadlist
  • schema — introspect the inkstitch param schema (extracted from inkstitch source)
  • session — undo / redo / history (50 levels)

Two skills:

  • cli-anything-inkstitch — agent-facing CLI usage: every command, every flag, every output format, agent gotchas.
  • embroidery-digitization — the wisdom layer: per-element decision flow, fabric-specific push/pull comp tables, satin width thresholds, underlay strategies, color/needle ordering, visual failure-mode diagnosis, three full starting recipes.

Status

v0.1 — core surface complete. ~180 tests cover both pure-Python paths and binary-mocked integrations; the binary-backed commands are also live-verified against Ink/Stitch v3.2.2 on macOS.

Out of scope (per SPEC.md §4.12): GUI, Inkscape extension wrapping, lettering UI, real-time machine control.

Tests

pytest          # full suite
pytest -k fix   # one area

License

Apache-2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_anything_inkstitch-0.1.0.tar.gz (100.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_anything_inkstitch-0.1.0-py3-none-any.whl (70.8 kB view details)

Uploaded Python 3

File details

Details for the file cli_anything_inkstitch-0.1.0.tar.gz.

File metadata

  • Download URL: cli_anything_inkstitch-0.1.0.tar.gz
  • Upload date:
  • Size: 100.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cli_anything_inkstitch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af2592df50c8dbb4d687691cdb6913ce44ea0f230561243f81138f04e1752cc3
MD5 d66611569c5fbd3cfc4c53b176b2f826
BLAKE2b-256 26289d23cd234ce5a722ef1229371f140e90456cb6b3f6513ece034495c50f76

See more details on using hashes here.

File details

Details for the file cli_anything_inkstitch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_anything_inkstitch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dde1d72ac55d2d7e55548643496c696868db1bb3f12915b539963d2d1961ba4
MD5 6dcb33ac24e5accf000fd49f10a4a784
BLAKE2b-256 13f1f135401c3bc1e48856e80379f9918e2adbbe9c6246ac305c89bc1082b773

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page