No description
  • Go 99.1%
  • Shell 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-01 19:48:34 -05:00
cmd add code comments 2026-11-14 10:02:31 -05:00
docs fix(rendering): markdown table formatting 2026-11-27 09:20:05 -05:00
internal fix(rendering): keep widget badges inline in markdown tables 2026-12-01 19:42:21 -05:00
scripts fix(build): release script to account for ssh origin being different from api endpoint 2026-12-01 19:48:34 -05:00
static add screenshot 2026-11-19 12:01:23 -05:00
.agents-sync.jsonc chore: sync AI agent instructions 2026-11-21 12:26:41 -05:00
.gitignore 0.7.2: fixed table rendering, inline image previews, references 2026-10-26 00:03:54 -04:00
AGENTS.md chore: sync AI agent instructions 2026-11-21 12:26:41 -05:00
AGENTS.project.md docs: add repository agent instructions 2026-11-21 12:26:11 -05:00
CHANGELOG.md fix(rendering): keep widget badges inline in markdown tables 2026-12-01 19:42:21 -05:00
CLAUDE.md chore: sync AI agent instructions 2026-11-21 12:26:41 -05:00
go.mod 0.20.0: initial file attachment support via /attach 2026-11-14 07:55:16 -05:00
go.sum mvp 2026-10-19 00:25:04 -04:00
LICENSE mvp 2026-10-19 00:25:04 -04:00
main.go add code comments 2026-11-14 10:02:31 -05:00
main_test.go readability improvements 2026-10-26 00:20:25 -04:00
README.md docs: improve readme and other docs 2026-11-26 02:37:28 -05:00
VERSION fix(rendering): keep widget badges inline in markdown tables 2026-12-01 19:42:21 -05:00

chatgpt-cli

An unofficial ChatGPT client for your terminal, in a single Go binary.

It talks to ChatGPT's web endpoints using your existing account, so there are no API tokens to pay for. Your account's model access and usage limits still apply.

Screenshot

Status: MVP. Not affiliated with OpenAI. The undocumented endpoints it relies on can change without notice.

Features

  • Streaming chats with Markdown and syntax-highlighted code blocks
  • Full chat history, search, projects, branching, and archiving
  • Model selection
  • File attachments, downloads, and Markdown export
  • Inline images in Kitty and Ghostty (or via chafa elsewhere)
  • Mouse text selection and clipboard copy, including over SSH
  • No Python, Node, or background daemon — Chrome is only needed once, to sign in

Install

Requires Go 1.25.2 or newer.

go build -o chatgpt-cli .
./chatgpt-cli

Prebuilt Linux and macOS binaries are attached to each release.

Sign in

You only need Chrome to capture your session. After that, everything runs in Go.

  1. Start Chrome with a dedicated profile and remote debugging enabled (macOS shown):

    "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
      --no-first-run --remote-debugging-port=9222 \
      --remote-debugging-address=127.0.0.1 \
      --user-data-dir="$HOME/.local/share/chatgpt-cli/chrome-profile" \
      https://chatgpt.com/
    
  2. Sign in to ChatGPT in that browser.

  3. Run ./chatgpt-cli, enter http://127.0.0.1:9222 on the authentication screen, and press Enter. You can close Chrome afterwards.

Running on a headless server? See remote authentication. Use /auth any time you need to sign in again.

Basic use

Type a message and press Enter to send it. Type / to see all commands.

Key Action
Enter Send
Shift+Enter or Ctrl+J New line
/ Show commands (Tab completes, Enter runs)
Left (empty input) Browse chats
Shift+Up / PageUp Scroll the conversation
Mouse drag, then Ctrl+C Copy selected text
Ctrl+C Cancel a response, clear input, or quit

Common commands:

Command Action
/new Start a new chat
/chats Browse your chats
/search Search all chats
/projects Browse projects
/model Choose a model
/attach [PATH] Attach a file to your next message
/copy Copy the last response
/export [PATH] Save the chat as Markdown
/help Show all controls and commands

The usage guide covers every key, command, and feature in detail.

Where your data lives

Data Location
Credentials and preferences ~/.local/state/chatgpt-cli/
Cached conversations ~/.local/share/chatgpt-cli/conversations/
Sentinel SDK cache ~/.cache/chatgpt-cli/sentinel/

The usual XDG_*_HOME variables override these. Files are private to your user but not encrypted — your session grants access to your ChatGPT account, so don't share it. To sign out, quit and delete session.json from the state directory.

Documentation

Future plans

Features

  • Non-interactive commands
  • Automated builds for all relevant platforms
  • Multiple color schemes
  • /copy should allow selecting which response to copy with Up/Down

Bug fixes

  • Weird box didn't render in sentinel planning

License

Licensed under the MIT License.