Body
Quick Links: What is Codex? | Codex and GitHub Are Independent | Before You Begin | Choose Your Workflow | Verify GitHub Access | | Who Should Use This Article? | Install Git and GitHub CLI | Configure Git Identity | Authenticate GitHub CLI | Verify GitHub Access | Sign In to Codex | Open a Repository in Codex | Connect Codex Web to GitHub | Troubleshoot Access Issues | Reference Documentation |
What is Codex?
Codex is OpenAI's coding agent for software development. It can help you understand a codebase, write and modify code, run tests, and review changes. Codex does not replace GitHub permissions, code review, testing, or required approvals.
Codex and GitHub Are Independent
Codex access and GitHub access are separate services. You can have Codex access without GitHub access, or GitHub access without Codex access. You need both only when you want to use Codex with a GitHub repository.
- Codex only: You can use Codex for work that does not require access to a Chico State GitHub repository.
- GitHub only: You can access Chico State GitHub organizations and repositories without having Codex enabled.
- Codex with GitHub: You need Codex access, GitHub organization and repository permissions, and the required connection or authentication for the workflow you choose.
Before You Begin
Decide which access you need before continuing. The GitHub Enterprise Access and Repository Request is for GitHub access; it does not automatically provide Codex access. Codex may require separate enablement in the Chico State ChatGPT workspace. If you want to use Codex with a GitHub repository, complete both access paths and then follow the workflow below.
| Requirement | What to confirm |
| Chico State identity | You can sign in with your Chico State account and complete MFA or SSO prompts. |
| Codex access | Codex is enabled for your ChatGPT workspace or your administrator has confirmed that it is available to you. |
| GitHub access | You submitted the request above, your GitHub account has been added to csu-co-chico, and you accepted any organization or repository invitation. |
| Computer access | You can install Git and GitHub CLI, or have an administrator install them for you. |
Codex access and GitHub access are separate. Codex determines whether you can use the coding agent; GitHub organization membership and repository permissions determine which repositories you can access.
Who Should Use This Article?
This article is intended for Chico State developers who need Codex to work with repositories in the GitHub organization csu-co-chico.
Choose Your Workflow
Choose the path that matches how you will use Codex:
- Codex Local: Use this path when Codex runs on your computer. You authenticate GitHub CLI and Codex separately, clone the repository locally, and run Codex from the repository directory.
- Codex Cloud: Use this path when Codex runs in the ChatGPT web experience. You connect GitHub in Codex, select the csu-co-chico organization and an allowed repository, and create or select a Codex environment.
Successful GitHub CLI authentication does not automatically authenticate Codex, and Codex Cloud does not use your computer's local GitHub CLI session.
Install Git and GitHub CLI
Install Git and GitHub CLI (gh) using your operating system's package manager.
Debian/Ubuntu example:
sudo apt update
sudo apt install git gh
If you do not have administrator rights, install gh in your home directory and ensure ~/.local/bin is included in your PATH.
Configure Git Identity
Configure Git using your Chico State identity:
git config --global user.name "Your Name"
git config --global user.email "username@csuchico.edu"
git config --global init.defaultBranch main
Authenticate GitHub CLI
Authenticate GitHub CLI using HTTPS:
gh auth login --hostname github.com --git-protocol https --web --scopes repo,read:org,workflow
gh auth setup-git --hostname github.com
During login:
- Sign in with the GitHub account associated with your Chico State identity.
- Complete any MFA, SSO, or passkey prompts.
- Authorize the csu-co-chico organization if prompted.
Verify GitHub Access
Check login status:
gh auth status --hostname github.com
Expected result: GitHub CLI reports the GitHub username you intended to use and shows that the account is authenticated.
Check organization access:
gh api orgs/csu-co-chico --jq '.login + " " + .html_url'
gh repo list csu-co-chico --limit 20
Verify repository access without cloning:
GIT_TERMINAL_PROMPT=0 git ls-remote https://github.com/csu-co-chico/REPO_NAME.git HEAD
Replace REPO_NAME with a repository you can access.
Sign In to Codex
Sign in to Codex:
codex login
For remote or headless systems:
codex login --device-auth
Verify login:
codex login status
Expected result:
Logged in using ChatGPT
Open a Repository in Codex
Clone a repository and launch Codex:
mkdir -p ~/code
cd ~/code
gh repo clone csu-co-chico/REPO_NAME
cd REPO_NAME
codex
Codex Local uses your local repository working tree. GitHub pull request context requires GitHub CLI to be installed and authenticated.
Connect Codex Web to GitHub
- Go to https://chatgpt.com/codex.
- Select Connect to GitHub if prompted.
- Choose the GitHub account that has access to csu-co-chico.
- Install or connect the ChatGPT GitHub Connector.
- Select csu-co-chico as the installation target when applicable.
- Allow the repositories Codex should access.
- Create or select a Codex environment for the repository.
Codex uses short-lived GitHub App installation tokens and honors existing GitHub permissions and branch protection policies.
Troubleshoot Access Issues
| Issue |
Resolution |
| Git clone prompts for a username |
Run:
gh auth setup-git --hostname github.com
Then test:
GIT_TERMINAL_PROMPT=0 git ls-remote https://github.com/csu-co-chico/REPO_NAME.git HEAD
|
| Organization or repositories are not visible |
Check:
gh auth status --hostname github.com
gh api user --jq '.login'
gh api orgs/csu-co-chico --jq '.login'
gh repo list csu-co-chico --limit 20
- Confirm you signed in with the correct GitHub account.
- Confirm your account has access to csu-co-chico.
- Confirm SSO authorization has been completed.
- Confirm the ChatGPT GitHub Connector has been approved for the repository.
|
| Codex reports unauthorized access |
- You are a member of the Chico State ChatGPT workspace.
- Codex Local is enabled.
- Codex Cloud is enabled if needed.
- Applicable Codex policies allow the intended workflow.
|
Support and Maintenance
If the steps fail, contact IT Support Services and include your GitHub username, the repository name, whether you are using Codex Local or Codex Cloud, the command or screen that failed, and the complete error message with credentials removed. Never include passwords, access tokens, private keys, auth.json, or other credential files in a ticket or chat.
This article should be reviewed at least annually and whenever Codex, GitHub organization policies, authentication procedures, or the request form changes. The article owner should verify the links, screenshots, command output examples, and workspace availability during each review.
Reference Documentation
Still need help? Contact IT Support Services for further assistance.
Help us improve our Knowledge Base! Click Yes or No below, then let us know what worked — or what didn’t. Your feedback helps us improve our content and provide the best possible support.