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.
- 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_KEYorgodex login
Build from source:
git clone https://github.com/yourname/godex.git
cd godex
go build -o godex ./cmd/godexIf you publish the module under a real repository path, you can also install it with go install.
Use an environment variable:
export OPENAI_API_KEY=your-api-keyOr use the login command:
godex logingodexInside the TUI, type your prompt directly.
Available slash commands:
/newstarts a new session/model <name>switches the active model/modelshows the current model/compactcompacts the current conversation history/resume [id]resumes a saved session or the latest one/exitsaves the current session and quits/helpshows command help
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"| 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 |
These flags apply to the root command and subcommands:
-m, --modelsets the model name-s, --sandboxsets the sandbox mode-c, --config key=valueapplies config overrides
Godex uses a home directory resolved in this order:
GODEX_HOME~/.godex~/.codexfor 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.jsonfor credentialssessions/for saved sessionslogs/for logsmemories/for memory-related data
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
go build ./...
go test ./...
go vet ./...Apache License 2.0
This project is inspired by the architecture and UX direction of the OpenAI Codex CLI.