ChogGPT

command module
v2.0.0-...-f08db84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: GPL-3.0 Imports: 23 Imported by: 0

README ΒΆ

ChogGPT logo

ChogGPT πŸ€–

GitHub go.mod Go version GitHub release (latest by date)

ChogGPT is a cross-platform Command-Line Interface (CLI) tool that lets you talk to AI models β€” chat, generate code, get shell commands, search the web, generate images β€” all from your terminal.

This repository is a fork of aandrew-me/tgpt, rebranded and maintained as ChogGPT. All credit for the original design and implementation goes to the upstream project and its contributors β€” see Credits below.

Demo

Table of contents


Features

  • 🧠 Chat with 20+ AI providers β€” many of them completely free, no API key required
  • πŸ’¬ Interactive modes: normal, multi-line, shell, and web-search-driven
  • πŸ’» Generate and (optionally) execute shell commands directly (-s)
  • πŸ§‘β€πŸ’» Generate code (-c)
  • πŸ–ΌοΈ Generate images from text (--img), via several free/paid providers
  • πŸ”Ž Web search built in, with exa or google as the search backend (-f)
  • πŸ› οΈ Built-in tool calling (file read/write, grep, glob, shell exec, web fetch, web search) and full MCP (Model Context Protocol) server support
  • πŸ” Automatic provider fallback/rotation if one provider fails (--rotate)
  • 🌐 HTTP/SOCKS5 proxy support
  • πŸ“¦ Single static binary, no runtime dependencies β€” works on Linux, macOS, Windows, FreeBSD, NetBSD, OpenBSD, and multiple architectures (amd64, arm64, arm, 386, including softfloat variants)

Installation ⏬

Since this is a personal fork, the package-manager listings that exist for upstream tgpt (Homebrew, Pacman, Chocolatey, FreeBSD ports) are not published for ChogGPT. The two reliable ways to get ChogGPT are:

1. go install (requires Go β‰₯ 1.25):

go install github.com/0xCaffeeNads/ChogGPT/v2@latest

Make sure your Go bin directory ($(go env GOPATH)/bin) is on your PATH.

2. Clone and build manually:

git clone https://github.com/0xCaffeeNads/ChogGPT.git
cd ChogGPT
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o choggpt
sudo mv choggpt /usr/local/bin/   # optional, for global access

⚠️ If you're building cross-platform (e.g. from Termux/Android for a Linux/Windows/macOS target), always set GOOS/GOARCH explicitly, for example:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o choggpt-linux-amd64

Omitting GOOS lets Go default to the host platform, which on Android/Termux can pull in mobile-only code paths that fail to compile.

Prebuilt binaries (GitHub Releases)

This repo's .github/workflows/main.yml CI workflow builds binaries for every supported platform and architecture (Linux, Windows, macOS, FreeBSD, NetBSD, OpenBSD Γ— amd64/arm64/arm/386, plus softfloat variants) and attaches them as a draft GitHub Release whenever it runs.

  • It runs automatically on pushes to the release branch.
  • It can also be triggered manually from Actions β†’ Build Go Project and Create Release β†’ Run workflow, where you can pick a specific os and arch to build just that one binary instead of the full matrix (or leave both as all).

Once a release is published, download the binary matching your OS/architecture from the Releases page, rename it to choggpt (optional), make it executable, and place it somewhere on your PATH:

chmod +x choggpt-linux-amd64
sudo mv choggpt-linux-amd64 /usr/local/bin/choggpt
Windows πŸͺŸ
irm https://raw.githubusercontent.com/0xCaffeeNads/ChogGPT/main/install-win.ps1 | iex

Uninstall with:

iex "& { $(irm https://raw.githubusercontent.com/0xCaffeeNads/ChogGPT/main/install-win.ps1) } -Uninstall"

Quick start

# Ask a question (uses the default provider, opencode β€” free, no key needed)
choggpt "What is internet?"

# Multi-line interactive mode
choggpt -m

# Generate & confirm-run a shell command
choggpt -s "How do I find large files in this directory?"

# Generate code
choggpt -c "Write a function in Go that reverses a string"

# Use a specific provider
choggpt --provider groq "What is 1+1"

# Generate an image
choggpt --img "a cat astronaut, digital art"
choggpt --img --out ~/cat.jpg --width 512 --height 512 "a cat astronaut"

# Web search
choggpt -f "latest news about AI"

# Pipe input in
cat main.go | choggpt "Explain this code"

Run choggpt -h for the full flag reference, or see md/usage.md.


Supported AI providers πŸ€–

The default provider is opencode (free, no API key needed). Switch providers with --provider <name> or the AI_PROVIDER environment variable.

