Cli Anything Photoshop logo

Cli Anything Photoshop

CommunityPopular
yb2460
cli-anything-photoshop

通过 COM 自动化操控 Adobe Photoshop 的 CLI harness。支持项目管理、图层操作、选区控制、文字编辑、图像调整和多格式导出。

Overview

Publisheryb2460
Repositoryharness-anything
Skill namecli-anything-photoshop
Stars
1.9K
Forks
115
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by yb2460 on GitHub. Read the source before you install it.

Installation

Install the Cli Anything Photoshop AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yb2460/harness-anything.git /tmp/harness-anything
mkdir -p .claude/skills
cp -r /tmp/harness-anything/photoshop-harness/skills/cli-anything-photoshop .claude/skills/cli-anything-photoshop
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cli Anything Photoshop in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cli Anything Photoshop on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cli Anything Photoshop is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

CLI-Anything Photoshop

通过 Windows COM 自动化接口操控 Adobe Photoshop 的命令行工具。

前置条件

  • Windows 10/11
  • Adobe Photoshop 2023+ (需注册 COM 接口)
  • Python 3.10+pywin32

安装

bash
cd photoshop-harness/agent-harness
pip install -e .

安装后可使用 cli-anything-photoshop 命令。

命令结构

cli-anything-photoshop [--json] [--project <path>] [--dry-run] <command-group> <command> [options]

全局选项

选项描述
--json以 JSON 格式输出(供 AI Agent 解析)
--project <path>自动打开或创建 PSD 项目文件
--dry-run执行命令但不保存到磁盘

命令组

project — 项目管理

命令选项描述
new <path>-w width, -h height, -r resolution, -m mode, -b bg-color创建新 PSD
open <path>打开 PSD 文件
save [path]保存文档
close--no-save关闭文档

document — 文档操作

命令选项描述
info文档信息
resize-w width, -h height, -r resolution调整尺寸
canvas-w width, -h height, -a anchor调整画布
crop--left --top --right --bottom裁切
rotate-a angle旋转画布
flip-d direction翻转画布
mode-m mode更改色彩模式
trim-t type裁切边缘

layer — 图层操作

命令选项描述
add-n name, -t type, -o opacity, -b blend添加图层
delete-n name删除图层
duplicate-n name, --new-name name复制图层
rename--old name, --new name重命名
show / hide-n name显示/隐藏
opacity-n name, -o opacity设置透明度
blend-n name, -m mode设置混合模式
list列出所有图层
reorder-n name, -p position调整顺序
merge-n name, --with-layer name合并图层

selection — 选区操作

命令选项描述
all全选
none取消选区
invert反转选区
feather-r radius羽化
expand-p pixels扩展
contract-p pixels收缩
border-w width边框选区
rect--left --top --right --bottom矩形选区
fill-c color, -o opacity填充选区

text — 文字操作

命令选项描述
add-t text, -f font, -s size, -c color添加文字
edit-n name, -t text, -f font, -s size, -c color编辑文字
info-n name文字信息

export — 导出

命令选项描述
save <path>-f format, -q quality, -w width, -h height导出文件

repl

命令描述
repl启动交互式 REPL 模式

使用示例

AI Agent 用法(--json 模式)

bash
# 创建新项目并获取 JSON 输出
cli-anything-photoshop --json project new -w 800 -h 600 poster.psd

# 添加文字图层
cli-anything-photoshop --json --project poster.psd text add -t "Hello World" -f Arial -s 48 -c "#FF0000"

# 列出所有图层(JSON 格式)
cli-anything-photoshop --json --project poster.psd layer list

# 导出为 PNG
cli-anything-photoshop --json --project poster.psd export save -f png output.png

# 预览(不保存)
cli-anything-photoshop --dry-run --project poster.psd layer add -n "draft" --type text

人工使用

bash
# 打开 PSD,交互编辑
cli-anything-photoshop --project work.psd layer list

# 启动 REPL
cli-anything-photoshop repl

Agent 使用指南

  1. 始终使用 --json 标志 获取结构化输出
  2. 使用 --dry-run 预览,确认后再正式保存
  3. 错误处理:退出码非零时检查 stderr 中的 JSON 错误对象
  4. 项目状态:使用 --project 自动管理文件打开/保存
  5. REPL 模式:适合多步骤交互式操作,减少 Photoshop 进程启动开销

Photoshop COM 架构

CLI 命令 → Click CLI → Core 模块 → ComBridge (单例) → Photoshop.Application COM → Photoshop 引擎

Photoshop 通过 Windows COM 接口暴露全部编辑能力。本 harness 封装了最常用的操作。如需扩展,参考 Adobe Photoshop COM 文档添加新方法到 utils/com_bridge.py

Frequently asked questions

What does the Cli Anything Photoshop AI skill do?

通过 COM 自动化操控 Adobe Photoshop 的 CLI harness。支持项目管理、图层操作、选区控制、文字编辑、图像调整和多格式导出。

Why use Cli Anything Photoshop on TypingMind?

Because you install it once and use it with any model. Cli Anything Photoshop is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cli Anything Photoshop in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yb2460/harness-anything/tree/master/photoshop-harness/skills/cli-anything-photoshop. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Cli Anything Photoshop?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cli Anything Photoshop?

As many as you like. As long as a model supports skills, you can use Cli Anything Photoshop with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cli Anything Photoshop AI skill free?

Yes. It is published on GitHub by yb2460 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