OpenAI Codex CLI 설치와 사용: 로그인과 Git 저장소 첫 코딩 작업
공식 설치, ChatGPT/API 로그인, 저장소의 검토 가능한 첫 diff.
The first hour with OpenAI Codex CLI usually breaks on the installer, PATH, or picking ChatGPT sign-in versus API-key billing. Install from OpenAI’s docs, authenticate, then land one reviewable change in a Git repo you own.
검색어는 OpenAI Codex CLI 설치와 사용이다. This page follows developers.openai.com/codex/cli and the ChatGPT Learn CLI guide at learn.chatgpt.com/docs/codex/cli. It is the local terminal agent—not chatgpt.com/codex in the browser, and not the IDE extension. To walk a diff on a short call, open a room on wbmeet; see how to create and join a room.
Confirm you want the CLI product
OpenAI ships several Codex surfaces: terminal Codex CLI (this page), editor extensions, desktop codex app, and cloud Codex at chatgpt.com/codex. Here you run codex inside a project folder; it reads files, proposes or applies edits, and may run shell commands depending on approval settings.
First hour: install, sign in, change something reviewable
- 1
Install from an official channel
macOS / Linux script:
curl -fsSL https://chatgpt.com/codex/install.sh | sh. All platforms:npm install -g @openai/codex(requires Node.js). On Windows or locked-down machines, download the platform binary from OpenAI’s Codex GitHub releases—details ondevelopers.openai.com/codex/cli. Open a new terminal, thencodex --versionorwhich codex. - 2
Start in the repo and sign in
cdinto a Git repo you own and runcodex. On first launch choose Sign in with ChatGPT (Plus, Pro, Business, Edu, or Enterprise—per OpenAI’s current plan docs). For API billing, create a key on the OpenAI Platform, exportOPENAI_API_KEY, then start Codex. Never commit keys or paste.envinto prompts. - 3
Pick a conservative permission mode
Codex will ask what it may read or execute. On the first run, prefer approvals before shell commands and read diffs before apply. Confirm org policy before sending repository context to OpenAI.
- 4
Give a reviewable first coding task
Ask what the project does and where the entry point lives. Then: “Add a unit test for one untested helper, or input validation on one public function. Show the diff and wait before writing.” Run your tests and
git diffyourself before committing.
# First hour · OpenAI Codex CLI · 2026-10
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# or: npm install -g @openai/codex
codex --version
cd /path/to/your/git/repo
codex
# Sign in with ChatGPT
# first task: unit test for one helper; show diff firstSign-in paths, install channels, pitfalls
| Path | What OpenAI documents | First-hour note |
|---|---|---|
| Sign in with ChatGPT | Plus / Pro / Business plans | Recommended for individuals |
| OPENAI_API_KEY | Platform API billing | Do not commit the key |
| install.sh | macOS / Linux | New terminal before codex |
| npm @openai/codex | Cross-platform | Check Node and PATH |
| chatgpt.com/codex | Cloud Codex Web | Not this CLI |
command not found after install
Usually PATH. Close the old window, open a new terminal. For npm globals, ensure your global bin directory is on PATH.
Running beside Copilot or Claude Code
Multiple terminal agents can coexist—just avoid two agents editing the same tree at once. Compare Copilot CLI and Claude Code.
First task stayed chat-only
Warm up with “what does this repo do,” then finish with a test, validation, or a bug you name—and read the diff.
OpenAI’s flow: run
codexin a project directory, sign in, then complete one real coding task. Plans, regions, and limits follow developers.openai.com and your ChatGPT account page.
- CLI ≠ IDE Codex
- Editor integration is a separate install path; this page covers the
codexterminal binary only. - CLI ≠ Codex Web
- Cloud agent lives at chatgpt.com/codex; the CLI works locally in your checkout.
- Not a meeting-product guide
- Only Codex CLI’s first hour. Short huddle: wbmeet or Cursor CLI notes.
Questions worth checking
Can I use Codex CLI without a paid ChatGPT plan?
OpenAI documents ChatGPT sign-in and a separate API-key path with Platform billing. Whether a free ChatGPT tier includes Codex follows the current plan page—use official signup only.
npm or install.sh?
Both install the codex command. Prefer npm if Node is already set up; macOS/Linux can use install.sh to skip extra tooling.
ChatGPT login vs API key?
ChatGPT sign-in uses subscription entitlements; API keys bill through the OpenAI Platform. Enterprises often standardize on API keys plus org policy.
Must the first task auto-commit Git?
No. Review the diff, run tests, then commit yourself when satisfied.