Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

gocanto/openai-codex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openai-codex

A Dockerised environment and Makefile for interacting with the OpenAI Codex (via the OpenAI CLI) inside a container. This setup isolates your local development environment from the Node.js and OpenAI CLI dependencies.

Features

  • Dockerfile: Defines a Node.js container with the OpenAI CLI installed.
  • docker-compose.yml: Runs the service with environment variables loaded from a given .env file.
  • Makefile: Provides shortcuts for building, running, and interacting with Codex via Docker:
    • Build and manage containers.
    • Shell access.
    • Dependency install & update.
    • Codex completions and edits.
  • .env.example: Template for environment variables.

Prerequisites

Setup

  1. Clone the repository
    git clone https://github.com/gocanto/openai-codex.git
    cd openai-codex
  2. Copy and configure .env
    cp .env.example .env
    • OPENAI_API_KEY: Your OpenAI secret key
    • NPM_TOKEN: (Optional) Your npm access token for private packages

Usage

Export your OpenAI API key

# either export it directly
export OPENAI_API_KEY="your-api-key-here"

# or put it in a .env file alongside your docker-compose/Makefile:
OPENAI_API_KEY=your-api-key-here

Build & run containers

make build   # Build the Docker image
make up      # Start containers in detached mode

Common Makefile commands

  • make help : See all the available commands
  • make build : Build the Docker image
  • make up : Start containers in detached mode
  • make logs : View container logs
  • make shell : Open an interactive shell in the container
  • make install: Install npm dependencies (npm ci) inside container
  • make update : Update npm dependencies (npm update) inside container
  • make start : Run your application (npm start)
  • make down : Stop and remove containers

Generate code with Codex

  • Complete from prompt

    make codex-complete prompt="<Describe your coding task>"
  • Edit existing file

    make codex-edit file=path/to/file prompt="<Edit instructions>"

Outputs (edits or completions) appear in your terminal or overwrite the target file (with a .edited suffix if configured).

Contributing

Feel free to submit issues or pull requests for enhancements or bug fixes.

License

This project is licensed under the MIT Licence. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors