In DevelopmentCLI Tool • Go

chaTTY

A minimal terminal chat client for OpenAI-compatible APIs written in Go. Launch instantly, stream responses in real-time, and stay in flow without opening a browser. No Electron, no bloat—just a single binary that gets you chatting in milliseconds.

Note: chaTTY is functional and usable, but under active development. Many features are still being added and refined.

Why chaTTY?

Opening a browser, navigating to ChatGPT or Claude, waiting for the page to load—it all takes time. When you just need a quick answer or want to iterate on an idea, that friction adds up.

chaTTY eliminates that friction. It launches instantly, streams responses token-by-token, and keeps you in your terminal. No Electron, no browser—just a minimal Go binary focused on speed and productivity.

Features

Instant Startup

Compiled Go binary with minimal dependencies. Launches in milliseconds and stays out of your way.

Markdown Rendering

Beautiful formatted output with syntax highlighting for code blocks. Toggle with /markdown.

Reasoning Model Support

Detects and dims thinking tags (<think>, <thinking>) for clearer reasoning output.

Multi-Provider Support

Works with PromptShield, OpenAI, Anthropic, xAI (Grok), and local engines like Ollama via OpenAI-compatible APIs.

Session Persistence

Save and reload conversations with /list, /sessions, and /load <id>. Stay organized across chats.

Shell-Like Editing

Interactive terminal controls with arrow-key history, multi-line editing, and smooth REPL-style input.

Quick Start

Prerequisites

  • Go 1.23 or later
  • Access to an OpenAI-compatible API endpoint

Installation

go install github.com/PromptShieldLabs/chatty/cmd/chatty@latest

Or clone and build locally from the GitHub repository.

Configuration

chaTTY works with any OpenAI-compatible API. Create config.yaml in the project root (or pass --config) and fill in your provider details:

PromptShield (Recommended)

api:
  url: "https://api.promptshield.io/v1"
  key: "${CHATTY_API_KEY}"
model:
  name: "openai/gpt-4o-mini"
  temperature: 0.7
  stream: true

OpenAI

api:
  url: "https://api.openai.com/v1"
  key: "${CHATTY_API_KEY}"
model:
  name: "gpt-4o-mini"
  temperature: 0.7
  stream: true

Anthropic

api:
  url: "https://api.anthropic.com/v1"
  key: "${ANTHROPIC_API_KEY}"
model:
  name: "claude-3-5-sonnet-20241022"
  temperature: 0.7
  stream: true

xAI (Grok)

api:
  url: "https://api.x.ai/v1"
  key: "${CHATTY_API_KEY}"
model:
  name: "grok-beta"
  temperature: 0.7
  stream: true

Local Models (Ollama)

api:
  url: "http://localhost:11434/v1"
  key: "not-needed"
model:
  name: "llama3.2"
  temperature: 0.7
  stream: true

Environment variables override config file values: CHATTY_API_URL, CHATTY_API_KEY, or provider-specific keys like OPENAI_API_KEY and ANTHROPIC_API_KEY.

Running

make build
./chatty

# Or build and run directly
make run

Available Commands

/helpShow available commands
/exitExit the chat (also /quit)
/resetClear conversation history (also /clear)
/historyShow conversation history
/markdownToggle markdown rendering on/off
/listList saved conversations (also /sessions)
/load <id>Load a saved conversation by numeric identifier

Lean Architecture

chaTTY keeps the codebase lean and approachable. The entire project is ~1,650 lines of Go (tests included), organized for easy hacking and customization.

chatty/
├── cmd/chatty/
│   └── main.go               # CLI entrypoint & bootstrap (~70 lines)
├── internal/
│   ├── chat.go               # Chat loop, commands, streaming (~670 lines)
│   ├── client.go             # OpenAI-compatible HTTP client (~230 lines)
│   ├── storage/
│   │   └── storage.go        # SQLite persistence layer (~320 lines)
│   └── config/
│       └── config.go         # Config loading & validation (~140 lines)
├── config.yaml               # Sample configuration
└── go.mod                    # Module definition

Development conveniences are built in: make test, make build, make install, and go fmt ./... keep iteration fast.

MIT Licensed - chaTTY is free and open source software. You're welcome to use, modify, and distribute it for any purpose.

Ready to Try chaTTY?

Check out the repository for full documentation and installation instructions.