Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godex

Godex is an AI coding assistant written in Go and built around the OpenAI Responses API. It provides an interactive terminal UI, a non-interactive execution mode, sandboxed command execution, session persistence, and a small tool system for code-oriented workflows.

Features

  • Interactive chat in the terminal
  • Non-interactive execution for scripting and automation
  • Tool execution for shell commands, file reading, and file search
  • Cross-platform sandbox support for Linux, macOS, and Windows
  • Layered configuration with global and project-level overrides
  • Session persistence and resume support
  • Authentication through OPENAI_API_KEY or godex login

Installation

Build from source:

git clone https://github.com/yourname/godex.git
cd godex
go build -o godex ./cmd/godex

If you publish the module under a real repository path, you can also install it with go install.

Quick Start

1. Configure authentication

Use an environment variable:

export OPENAI_API_KEY=your-api-key

Or use the login command:

godex login

2. Start interactive mode

godex

Inside the TUI, type your prompt directly.

Available slash commands:

  • /new starts a new session
  • /model <name> switches the active model
  • /model shows the current model
  • /compact compacts the current conversation history
  • /resume [id] resumes a saved session or the latest one
  • /exit saves the current session and quits
  • /help shows command help

3. Run in non-interactive mode

godex exec "Explain how goroutines work in Go"
godex test-agent "Summarize the history of AI and write it to AI.md"
echo "func main() {}" | godex exec "Explain this code"

Commands

Command Description
godex Start the interactive terminal UI
godex exec [prompt] Run a prompt non-interactively
godex test-agent [prompt] Run a single-turn flow for agent testing
godex login Store authentication credentials
godex logout Remove stored credentials
godex sandbox [command...] Test sandbox execution
godex version Print version information

Global Flags

These flags apply to the root command and subcommands:

  • -m, --model sets the model name
  • -s, --sandbox sets the sandbox mode
  • -c, --config key=value applies config overrides

Configuration

Godex uses a home directory resolved in this order:

  1. GODEX_HOME
  2. ~/.godex
  3. ~/.codex for legacy compatibility

Configuration files:

  • Global: ~/.godex/config.toml
  • Project-level: .godex/config.toml
  • Legacy project-level fallback: .codex/config.toml

Example configuration:

model = "o4-mini"
sandbox_mode = "workspace-write"
approval_policy = "suggest"

[tui]
theme = "dark"

[mcp_servers.my-server]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "."]

The home directory also stores:

  • auth.json for credentials
  • sessions/ for saved sessions
  • logs/ for logs
  • memories/ for memory-related data

Project Structure

godex/
|-- cmd/godex/         # CLI entrypoint
|-- internal/
|   |-- api/           # OpenAI API client
|   |-- auth/          # Authentication
|   |-- config/        # Configuration system
|   |-- core/          # Core engine
|   |-- hooks/         # Event hooks
|   |-- protocol/      # Shared protocol types
|   |-- sandbox/       # Sandbox execution
|   `-- tools/         # Tool system
|-- go.mod
`-- README.md

Development

go build ./...
go test ./...
go vet ./...

License

Apache License 2.0

Acknowledgements

This project is inspired by the architecture and UX direction of the OpenAI Codex CLI.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages