Communitygithub.com

cli-anything-gimp

一個有狀態的命令列介面,用於影像編輯,基於 Pillow 構建。專為 AI 代理程式與進階使用者設計,無需 GUI 即可建立和操作影像。

cli-anything-gimp 是什麼?

cli-anything-gimp 是一個專為 AI 代理程式與進階使用者設計的命令列影像編輯工具,基於 Pillow 建構,支援無 GUI 環境下的影像操作。它提供完整的專案管理、圖層操作、畫布編輯、濾鏡套用以及繪圖功能,並包含互動式 REPL 模式與群組命令結構。該工具支援雙輸出模式(人類可讀表格與機器可讀 JSON),讓 AI 代理程式能以程式化方式解析回傳結果;同時具備 50 層的復原/重做歷史與專案狀態持久化,適合複雜的合成與自動化工作流程。cli-anything-gimp 也相容於 GIMP 原生批次渲染路徑,但當 GIMP 不可用或存在延遲繪圖操作時,可無縫切換至 Pillow 渲染路徑,確保穩定的輸出結果。

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

在你喜歡的 AI 中提問

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

說明文件

cli-anything-gimp 是做什麼的?

一個有狀態的命令列介面,用於影像編輯,基於 Pillow 構建。專為 AI 代理程式與進階使用者設計,無需 GUI 即可建立和操作影像。

安裝

此 CLI 作為 cli-anything-gimp 套件的一部分安裝:

pip install cli-anything-gimp

前置需求:

  • Python 3.10+
  • 建議安裝 GIMP 以進行原生批次渲染,但當 GIMP 不可用或存在延遲 draw 操作時,仍可透過內建的 Pillow 路徑渲染圖層合成。

用法

基本指令

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

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

# 建立新專案
cli-anything-gimp project new -o project.json

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

REPL 模式

當不帶子指令呼叫時,CLI 會進入互動式 REPL 對話:

cli-anything-gimp
# 使用 Tab 補全與歷史記錄功能,互動輸入指令

指令群組

專案 (Project)

專案管理指令。

指令說明
new建立新專案
open開啟現有專案
save儲存當前專案
info顯示專案資訊
profiles列出可用的畫布設定檔
json列印原始專案 JSON

圖層 (Layer)

圖層管理指令。

指令說明
new建立新的空白圖層
add-from-file從影像檔案新增圖層
list列出所有圖層
remove依索引移除圖層
duplicate複製圖層
move將圖層移動到新位置
set設定圖層屬性(名稱、不透明度、可見性、模式、offset_x、offset_y);負偏移值自然支援
flatten合併所有可見圖層
merge-down將圖層與其下方的圖層合併

畫布 (Canvas)

畫布操作。

指令說明
info顯示畫布資訊
resize調整畫布大小(不縮放內容)
scale等比例縮放畫布與所有內容
crop將畫布裁切為矩形
mode設定畫布色彩模式
dpi設定畫布 DPI

濾鏡群組 (Filter Group)

濾鏡管理指令。

指令說明
list-available列出所有可用的濾鏡
info顯示濾鏡詳細資訊
add將濾鏡新增至圖層
remove依索引移除濾鏡
set設定濾鏡參數
list列出圖層上的濾鏡

媒體 (Media)

媒體檔案操作。

指令說明
probe分析影像檔案
list列出專案中引用的媒體檔案
check檢查所有引用的媒體檔案是否存在
histogram顯示影像的直方圖分析

匯出群組 (Export Group)

匯出/渲染指令。

指令說明
presets列出匯出預設集
preset-info顯示預設集詳細資訊
render將專案渲染為影像檔案;延遲繪圖操作在渲染時套用

工作階段 (Session)

工作階段管理指令。

指令說明
status顯示工作階段狀態
undo復原上一次操作
redo重做上一次復原的操作
history顯示復原歷史

繪圖 (Draw)

繪圖操作(在渲染時套用)。

指令說明
text在圖層上繪製文字(將其轉換為文字圖層)
rect繪製矩形(儲存為繪圖操作)

範例

建立新專案

建立新的 gimp 專案檔案。

cli-anything-gimp project new -o myproject.json
# 或以 JSON 輸出供程式化使用
cli-anything-gimp --json project new -o myproject.json

互動式 REPL 工作階段

啟動支援復原/重做的互動式工作階段。

cli-anything-gimp
# 互動輸入指令
# 使用 'help' 查看可用指令
# 使用 'undo' 和 'redo' 瀏覽歷史

匯出專案

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

cli-anything-gimp --project myproject.json export render output.png --overwrite

圖層合成工作流程

適用於重疊繁重的合成:

cli-anything-gimp --project poster.gimp-cli.json layer set 0 offset_x -48
cli-anything-gimp --project poster.gimp-cli.json layer set 0 offset_y 24
cli-anything-gimp --project poster.gimp-cli.json draw text --layer 0 --text "Launch Night" --x 96 --y 120 --size 72 --color "#f6f1e8"
cli-anything-gimp --project poster.gimp-cli.json export render output.png --overwrite

備註:

  • layer set 現在支援指令模式與 REPL 模式中的負數 offset_x 和 offset_y 值。
  • draw text 和 draw rect 是渲染時的操作。請將匯出的影像(而不只是專案 JSON)視為需要審查的內容。
  • 對於包含延遲繪圖操作的專案,即使已安裝 GIMP,也應預設使用 Pillow 渲染路徑作為穩定預設路徑。

狀態管理

CLI 透過以下方式維護工作階段狀態:

  • 復原/重做:最多 50 層歷史記錄
  • 專案持久化:將專案狀態儲存/載入為 JSON
  • 工作階段追蹤:追蹤修改與變更

輸出格式

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

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

# 代理程式使用的 JSON 輸出
cli-anything-gimp --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.0

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-godot

>-

cli-anything-inkscape

>-

相關技能