https://github.com/aandrew-me/tgpt
AI Chatbots in terminal without needing API keys
https://github.com/aandrew-me/tgpt
ai chatbot chatgpt cli go golang gpt4 linux llama macos mixtral terminal windows
Last synced: about 2 months ago
JSON representation
AI Chatbots in terminal without needing API keys
- Host: GitHub
- URL: https://github.com/aandrew-me/tgpt
- Owner: aandrew-me
- License: gpl-3.0
- Created: 2023-04-17T14:11:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-10-03T14:43:15.000Z (6 months ago)
- Last Synced: 2026-01-22T01:56:13.063Z (about 2 months ago)
- Topics: ai, chatbot, chatgpt, cli, go, golang, gpt4, linux, llama, macos, mixtral, terminal, windows
- Language: Go
- Homepage:
- Size: 3.24 MB
- Stars: 3,025
- Watchers: 41
- Forks: 324
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- definitive-opensource - tgpt
- awesome-ChatGPT-repositories - tgpt - ChatGPT in terminal without needing API keys (CLIs)
- awesome-software-engineering-tools - tgpt
- awesome-cli-agents - aandrew-me/tgpt - AI Chatbots in terminal without needing API keys [Terminal] (2k⭐) (🚀 AI Tools for Vim, Neovim, and Terminal)
- StarryDivineSky - aandrew-me/tgpt - cpp-python等,提供类似ChatGPT的功能。项目支持多种模型,包括LLaMA、Alpaca等,并允许用户自定义模型。tgpt旨在提供隐私保护的本地AI体验,无需依赖外部API。用户可以通过简单的命令在终端中与AI进行交互,进行问答、文本生成等任务。项目还提供了流式输出、代码高亮等功能,提升用户体验。tgpt的安装和配置相对简单,用户可以根据自己的需求选择合适的模型和参数进行设置。它是一个轻量级、灵活且易于使用的终端AI聊天机器人解决方案,适合对隐私有要求的用户或需要在本地环境中进行AI实验的开发者。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
- awesome-starz - aandrew-me/tgpt - AI Chatbots in terminal for free (Go)
- charm-in-the-wild - tgpt - Conversational AI for the CLI; no API keys necessary. (_built with Bubble Tea_) (Applications / AI)
README

# tgpt 🤖
[](https://github.com/aandrew-me/tgpt)
[](https://github.com/aandrew-me/tgpt/releases/latest)



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

### [Currently available providers](./md/providers.md)
## 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:
```bash
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:
```bash
pacman -S tgpt
```
#### Install with Homebrew
```bash
brew install tgpt
```
### FreeBSD 😈
To install the [port](https://www.freshports.org/www/tgpt):
```
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](https://go.dev/doc/tutorial/compile-install).
```bash
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
```
iex "& { $(irm https://raw.githubusercontent.com/aandrew-me/tgpt/refs/heads/main/install-win.ps1) } -Uninstall"
```
- **Scoop:** Package installation with [Scoop](https://scoop.sh/) can be done using the following command:
```bash
scoop install https://raw.githubusercontent.com/aandrew-me/tgpt/main/tgpt.json
```
- **Chocolatey**
```bash
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, you may update it with
```bash
tgpt -u
```
**It may require admin privileges.**
## [Usage](./md/usage.md)
### 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:
```bash
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