Skip to content
Close Menu

    Subscribe to Updates

    Get the latest news from tastytech.

    What's Hot

    How to Install Codex CLI: A Step-by-Step Setup Guide

    August 15, 2026

    NSX Distributed Firewall as a Security Customs Network: A Practical Mental Model for East-West Zero Trust

    August 15, 2026

    UGREEN Nexode Pro 300W Desktop Review: A Powerful Charger

    August 15, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    tastytech.intastytech.in
    Subscribe
    • AI News & Trends
    • Tech News
    • AI Tools
    • Business & Startups
    • Guides & Tutorials
    • Tech Reviews
    • Automobiles
    • Gaming
    • movies
    tastytech.intastytech.in
    Home»Business & Startups»How to Install Codex CLI: A Step-by-Step Setup Guide
    How to Install Codex CLI: A Step-by-Step Setup Guide
    Business & Startups

    How to Install Codex CLI: A Step-by-Step Setup Guide

    gvfx00@gmail.comBy gvfx00@gmail.comAugust 15, 2026No Comments6 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    If you have already used Codex in ChatGPT, the Codex CLI will feel familiar. It brings the same AI assistance directly into your local development environment, where it can work with your repository, shell, tests, and other tools.

    Installation takes only one command, but the setup choices that follow are worth reviewing carefully. In this article, you’ll learn how to install Codex CLI on Windows, macOS, and Linux and complete a clean first-time setup.

    Table of Contents

    Toggle
    • Before You Install
    • Installation
      • 1. Run the installer
        • macOS and Linux
        • Windows PowerShell
        • Alternative install methods
    • First Run
      • 2. Open a project folder
      • 3. Choose how to sign in
      • 4. Authorize Codex in the browser
      • 5. Review the first-run notice
      • 6. Trust the right folder
      • 7. Configure the Windows sandbox
      • 8. Send a safe first prompt
    • Useful Commands After Setup
    • Updating Codex CLI
    • Conclusion
        • Login to continue reading and enjoy expert-curated content.
      • Related posts:
    • 6 Steps to Crack GenAI Case Study Interviews
    • I Tested Clawdbot and Built My Own Local AI Agent
    • 5 Essential Approaches to Robust Outlier Detection

    Before You Install

    Use the standalone installer if you do not already manage developer tools through Homebrew or npm.

    • Windows: PowerShell on a supported Windows system. WSL2 is optional.
    • macOS or Linux: A terminal with curl available.
    • Account: A ChatGPT account or an OpenAI Platform API key.
    • Workspace: A project folder you own and trust.

    Installation

    1. Run the installer

    Open a terminal. Next, run the command for your operating system.

    macOS and Linux

    curl -fsSL https://chatgpt.com/codex/install.sh | sh

    Windows PowerShell

    powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

    You can also run this via CMD. It executes the PowerShell command.

    Windows PowerShell showing Codex CLI installed successfully and added to PATH.

    The Windows installer adds Codex to your PATH; consequently, it is ready for use. It also offers to launch the application.

    Note: If the installer asks to start Codex immediately, press N. Do this unless the terminal is already inside a project folder.

    Alternative install methods

    Do you prefer a package manager? Use one of these options instead:

    # Homebrew
    brew install --cask codex
    
    # npm
    npm install -g @openai/codex

    Similarly, Homebrew is suitable for a Brew-managed Mac setup. Use npm if Node.js already manages your global developer tools.

    First Run

    2. Open a project folder

    Move into the repository where you want Codex to work. Then, launch it.

    # Windows PowerShell
    cd C:\Users\you\code\my-project
    codex
    
    # macOS or Linux
    cd ~/code/my-project
    codex

    Codex treats the current directory as its starting workspace. By default the System32 directory would be the default one.

    3. Choose how to sign in

    The first launch offers three sign-in routes:

    • Sign in with ChatGPT: Uses the Codex allowance from your ChatGPT plan.
    • Sign in with Device Code: Best for SSH, containers, or machines without a browser callback.
    • Provide your own API key: Usage is billed through the OpenAI Platform account linked to that key.
    Codex CLI first-run menu with ChatGPT, device code, and API key authentication options.

    OpenAI’s current Codex pricing page lists Free, Go, Plus, Pro, Business, Edu, and Enterprise plans. API-key usage is billed separately. On the other hand, usage in a subscription is shared between the web app and Codex.

    4. Authorize Codex in the browser

    If you choose ChatGPT, Codex prints an authentication URL. It also opens this URL in your browser. If the browser does not open, copy and paste the URL yourself.

    PowerShell showing the Codex browser authentication handoff with the sensitive OAuth URL strongly blurred.
    Codex prints the browser sign-in URL in the terminal.

    Next, sign in to the browser using the ChatGPT account you want Codex to use.

    ChatGPT sign-in screen opened by the Codex CLI browser authentication flow.

    Check the account on the confirmation screen before you continue.

    ChatGPT account confirmation screen with the user's email address strongly blurred.

    As a result, when the browser shows the success page, close the tab. Then, return to the terminal.

    Browser page confirming that the user has signed in to Codex.

    5. Review the first-run notice

    Back in the terminal, Codex confirms your account. It also reminds you that autonomy is a choice. Do not ignore this notice. Press Enter after you read it.

    Codex command-line agent autonomy settings
    Codex confirms the ChatGPT login and asks you to review its autonomy settings

    You can inspect or change the active boundary later. Use the /permissions command to do this.

    6. Trust the right folder

    Codex now prints the directory it is about to trust. Read the path carefully. Do not just look at the highlighted option.

    Directory trust prompt for Codex
    Don’t use System32 as default directory (this is a VM for demonstration)

    Trust allows project-local configuration, hooks, and execution policies to load. If the path is wrong, quit the program. Move into the correct repository and run codex again.

    7. Configure the Windows sandbox

    On native Windows, Codex may ask how to create its sandbox. Choose the default sandbox if you can approve the administrator prompt.

    Codex sandbox configuration options
    The default Windows sandbox is the preferred option

    OpenAI’s Windows sandbox documentation calls the elevated mode the preferred native setup. It uses lower-privilege sandbox users. It also uses filesystem boundaries, firewall rules, and local policy changes. The non-admin mode exists for machines where elevation is unavailable. However, it offers weaker protection.

    8. Send a safe first prompt

    Once the prompt appears, start with a read-only task. This confirms that Codex can see the repository. It does not ask the tool to modify anything.

    Explain this repository's structure. Do not change any files. Then list the three commands I should run to verify it locally.
    Codex ready for user input
    The prompt appears after account, folder, and sandbox setup finish

    Useful Commands After Setup

    • /status: show the model, directory, account, and active settings.
    • /permissions: inspect or change what Codex can read, edit, or run.
    • /model: choose the model and reasoning effort available to your account.
    • /init: create an AGENTS.md file for repository-specific instructions.
    • /review: review changes before you commit them.
    • /exit: leave the CLI cleanly.

    Keep the default workspace boundary unless the task needs more access. The permissions documentation explains the read-only, workspace, and full-access profiles.

    Updating Codex CLI

    For a standalone installation, rerun the platform installer. OpenAI uses the same command for installation and updates.

    # macOS or Linux
    curl -fsSL https://chatgpt.com/codex/install.sh | sh
    
    # Windows PowerShell
    powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

    Update package-manager installs through the same manager:

    # Homebrew
    brew upgrade --cask codex
    
    # npm
    npm install -g @openai/codex@latest

    Finish with codex --version to confirm the installed build.

    Conclusion

    Installing Codex CLI comes down to three moves:

    1. An install command
    2. Single account approval
    3. A workspace and sandbox decision

    The only genuinely bad setup is the convenient one in the wrong directory. Launch from the repository, keep the sandbox boundary, check /permissions, and begin with a read-only instruction.

    Once that is clean, run /init and let the project carry its own rules.

    Read more: Top 10 Skills for Claude Code and Codex CLI

    Q1. Is Codex CLI free?

    A. The CLI is free to install. Codex is included with ChatGPT Free, Go, Plus, Pro, Business, Edu, and Enterprise plans, with different limits. API-key usage is billed separately.

    Q2. Do I need Node.js?

    A. No. The standalone installer does not require Node.js. You need it only if you choose the npm installation method.

    Q3. Does Codex CLI need WSL on Windows?

    A. No. Codex runs natively on Windows with a Windows sandbox. WSL2 remains useful when your repository and toolchain already live in Linux.

    Q4. Can I use an API key instead of ChatGPT?

    A. Yes. Choose ‘Provide your own API key’ during setup. That usage follows OpenAI Platform billing, not your ChatGPT plan allowance.

    Q5. How do I check or remove the active login?

    A. Run codex login status to inspect it. Run codex logout to clear the cached credentials.


    Vasu Deo Sankrityayan

    Studying, evaluating, and explaining AI systems for over 6 years.

    “𝘖𝘯𝘤𝘦 𝘮𝘦𝘯 𝘵𝘶𝘳𝘯𝘦𝘥 𝘵𝘩𝘦𝘪𝘳 𝘵𝘩𝘪𝘯𝘬𝘪𝘯𝘨 𝘰𝘷𝘦𝘳 𝘵𝘰 𝘮𝘢𝘤𝘩𝘪𝘯𝘦𝘴 𝘪𝘯 𝘵𝘩𝘦 𝘩𝘰𝘱𝘦 𝘵𝘩𝘢𝘵 𝘵𝘩𝘪𝘴 𝘸𝘰𝘶𝘭𝘥 𝘴𝘦𝘵 𝘵𝘩𝘦𝘮 𝘧𝘳𝘦𝘦. 𝘉𝘶𝘵 𝘵𝘩𝘢𝘵 𝘰𝘯𝘭𝘺 𝘱𝘦𝘳𝘮𝘪𝘵𝘵𝘦𝘥 𝘰𝘵𝘩𝘦𝘳 𝘮𝘦𝘯 𝘸𝘪𝘵𝘩 𝘮𝘢𝘤𝘩𝘪𝘯𝘦𝘴 𝘵𝘰 𝘦𝘯𝘴𝘭𝘢𝘷𝘦 𝘵𝘩𝘦𝘮.” — 𝖥𝗋𝖺𝗇𝗄 𝖧𝖾𝗋𝖻𝖾𝗋𝗍, 𝖣𝗎𝗇𝖾

    Login to continue reading and enjoy expert-curated content.

    Related posts:

    Building Long-Term Memory for AI Agents

    7 AI Automation Tools for Streamlined Workflows

    Production-Ready RAG Applications with Zero Code

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleNSX Distributed Firewall as a Security Customs Network: A Practical Mental Model for East-West Zero Trust
    gvfx00@gmail.com
    • Website

    Related Posts

    Business & Startups

    5 Fun Agentic AI Papers to Read

    August 15, 2026
    Business & Startups

    How to Build a Simple AI Web Scraper with Python

    August 14, 2026
    Business & Startups

    NVIDIA’s Fast AI Agentic Model

    August 14, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Black Swans in Artificial Intelligence — Dan Rose AI

    October 2, 2025221 Views

    Every Clue That Tony Stark Was Always Doctor Doom

    October 20, 2025145 Views

    We let ChatGPT judge impossible superhero debates — here’s how it ruled

    December 31, 2025110 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram

    Subscribe to Updates

    Get the latest tech news from tastytech.

    About Us
    About Us

    TastyTech.in brings you the latest AI, tech news, cybersecurity tips, and gadget insights all in one place. Stay informed, stay secure, and stay ahead with us!

    Most Popular

    Black Swans in Artificial Intelligence — Dan Rose AI

    October 2, 2025221 Views

    Every Clue That Tony Stark Was Always Doctor Doom

    October 20, 2025145 Views

    We let ChatGPT judge impossible superhero debates — here’s how it ruled

    December 31, 2025110 Views

    Subscribe to Updates

    Get the latest news from tastytech.

    Facebook X (Twitter) Instagram Pinterest
    • Homepage
    • About Us
    • Contact Us
    • Privacy Policy
    © 2026 TastyTech. Designed by TastyTech.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.