---
title: "Give Claude an OpenAI CLI for code research | Ian Nuttall"
description: "Use Claude Code with OpenAI CLI"
canonical: "https://ian.is/post/claude-openai-cli"
language: "en"
---

# Give Claude an OpenAI CLI for code research

Jul 2025 / 26,236 views / [via X](https://x.com/iannuttall/status/1950880854734967217)

Claude Code pro tip for GPT-5:

Ask it to write a CLI for OpenAI, give it simple tools and write a CLAUDE.⁠md

Claude can then research your codebase, find complex bugs, build plans + features using GPT-5 (when it launches)

Example bash alias below so you can run things like:

```
oai "@⁠src/ Summarize the architecture and main components"
```

```
# OpenAI CLI function
oai() {
    # Set API key if not already set
    if [ -z "$OPENAI_API_KEY" ]; then
        export OPENAI_API_KEY='sk-proj-1234567890'
    fi

    # Run the openai CLI with all arguments
    /Users/iannuttall/dev/cli/openai/openai "$@"
}
```

![Image from the original X post](https://ian.is/media/tweets/1950880854734967217/1950880854734967217/6906e7833f277d75538c0049098af9db405c132294565c54d5098a7d7ed846ce.jpg)

You can also ask Claude to use codex in non-interactive mode:

```
codex exec "explain utils.ts"
```

[https://github.com/openai/codex](https://github.com/openai/codex)

## Ian's List

Join 15k\+ subscribers
