Communitygithub.com

cli-anything-inkscape

CLI-Anything 的 Inkscape 插件,提供帶有狀態追蹤的向量圖形編輯命令列介面。

cli-anything-inkscape 是什麼?

`cli-anything-inkscape` 是一個基於命令列的向量圖形編輯工具,遵循與 GIMP 及 Blender CLI 相同的設計模式。它直接操作 SVG (XML) 文件,並使用 JSON 專案格式來追蹤編輯狀態,非常適合需要可重複、可腳本化圖形設計流程的開發者與 AI 代理。 此技能支援多種操作,包括文件管理、形狀新增與編輯、文字處理(支援文字方塊自動換行)、樣式設定、變形、圖層管理、路徑布林運算、漸層管理以及匯出為 PNG、SVG、PDF 等格式。它提供互動式 REPL 模式與可直接解析的 `--json` 輸出,讓 AI 代理能輕鬆整合。 透過 `pip install cli-anything-inkscape` 安裝,並需確保系統已安裝 Inkscape。主要功能涵蓋了從建立專案、設計元素、到最終匯出的完整向量圖形工作流程。

相容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-inkscape

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

cli-anything-inkscape 是做什麼的?

一個具有狀態追蹤的向量圖形編輯命令列介面,遵循與 GIMP 及 Blender CLI 相同的設計模式。它直接操作 SVG (XML) 文件,並使用 JSON 專案格式來追蹤狀態。

安裝

此命令列工具作為 cli-anything-inkscape 套件的一部分進行安裝:

pip install cli-anything-inkscape

前置需求:

  • Python 3.10+
  • 系統必須安裝 Inkscape

使用方式

基本指令

# 顯示說明
cli-anything-inkscape --help

# 啟動互動式 REPL 模式
cli-anything-inkscape

# 建立新文件
cli-anything-inkscape document new -o project.json

# 以 JSON 輸出執行(供代理程式使用)
cli-anything-inkscape --json document info -p project.json

REPL 模式

當未指定子指令時,CLI 會進入互動式 REPL 會話:

cli-anything-inkscape
# 以互動方式輸入指令,支援 Tab 補全與指令歷史

你也可以使用不存在的專案路徑來啟動 REPL。CLI 現在會直接建立一個新的記憶體文件,而非立即失敗:

cli-anything-inkscape --project /abs/path/new-title.inkscape-cli.json

指令群組

文件

文件管理指令。

指令說明
new建立新文件
open開啟現有專案
save儲存目前專案
info顯示文件資訊
profiles列出可用的文件設定檔
canvas-size設定畫布大小
units設定文件單位
json輸出原始專案 JSON

形狀

形狀管理指令。

指令說明
add-rect新增矩形
add-circle新增圓形
add-ellipse新增橢圓形
add-line新增線條
add-polygon新增多邊形
add-path新增路徑
add-star新增星形
remove依索引移除形狀
duplicate複製形狀
list列出所有形狀/物件
get取得某個形狀的詳細資訊

文字

文字管理指令。

指令說明
add新增文字元素;支援 --box-width、--box-height 與 --line-height 以實現自動換行佈局
set設定文字屬性(文字內容、字型、字型大小、填色、框寬、框高、行高等)
list列出所有文字物件

樣式

樣式管理指令。

指令說明
set-fill設定物件的填滿顏色
set-stroke設定物件的描邊顏色(及可選的寬度)
set-opacity設定物件的不透明度(0.0-1.0)
set設定物件的任意樣式屬性
get取得物件的樣式屬性
list-properties列出所有可用的樣式屬性

變形

變形操作(平移、旋轉、縮放、傾斜)。

指令說明
translate平移(移動)物件
rotate旋轉物件
scale縮放物件
skew-x水平傾斜物件
skew-y垂直傾斜物件
get取得物件的目前變形
clear清除物件的所有變形

圖層

圖層管理指令。

