Overview
Use Codex CLI in a local project folder to write and run analysis scripts on your own research data, producing figures and summary tables that you check line by line before they go into any write-up.
Problem or Objective
More in Research and Analysis
AI Agents and Models
Tools and Integrations
- Tools
- Codex CLI · ChatGPT
- Prerequisites
- A ChatGPT account (Codex is included across plans, with usage limits that vary by plan), Codex CLI installed on your computer, and a local project folder under version control holding your data.
How It Works
Install Codex CLI with the installer or npm, open the project folder that holds your data and earlier scripts, run codex and sign in with your ChatGPT account. Keep raw data in a folder the agent is told never to edit, and commit the project to version control first so every change can be undone. Describe one analysis at a time: which file to read, which variables to compare, which statistical test or model to use and which figure you need. Ask Codex to write the script into an analysis folder, run it, and report the output together with any warnings and the assumptions it made. If Codex asks you to approve a command, read it before allowing it (check the Codex CLI guide for its approval and sandbox settings; they were not checked here). Then read the script, rerun it yourself, and check a few numbers by hand. Keep a short notes file of each analysis and its decisions, and commit the changes you accept yourself.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Codex CLI.
- Connect the toolsConnect the tools this workflow relies on: Codex CLI, ChatGPT.
- Check the prerequisitesA ChatGPT account (Codex is included across plans, with usage limits that vary by plan), Codex CLI installed on your computer, and a local project folder under version control holding your data.
- Gather your detailsCollect what the prompt asks for: Data file, Raw data folder, What the analysis should do, Statistical method, Figure file name.
- Run the starter promptPaste the starter prompt below into Codex CLI and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at github.com before you rely on it.
Practical Starter Prompt: Write and run one analysis script
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
In this project, read [Data file] but never modify anything in the [Raw data folder] folder. Write a script in the analysis folder that [What the analysis should do], using [Statistical method]. Run it, save the figure as [Figure file name], and report the results, the number of rows used, any rows dropped and why, any warnings, and every assumption you made. Ask me before running any command that installs packages or deletes files. Do not commit anything; I will review the script and commit it myself.Run this in Codex CLI from the project folder after committing your current work. If Codex asks to approve a command, read it first; then read the script, rerun it yourself and spot-check the numbers. You decide what to commit and what goes into a paper or report.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Codex README documents Codex CLI as a coding agent that runs locally on your computer, and OpenAI's help article says Codex is included across ChatGPT plans with usage limits that vary by plan. No cited page covers scientific analysis or measures time saved, so how much faster this is, and whether the statistics are right, is untested here.
Limitations and Considerations
Codex is included across ChatGPT plans, including Free and Go, and usage limits vary by plan, so check what yours allows. An agent can choose an unsuitable test or quietly drop rows, so a qualified person checks the method and the numbers before any result is reported. Keep raw data read-only and under version control. Check your institution's rules before sending unpublished or sensitive data to an AI service. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)developers.openai.com
Related Videos
About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- openai/codex README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- Codex CLI is a coding agent from OpenAI that runs locally on your computer.
- Using Codex with your ChatGPT plan | OpenAI Help Center (opens in a new tab)
Project documentation · help.openai.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Codex is included across ChatGPT plans, including Free and Go.
- Usage limits vary by plan.
- Codex CLI lets you work with code from your terminal.
