tgpt

aandrew-meGPL-3.0活跃维护

在终端里直接和多种 AI 模型聊天,无需浏览器或图形界面,支持 ChatGPT、GPT-4、Llama、Mixtral 等后端,适合习惯命令行的开发者。

AI Chatbots in terminal for free

v2.15.0发布于 2026-09-23 13:53 UTC3,287star +3 / 7 天357fork同步于 2026-11-10 23:42 UTC

怎么上手

由 README 提炼,执行前请确认
curl -sSL https://raw.githubusercontent.com/aandrew-me/tgpt/main/install | bash -s /usr/local/bin
硬件要求按 README 说明

README 未说明;作为调用远程服务的 CLI 工具,本地无需 GPU 或显存

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

跨平台终端 AI 聊天 CLI,在命令行里直接对话,无需打开浏览器

在终端里直接和多种 AI 模型聊天,无需浏览器或图形界面,支持 ChatGPT、GPT-4、Llama、Mixtral 等后端,适合习惯命令行的开发者。

核心能力

  • 在终端内直接与 AI 对话,无需切换窗口
  • 支持多种 AI 提供商,可切换使用
  • 支持 http 与 socks5 代理,含带认证的代理
  • 提供安装脚本与包管理器一键安装
  • 内置 -u 参数可自更新

容易踩的坑

默认安装到 /usr/local/bin,需确保该目录在 PATH 中;通过包管理器安装的版本要用对应包管理器升级,不能用 tgpt -u;代理需通过环境变量或 proxy.txt 配置,否则可能连不上服务

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.15.0
  1. v2.15.0tgpt 2.15.0最新正式版2026-09-23 · 2026-09-23 13:53 UTC

    Changelog:

    • Fixed default provider (opencode)
    • Added search providers - searpingapi, serply
    • Added provider cheaperinference
  2. v2.14.0tgpt 2.14.02026-08-30 · 2026-08-30 09:21 UTC
    查看更新说明

    Changelog:

    • Switched opencode default model to Mimo 2.5
    • Fixed text not being shown in interactive shell mode
    • Added new providers: deepseek-web, aitopia, openrouter, fx, atlas cloud, omniroute
  3. v2.13.0tgpt 2.13.02026-08-09 · 2026-08-09 06:17 UTC
    查看更新说明

    Changelog:

    • Added provider Aihorde #464
    • Added tool support
    • Added support to add mcp servers #404
    • Added Suspend (Ctrl+Z) support for interactive modes #471
    • Bug fixes and minor improvements
  4. v2.12.0tgpt 2.12.02026-07-26 · 2026-07-26 14:41 UTC
    查看更新说明

    Changelog:

    • Added multiple new providers - opencode, powerbrain, anyapi, litellm, minimax, ollamacloud.
    • Removed providers which don't work.
    • Added new image gen providers - magicstudio, anyapi
    • Made fixes for some providers
    • Fixed providers not using AI_API_KEY
    • Added API key environment variables for all providers which use an API key
    • Added config file support
    • Fixed many bugs
    • Added exa web search provider (works without API key)
    • Added provider rotation support
  5. v2.11.1tgpt 2.11.12026-02-01 · 2026-02-01 09:00 UTC
    查看更新说明

    Changelog:

    • Removed phind
    • Changed default provider to pollinations
    • Fixed pollinations

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    tgpt 🤖

    GitHub go.mod Go version GitHub release (latest by date) Arch Linux package Chocolatey Version Homebrew Formula Version

    tgpt is a Cross-platform Command-Line Interface (CLI) tool that allows you to use AI in your Terminal.

    Currently available providers

    Installation ⏬

    Download for GNU/Linux 🐧 or MacOS 🍎

    The default download location is /usr/local/bin, but you can change it in the command to use a different location. However, make sure the location is added to your PATH environment variable for easy accessibility.

    You can download it with the following command:

    curl -sSL https://raw.githubusercontent.com/aandrew-me/tgpt/main/install | bash -s /usr/local/bin
    

    If you are using Arch Linux, you can install with pacman:

    pacman -S tgpt
    
    Install with Homebrew
    brew install tgpt
    

    FreeBSD 😈

    To install the port:

    cd /usr/ports/www/tgpt/ && make install clean
    

    To install the package, run one of these commands:

    pkg install www/tgpt
    pkg install tgpt
    

    Install with Go

    You need to add the Go install directory to your system's shell path.

    go install github.com/aandrew-me/tgpt/v2@latest
    

    Windows 🪟

    • Installation Script

      Open Powershell, copy and paste the command and press Enter to install.

      irm https://raw.githubusercontent.com/aandrew-me/tgpt/refs/heads/main/install-win.ps1 | iex
      

      Uninstall with

      & ([scriptblock]::Create((irm https://raw.githubusercontent.com/aandrew-me/tgpt/refs/heads/main/install-win.ps1))) -Uninstall
      
    • Scoop: Package installation with Scoop can be done using the following command:

      scoop install https://raw.githubusercontent.com/aandrew-me/tgpt/main/tgpt.json
      
    • Chocolatey

      choco install tgpt
      

    From Release

    You can download the executable for your operating system, rename it to tgpt (or any other desired name), and then execute it by typing ./tgpt while in that directory. Alternatively, you can add it to your PATH environmental variable and then execute it by simply typing tgpt.

    Updating ⬆️

    If you installed the program with the installation script (GNU/Linux, macOS, or Windows), you may update it with:

    tgpt -u
    

    (On GNU/Linux and macOS, it may require admin privileges depending on the install location.)

    If you installed using a package manager (Homebrew, Pacman, Scoop, Chocolatey, Go), please update using your package manager's update command (e.g. brew upgrade tgpt, pacman -Syu tgpt, scoop update tgpt, choco upgrade tgpt, or go install github.com/aandrew-me/tgpt/v2@latest).

    Usage

    Proxy

    Support:

    1. Environment variable

    http_proxy or HTTP_PROXY with following available formats:

    • Http Proxy [ http://ip:port ]
    • Http Auth [ http://user:pass@ip:port ]
    • Socks5 Proxy [ socks5://ip:port ]
    • Socks5 Auth [ socks5://user:pass@ip:port ]

    2. Configuration file

    Supported file locations:

    • ./proxy.txt (in the same directory from where you are executing)
    • ~/.config/tgpt/proxy.txt

    Example:

    http://127.0.0.1:8080
    

    Uninstalling

    If you installed with the install script, you can execute the following command to remove the tgpt executable

    sudo rm $(which tgpt)
    

    Configuration file is usually located in ~/.config/tgpt on GNU/Linux Systems and in "Library/Application Support/tgpt" on MacOS