Codex Imagegen Via Chatgpt Oauthのロゴ

Codex Imagegen Via Chatgpt Oauth

コミュニティ
madrobotnet
codex-imagegen-via-chatgpt-oauth

Use a separate Codex CLI instance logged in via ChatGPT / OpenAI Codex OAuth to generate an image with Codex's built-in imagegen skill, then verify the saved PNG from ~/.codex/generated_images.

概要

公開者madrobotnet
リポジトリhermes-codex-imagegen-skill
スキル名codex-imagegen-via-chatgpt-oauth
スター
29
フォーク
1
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    madrobotnetがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Codex Imagegen Via Chatgpt Oauth」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/madrobotnet/hermes-codex-imagegen-skill/tree/main
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/madrobotnet/hermes-codex-imagegen-skill.git \
  .claude/skills/codex-imagegen-via-chatgpt-oauth
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCodex Imagegen Via Chatgpt Oauthを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCodex Imagegen Via Chatgpt Oauthを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Codex Imagegen Via Chatgpt Oauthは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Codex image generation via ChatGPT OAuth

Use this when Hermes' own image_generate tool is unavailable because FAL or the Nous Tool Gateway is not configured, but the machine has a working Codex CLI session authenticated through ChatGPT / OpenAI Codex OAuth.

What this is

This is a workaround through a separate Codex process.

It does not rewire Hermes' native image_generate tool to use Codex or the OpenAI Images API directly.

Preconditions

  1. codex is installed and on PATH
  2. codex login status returns a live ChatGPT login, for example Logged in using ChatGPT
  3. You accept that generated files land under ~/.codex/generated_images/<session_id>/...

Required checks

Run these first:

bash
which codex && codex --version
codex login status
codex exec --help | head -n 40

Why:

  • confirms Codex is really installed
  • confirms OAuth is actually live
  • confirms the local CLI supports exec, --skip-git-repo-check, and sandbox flags

Core workflow

1. Create a temp workspace

bash
TMP=$(mktemp -d /tmp/codex-image-XXXXXX)

2. Run Codex non-interactively

Use --skip-git-repo-check because image generation does not need a repository. Use --ephemeral so you do not leave extra Codex session state behind. Use -o "$TMP/last.txt" so the final assistant message is saved locally too.

bash
codex exec \
  --skip-git-repo-check \
  --ephemeral \
  --sandbox workspace-write \
  -C "$TMP" \
  -o "$TMP/last.txt" \
  'You are testing whether image generation is available. Generate an image of "<user request>". If possible, save the resulting image to a file or leave a URL. If that is not possible, explain exactly why. In your final answer, respond in the user\'s language and include the success or failure status plus the output path or URL.'

3. Capture the session id from stdout

Codex prints a line like:

text
session id: 019db2a7-8461-7251-9281-46a7606caade

Keep that id.

4. Verify the actual PNG outside Codex

Do not rely only on Codex's self-report. Verify from Hermes side by searching ~/.codex/generated_images/.

Preferred:

text
search_files(target='files', path='~/.codex/generated_images/<session_id>', pattern='*')

Broad fallback if the session id was missed:

text
search_files(target='files', path='~/.codex/generated_images', pattern='*.png', limit=20)

5. Optionally inspect the image

Use vision_analyze to quickly check whether the output actually matches the prompt before presenting it.

Recommended Hermes tool sequence

  1. terminal — verify Codex install and login, then run codex exec
  2. search_files — confirm the generated file exists
  3. vision_analyze — sanity-check prompt fit

Known pitfall

Codex may show sandbox or bubblewrap errors like:

text
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted

This can happen after the image was already generated, when Codex tries to inspect files inside its own sandbox.

Do not treat that message as proof of generation failure.

Instead:

  • verify the real output from Hermes side
  • search ~/.codex/generated_images/
  • trust actual file existence over Codex's post-generation introspection errors

Good prompt wrapper

Use a wrapper that forces Codex to explicitly report success or failure and leave a path or URL:

text
Generate an image of "<scene>". If possible, save the resulting image to a file or leave a URL. If that is not possible, explain exactly why. In your final answer, respond in the user's language and include the success or failure status plus the output path or URL.

Example used successfully

User request:

text
A view of Sangam-dong, Seoul at 7 PM

Observed file pattern:

text
~/.codex/generated_images/<session_id>/ig_<hash>.png

If the image must live in the current project

Codex normally writes into ~/.codex/generated_images/.... If the result should become a real project asset, copy it into the workspace after verification.

Example:

bash
cp ~/.codex/generated_images/<session_id>/ig_<hash>.png ./public/images/

Do not leave a project-referenced asset only inside ~/.codex/generated_images/.

Verification checklist

  • Codex installed
  • ChatGPT login active
  • codex exec exits successfully
  • PNG exists under ~/.codex/generated_images
  • optional: visual inspection says the image roughly matches the request

When not to use

Do not use this workflow when:

  • the user expects this to change Hermes' native image backend
  • Codex is not logged in
  • the output must land in a deterministic path without a follow-up copy step
  • the task requires a repeatable official API workflow rather than a tool-side workaround

よくある質問

AIスキル「Codex Imagegen Via Chatgpt Oauth」では何ができますか?

Use a separate Codex CLI instance logged in via ChatGPT / OpenAI Codex OAuth to generate an image with Codex's built-in imagegen skill, then verify the saved PNG from ~/.codex/generated_images.

TypingMindでCodex Imagegen Via Chatgpt Oauthを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Codex Imagegen Via Chatgpt Oauthはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCodex Imagegen Via Chatgpt Oauthをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/madrobotnet/hermes-codex-imagegen-skill/tree/mainを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Codex Imagegen Via Chatgpt Oauthを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Codex Imagegen Via Chatgpt Oauthで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCodex Imagegen Via Chatgpt Oauthを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Codex Imagegen Via Chatgpt Oauth」は無料ですか?

はい。madrobotnetがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