指令說明
add新增圖層
remove依索引移除圖層
move-object將物件移動到不同圖層
set設定圖層屬性(名稱、可見性、鎖定狀態、不透明度)
list列出所有圖層
reorder將圖層從某個位置移動到另一個位置
get取得圖層的詳細資訊

路徑群組

路徑布林運算。

指令說明
union兩個物件的聯集
intersection兩個物件的交集
difference兩個物件的差集(A 減去 B)
exclusion兩個物件的互斥或(XOR)
convert將形狀轉換為路徑
list-operations列出可用的路徑布林運算

漸層

漸層管理指令。

指令說明
add-linear新增線性漸層
add-radial新增放射狀漸層
apply將漸層套用至物件
list列出所有漸層

匯出群組

匯出/渲染指令。

指令說明
png將文件渲染為 PNG
svg將文件匯出為 SVG
pdf將文件匯出為 PDF(需安裝 Inkscape)
presets列出匯出預設集

會話

會話管理指令。

指令說明
status顯示會話狀態
undo復原上一個操作
redo重做上一個復原的操作
history顯示復原歷史記錄

範例

建立新專案

建立一個新的 Inkscape 專案檔案。

cli-anything-inkscape document new -o myproject.json
# 或使用 JSON 輸出以利程式化使用
cli-anything-inkscape --json document new -o myproject.json

互動式 REPL 會話

啟動一個支援復原/重做的互動式會話。

cli-anything-inkscape
# 以互動方式輸入指令
# 使用 'help' 查看可用指令
# 使用 'undo' 和 'redo' 進行歷史記錄導覽

匯出專案

將專案匯出為最終輸出格式。

cli-anything-inkscape --project myproject.json export pdf output.pdf --overwrite

包圍文字的版面配置

對於標題卡、標籤和直式安全面板,建議使用自動換行的文字框,而不是手動插入換行符號:

cli-anything-inkscape --project title.json text add \
  --text "Real capture + Veo cold open + Gemini score + thumbnail plate" \
  --x 180 --y 470 --font-size 118 \
  --box-width 1180 --box-height 260 --line-height 1.05

cli-anything-inkscape --project title.json text set 0 box-width 980
cli-anything-inkscape --project title.json text set 0 line-height 1.15

注意事項:

  • box-width 會將較長的文字內容自動換行,匯出為多行 SVG tspan。
  • box-height 可讓較長的文字安全地失敗,而不是跑出畫布。
  • 在需要手動換行之前,建議優先使用文字框來處理較長文字的圖形。

狀態管理

CLI 會維護會話狀態,包含:

  • 復原/重做:最多 50 層的歷史記錄
  • 專案持久化:以 JSON 格式儲存/載入專案狀態
  • 會話追蹤:追蹤修改與變更

輸出格式

所有指令皆支援雙重輸出模式:

  • 人類可讀(預設):表格、顏色、格式化文字
  • 機器可讀(--json 標記):結構化 JSON,供代理程式使用
# 人類可讀輸出
cli-anything-inkscape project info -p project.json

# 供代理程式使用的 JSON 輸出
cli-anything-inkscape --json project info -p project.json

給 AI 代理的提示

當以程式化方式使用此 CLI 時:

  1. 務必使用 --json 標記 以取得可解析的輸出
  2. 檢查回傳碼 - 0 代表成功,非零代表錯誤
  3. 解析 stderr 以取得失敗時的錯誤訊息
  4. 對所有檔案操作使用絕對路徑
  5. 匯出操作後,務必確認輸出檔案存在
  6. 優先使用文字框 來處理標題和可變長度的文字,以確保版面在編輯過程中保持穩定

更多資訊

  • 完整文件:請參閱套件中的 README.md
  • 測試涵蓋率:請參閱套件中的 TEST.md
  • 方法論:請參閱 cli-anything-plugin 中的 HARNESS.md

版本

1.0.1

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相關技能