Set Up Codex and GitHub Access for Chico State Developers

Quick Links: | 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 |

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.

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

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

  1. Go to https://chatgpt.com/codex.
  2. Select Connect to GitHub if prompted.
  3. Choose the GitHub account that has access to csu-co-chico.
  4. Install or connect the ChatGPT GitHub Connector.
  5. Select csu-co-chico as the installation target when applicable.
  6. Allow the repositories Codex should access.
  7. 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.

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.