Provider Cost Key environment variables Notes
opencode (default) Free OPENCODE_API_KEY, OPENCODE_MODEL, OPENCODE_URL Uses opencode.ai/zen API, deepseek-v4-flash-free by default
anyapi Free (100k tokens/day) ANYAPI_API_KEY, ANYAPI_MODEL Multi-model gateway (OpenAI, Google, DeepSeek, and more); also supports image generation
pollinations Free POLLINATIONS_API_KEY, POLLINATIONS_MODEL Many free text models
powerbrain Free β€” Uses gpt-5 by default, no key required
isou Free β€” DeepSeek-chat backed by SearXNG web search
koboldai Free β€” koboldcpp / HF Space "Tiefighter-13B"
fx Free β€” fx.sh gateway, default zai/glm-5.2
aihorde Free (community-run) AIHORDE_API_KEY, AIHORDE_MODEL Volunteer-powered compute; also does image generation
groq Free API key GROQ_API_KEY, GROQ_MODEL Fast inference, many models
gemini Free API key GEMINI_API_KEY, GEMINI_MODEL Default gemini-2.0-flash
openrouter Free tier OPENROUTER_API_KEY, OPENROUTER_MODEL, OPENROUTER_URL Default openrouter/free
ollama Free (local) β€” Runs local models via a local Ollama install
ollamacloud Requires API key OLLAMA_API_KEY, OLLAMA_MODEL Default gpt-oss:120b
deepseekweb Free (browser token) DEEPSEEK_WEB_TOKEN / --key Uses your chat.deepseek.com session; needs node/bun/deno in PATH to solve PoW
openai Paid API key OPENAI_API_KEY, CEREBRAS_API_KEY, OPENAI_MODEL Any OpenAI-compatible model; custom URL via --url
deepseek Paid API key DEEPSEEK_API_KEY, DEEPSEEK_MODEL Default DeepSeek-V4-Flash
atlascloud Paid API key ATLASCLOUD_API_KEY, ATLASCLOUD_MODEL, ATLASCLOUD_URL OpenAI-compatible, default qwen/qwen3.8-max
minimax Paid API key MINIMAX_API_KEY, MINIMAX_MODEL Default MiniMax-M2.7
litellm Depends (self-hosted) LITELLM_API_KEY, LITELLM_MODEL, LITELLM_URL Gateway to 100+ providers, requires --model
omniroute Self-hosted router OMNIROUTE_API_KEY, OMNIROUTE_MODEL, OMNIROUTE_URL Default http://localhost:20128/v1, model auto

Full details for every provider: md/providers.md

Image generation providers πŸ–ΌοΈ

Provider Cost Notes
pollinations Free Models: flux, turbo
magicstudio Free Very fast
aihorde Free (community-run) Volunteer-powered
anyapi Requires API key Many models, incl. google/gemini-2.5-flash-image

Set the image provider with IMG_PROVIDER (separate from the chat AI_PROVIDER).


Tool calling & MCP

ChogGPT can let the model call tools while answering (-t / --tools), and can connect to MCP (Model Context Protocol) servers to add more tools at runtime. Not every provider supports tool calling β€” unsupported ones simply ignore the tool definitions.

Built-in tools:

web_search_exa, web_search_firecrawl, read_directory, read_file, execute_command, web_fetch, write_file, edit_file, grep, glob

choggpt -t "What files are in the current directory?"
choggpt -t web_search_exa,read_file "Search and read the specified file"
choggpt --mcp "Use MCP tools from auto-detected mcp_config.json"
choggpt --mcp-server "npx -y @modelcontextprotocol/server-filesystem /path/to/dir" "List the files"
choggpt --mcp-add       # interactively configure a new MCP server
choggpt --mcp-remove    # interactively remove one

Example mcp_config.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
      "env": ["LOG_LEVEL=info"]
    },
    "firecrawl": {
      "url": "https://mcp.firecrawl.dev/v2/mcp",
      "headers": { "Authorization": "Bearer YOUR_FIRECRAWL_API_KEY" }
    }
  }
}

Configuration

Every provider's API key/model/URL can be set via environment variables (see the provider table above), or persisted in a config file:

  • ~/.config/choggpt/config.conf on Linux/macOS (%USERPROFILE%\.config\choggpt on Windows)
  • ./config.conf in the current directory (takes priority over the home directory config)

Example:

AI_PROVIDER=groq
GROQ_API_KEY=gsk_xxxx
OPENCODE_MODEL=mimo-v2.5-free
AI_ROTATE_PROVIDERS=deepseek,groq,anyapi,opencode
HTTP_PROXY=http://localhost:8080

For web search (-f), the default backend is exa (works without a key, rate-limited; supports EXA_API_KEY). To use Google instead, set SEARCH_PROVIDER=google and see SEARCH_SETUP.md for CHOGGPT_GOOGLE_API_KEY / CHOGGPT_GOOGLE_SEARCH_ENGINE_ID setup.


Proxy support

1. Environment variable β€” http_proxy / HTTP_PROXY:

  • HTTP: http://ip:port
  • HTTP with auth: http://user:pass@ip:port
  • SOCKS5: socks5://ip:port
  • SOCKS5 with auth: socks5://user:pass@ip:port

2. Config file β€” put the proxy URL in ./proxy.txt or ~/.config/choggpt/proxy.txt:

http://127.0.0.1:8080

Building from source

git clone https://github.com/0xCaffeeNads/ChogGPT.git
cd ChogGPT
go build -trimpath -ldflags="-s -w" -o choggpt

Or use build.sh to cross-compile every supported platform/architecture locally, matching what CI produces.

CI configuration lives in .github/workflows/main.yml and supports manual, selective builds via workflow_dispatch inputs (os, arch) β€” see Prebuilt binaries above.


Updating ⬆️

If installed via the install script:

choggpt -u

(May require admin privileges depending on install location.)

If installed via go install, re-run:

go install github.com/0xCaffeeNads/ChogGPT/v2@latest

Uninstalling

sudo rm $(which choggpt)

The configuration directory is ~/.config/choggpt on Linux (~/Library/Application Support/choggpt on macOS) β€” remove it too if you want a clean uninstall.


Credits & License

ChogGPT is a fork of tgpt by aandrew-me and its contributors. All original design, architecture, and provider integrations are their work β€” this fork exists for rebranding/customization purposes.

Licensed under the GNU General Public License v3.0, same as upstream.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL