
dshark3y/gpt-image-2-skill
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
OpenAIのgpt-image-2で画像を生成および編集するためのClaudeコードスキル
概要
OpenAI の gpt-image-2 Image API で画像の生成と編集を行うための、小さなスクリプトファーストの Agent スキルです。 リポジトリは CLI コードを維持しているため、エージェントは API 呼び出しを発明するのではなく、操作を選択し、フラグを渡します。 配布可能なスキルは含まれています。 生産のランタイム:4つの集中されたPythonファイル。 uv は、最初の使用時にピン留めされた OpenAI SDK を解決します。 - Python 3.10 または newer - uv - gpt-image-2 へのアクセスを持つ OpenAI API キー - 実行時間からの API ネットワークアクセス OpenAIは、GPTイメージモデルのAPI組織認証を必要とする場合があります。 CI、ホストされたシェル、および既存のOpenAIセットアップに優先されます。 相互ローカル機械のために便利: 2 番目のコマンドは、端末の入力を非表示にし、ユーザ所有のオペレーティングシステム config ディレクトリにあるキーを POSIX のオーナー専用の権限で保存します。 決して gpt-image/ に書き込むことはないので、そのスキルを再パッケージ化または更新することは、設定されたキーを含むことができません。 削除:
概要(AI 翻訳)
OpenAIの[[gpt-image-2を介して画像を生成および編集するための小さなスクリプト優先エージェントスキル] イメージ API
リポジトリは CLI コードを維持しているため、エージェントは API 呼び出しを発明するのではなく、操作を選択し、フラグを渡します。 配布可能なスキルには、no API キー、[.env]、生成されたイメージ、または依存キャッシュが含まれています。
含まれているもの
生産のランタイム: 4 つの焦点を絞った Python ファイル。 [uv]] は、最初に使用した OpenAI SDK を解決します。
要件
- Python 3.10 以降
- [
uv - [
gpt-image-2にアクセスできるOpenAI APIキー - 実行時間からの API ネットワークアクセス
OpenAIは、GPTイメージモデルのAPI組織認証を必要とする場合があります。
スキルを変更することなく構成する
CI、ホストされたシェル、および既存のOpenAIセットアップに優先されます。
相互ローカル機械のために便利:
2 番目のコマンドは、端末の入力を非表示にし、ユーザ所有のオペレーティングシステム config ディレクトリにあるキーを POSIX のオーナー専用の権限で保存します。 gpt-image/ に書き込むことはないため、設定されたキーを含むスキルを再パッケージ化または更新することはできません。 削除:
[SKILL.md]、[.env]]に、スクリプト、プロンプト、またはアーカイブの横にあるファイルを入力しないでください.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
GPT Image 2 skill
A small, script-first Agent Skill for generating and editing images through OpenAI’s gpt-image-2 Image API.
The repository ships maintained CLI code so an agent chooses an operation and passes flags instead of inventing an API call. The distributable skill contains no API key, .env, generated image, or dependency cache.
What is included
gpt-image/
├── SKILL.md
├── agents/openai.yaml
├── references/prompting-guide.md
└── scripts/
├── _common.py
├── configure.py
├── edit.py
└── generate.py
Production runtime: four focused Python files. uv resolves the pinned OpenAI SDK on first use.
Requirements
- Python 3.10 or newer
uv- An OpenAI API key with access to
gpt-image-2 - API network access from the runtime
OpenAI may require API organization verification for GPT Image models.
Configure without modifying the skill
Preferred for CI, hosted shells, and existing OpenAI setups:
export OPENAI_API_KEY="your-key"
Convenient for an interactive local machine:
python gpt-image/scripts/configure.py
The second command hides terminal input and stores the key in a user-owned operating-system config directory with owner-only permissions on POSIX. It never writes into gpt-image/, so repackaging or updating the skill cannot include the configured key. Remove it with:
python gpt-image/scripts/configure.py --remove
Do not put credentials in SKILL.md, .env files beside the scripts, prompts, or archives. In a hosted environment, the host must inject OPENAI_API_KEY; a skill upload cannot do that for you.
Run directly
Generate:
uv run --script gpt-image/scripts/generate.py \
--prompt "A vintage 1960s travel poster for Kyoto in autumn" \
--size 1024x1536 \
--quality high \
--output kyoto.png
Edit:
uv run --script gpt-image/scripts/edit.py \
--prompt "Replace the sky with a thunderstorm; preserve everything else" \
--images photo.jpg \
--output photo-stormy.png
Composite:
uv run --script gpt-image/scripts/edit.py \
--prompt "Place the dog from Image 2 next to the person in Image 1; match scale and light" \
--images scene.png dog.png \
--output composite.png
Run either script with --help for the complete, current CLI. Existing output files are protected unless --force is supplied.
Install as a local skill
Clone the repository, then copy or link the gpt-image/ directory itself into the skill directory used by your agent. The required layout is /gpt-image/SKILL.md; cloning the whole repository directly to that path leaves the manifest one level too deep.
For example:
git clone https://github.com/dshark3y/gpt-image-2-skill.git
mkdir -p ~/.claude/skills
cp -R gpt-image-2-skill/gpt-image ~/.claude/skills/gpt-image
Restart or reload the agent after installing.
Build a clean archive
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add dshark3y/gpt-image-2-skill