codexで
- 翻訳ファイル編集
- astroでサイト生成まで一括?
を試したいと思います。
Macにインストール、intel macでも使えるそうです
% node --version v24.3.0 % npm install -g @openai/codex
added 7 packages in 13s
インストールできたようです。起動してみます
$ codex
__+=~~=+=,__
,;=";,_,===||_^*\+,
,,"_+*"~*" `"^"\+*|+_
_|"_*|* _,+|\/*\
_| ,|* _/!_||^*\||\
/`,|' +*';|"/ '\~|\
;|;+| ,* .+*^ ,\|/
|_^/` "";:|", |~"|
|/||;,=;======_,';^^\* / |\
'|^|_" /``____|\ *\"|=\ ,/ ||
\,^\'"""""""*" \,=||,| /\
* ^*/, _/*.|/
\_^*,~_ ,;*`;*'
^,-."~+^;;,:"~"`,/*'
`*+~_!=____|*""
Welcome to Codex, OpenAI's command-line coding agent
Sign in with ChatGPT to use Codex as part of your paid plan
or connect an API key for usage-based billing
> 1. Sign in with ChatGPT
Usage included with Plus, Pro, Business, and Enterprise plans
2. Sign in with Device Code
Sign in from another device with a one-time code
3. Provide your own API key
Pay for what you use
Press enter to continueChatGPTにログインします。enterでブラウザリンクが開き連携できます
Welcome to Codex, OpenAI's command-line coding agent ✓ Signed in with your ChatGPT account Before you start: Decide how much autonomy you want to grant Codex For more details see the Codex docs Codex can make mistakes Review the code it writes and commands it runs Powered by your ChatGPT account Uses your plan's rate limits and training data preferences
Astroで管理しているサイトを編集してみる
リリースノートのファイルjsonに翻訳を追記してもらおうと思います。
プロジェクトルートで codexを起動
You are in ./git/umi-astro Do you trust the contents of this directory? Working with untrusted contents comes with higher risk of prompt injection. Trusting the directory allows project-local config, hooks, and exec policies to load. › 1. Yes, continue 2. No, quit
configを読んでいいか聞かれました。 Yesにしてみます。
>_ OpenAI Codex (v0.137.0) │
│ │
│ model: gpt-5.5 /model to change │
│ directory: ~/git/umi-astro │
╰───────────────────────────────────────╯
Tip: GPT-5.5 is now available in Codex. It's our strongest agentic coding model yet, built to reason through large codebases, check assumptions with tools, and keep going until the work is done.
Learn more: https://openai.com/index/introducing-gpt-5-5/
› Implement {feature}
gpt-5.5 default · ~/git/umi-astro依頼メッセージを送信
› 一旦ui-releases.tsを戻します。section[1]については、入れ替えではなく、1.12.xと1.11の行だけ先頭に追記してください。ほかは同じ編集をお願いします
• 了解です。section[0] の変更はそのまま維持し、section[1].p は元の長い履歴本文に戻した上で、先頭に v1.12.x と v1.11.1 の2行だけを追加する形に直します。まず差分を確認して、戻す範囲を限定します。
• Ran git diff -- src/i18n/ui-releases.ts
└ (no output)
• Ran git status --short
└ ?? cd.html
?? public/images/
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• git status 上は ui-releases.ts に未コミット差分がありません。つまり現在の内容は Git の追跡状態と一致しています。念のため現ファイルの該当構造を見てから、希望どおりの追記方式に編集します。
• Explored
└ Read ui-releases.ts
Search NEEW|NEW: v1.12|v1\.12\.x|v1\.11\.1 in ui-releases.ts
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• 現在は元の長い履歴に戻っている状態です。これから、各ロケールごとに section[0] は NEEW: v1.12.x... と先頭行追加、section[1].p は既存本文を残したまま2行だけ先頭追加します。
• Working (1m 05s • esc to interrupt)依頼を実行するスクリプトを生成して、実行するか確認
Would you like to make the following edits? › 1. Yes, proceed (y) 2. Yes, and don't ask again for these files (a) 3. No, and tell Codex what to do differently (esc)
Yesで実行
• 差分は、各言語で section[0] のタイトル・先頭行と、section[1] 先頭2行の追加に収まっています。構文確認としてビルドを実行します。
• Ran npm run build
└
> umi-astro@0.0.1 prebuild
… +609 lines (ctrl + t to view transcript)
00:02:46 [build] Complete!
✅ Successfully generated .htaccess in ./dist/api/v1
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• 完了しました。
src/i18n/ui-releases.ts を修正し、全ロケールで以下の形にしました。
- section[0].title: NEEW: v1.12.x... に変更
- section[0].p: v1.12.x... の1行を先頭に追加
- section[1].p: 既存の履歴本文は残したまま、先頭に v1.12.x... と v1.11.1... の2行だけ追加
npm run build も成功しています。未追跡の cd.html と public/images/ は既存のまま触っていません。buidまで通して確認してくれました。
ただのテキスト変換なので、簡単に終わりました。
画像処理のpythonなどスクリプト系はなんの問題もなく使えると思います◎
無料枠は厳しい。。。/status
/status ╭────────────────────────────────────────────────────────────────────────────────╮ │ >_ OpenAI Codex (v0.137.0) │ │ │ │ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ │ information on rate limits and credits │ │ │ │ Model: gpt-5.5 (reasoning medium, summaries auto) │ │ Directory: ~/git/umi-astro │ │ Permissions: Workspace (Ask for approval) │ │ Agents.md: <none> │ │ Account: abc (Free) │ │ Collaboration mode: Default │ │ Session: 019ea287- │ │ │ │ Context window: 46% left (144K used / 258K) │ │ Monthly limit: [█████░░░░░░░░░░░░░░░] 25% left (resets 23:45 on 7 Jul) │ ╰────────────────────────────────────────────────────────────────────────────────╯
ちょっと使っただけで 1か月分の75%使ったようです。。。
全部やってくれるので便利ですが消費量を抑えるには、AGENT.mdに
# AGENTS.md Rules: - Do not run build unless explicitly requested. - Do not run tests unless explicitly requested. - For translation updates, edit only translation files. - Show changed files before making unrelated changes.
といれておくと npm run buildしてエラーチェックなどしなくなるので良いようです。
buildするとメッセージをすべてチェックするのでそれなりに消費してしまうようです。
Codexの終了と再開
/exitで終了
To continue this session, run codex resume 019ea287—–
と表示されるので
codex resume 019ea287----- で再開すると続きが使えるようです。
codex resume --last ( ただし最後のセッションなので、IDを指定したほうが良い
/exit でcodex終了すると、利用トークンが表示されます。
input=372,963は 翻訳テキストだけじゃなくてログ解析などが大きい可能性が高い。と
こんな作業で75%使い切ってしまうのか?というところです
Token usage: total=393,403 input=372,963 (+ 2,505,088 cached) output=20,440 (reasoning 3,537) To continue this session, run codex resume 01234567-SESSION-ID
料金体系と無料枠について
2026.06時点
- 無料版
- Go 1,400円/月
- Plus 3,000円/月
- Pro 16,800 円/月
という内容で、無料版でどれくらいになるかをチェックする必要がありますね
記事制作など文字をたくさん使う部分は ChatGPTで行うとほとんど無料ですが
codex内ですべて行うと都度使用量を消費してしまいます。
開発で言うと、ビルド、テストなどすべてのログを解析するのでそれも消費対象です。
扱うデータが多いだけで簡単な処理でも消費してすぐ無料枠がなくなってしまいます。
- 文章作成、整理、翻訳
- コード生成、コード修正
どれも単発で十分対応できるものです、単発で処理できるものはGhatGPTで対応できるので。
どこまでcodexを利用するのかが難しいところです、切り分けできない場合は、codexで処理してしまうのが楽だとは思います。Plusでどれくらい使用できるかわからないのでなんとも言えませんが、一ヶ月使ってみて検討するしかないですかね
とても楽であることは間違いないので有料利用も価値はあると思います。
省エネ依頼をchatGPTに相談
Create a new "scenes" section by copying: * src/pages/[...lang]/how-to-use * src/i18n/how-to-use Requirements: * Use the same structure, routing, localization, and data organization. * Create: * src/pages/[...lang]/scenes/index.astro * src/pages/[...lang]/scenes/[slug]/index.astro * src/i18n/scenes/index.ts * src/i18n/scenes/data/* * Rename references from how-to-use to scenes where appropriate. * Create only ONE minimal sample scene article. * Reuse existing patterns and types whenever possible. * Do not run build. * Do not run tests. * Show the list of modified files before applying changes.
こんな感じで依頼してみました。
既存構成のカテゴリーを新カテゴリーで再構成依頼(コピー)なので手動でもそこまでではないですが
継続したら簡単な処理で終わってしまいました^^;
╭───────────────────────────────────────────────────────────────────────────────╮ │ >_ OpenAI Codex (v0.137.0) │ │ │ │ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ │ information on rate limits and credits │ │ │ │ Model: gpt-5.4-mini (reasoning medium, summaries auto) │ │ Directory: ~/git/umi-astro │ │ Permissions: Workspace (Ask for approval) │ │ Agents.md: <none> │ │ Account: @gmail.com (Free) │ │ Collaboration mode: Default │ │ Session: 019ea287- │ │ │ │ Context window: 39% left (163K used / 258K) │ │ Monthly limit: [░░░░░░░░░░░░░░░░░░░░] 0% left (resets 23:45 on 7 Jul) │ │ premium limit: │ ╰───────────────────────────────────────────────────────────────────────────────╯ Token usage: total=554,626 input=528,628 (+ 3,725,056 cached) output=25,998 (reasoning 4,034)



コメント