https://github.com/lyulumos/terminal-agent-x
A terminal agent powered by OpenAI/Claude/Gemini API
https://github.com/lyulumos/terminal-agent-x
chatgpt claude-api dall-e gemini gpt-4o gpt-4o-mini o1-mini o1-preview terminal vision
Last synced: 5 months ago
JSON representation
A terminal agent powered by OpenAI/Claude/Gemini API
- Host: GitHub
- URL: https://github.com/lyulumos/terminal-agent-x
- Owner: LyuLumos
- License: gpl-3.0
- Created: 2023-05-08T08:22:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-20T16:30:49.000Z (8 months ago)
- Last Synced: 2024-12-15T21:13:17.245Z (5 months ago)
- Topics: chatgpt, claude-api, dall-e, gemini, gpt-4o, gpt-4o-mini, o1-mini, o1-preview, terminal, vision
- Language: Python
- Homepage: https://pypi.org/project/terminal-agent-x/
- Size: 67.4 KB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terminal-Agent-X
[EN](README.md) / [中文](https://github.com/LyuLumos/Terminal-Agent-X/blob/main/README_cn.md)
## Features
- 👻 Easy installation and usage with a single command.
- 🎈 Small size, no additional dependencies required.
- 🐼 Supports English and Chinese on Windows CMD, Powershell, Linux shell, etc.
- 🤖 Compatible with GPT-3.5/4, DALL·E, Claude and Gemini APIs or the third parties.## Install
```bash
pip install terminal-agent-x
```## Config
You need to add the following environment variable:
```bash
export tax_key=sk-xxx
export tax_base_url=YOUR_BASE_URL # optional, default: https://api.openai.com
```Get your key from [OpenAI](https://platform.openai.com/account/api-keys) or Claude API key from [Anthropic](https://www.anthropic.com/claude/) and set it as `tax_key`.
## Get Started
You can use the `tax ` to interact with the model, like:
```bash
$ tax write a python code for fibonacci
```## Usage
| Model | Command | Description |
| :--- | :--- | :--- |
| ChatGPT | `tax ` | Use `gpt-3.5-turbo` to generate content. |
| ChatGPT | `tax --code` | Use `gpt-3.5-turbo` to generate code. If only one line is generated, it will be executed automatically with your permission. |
| GPT-4o-mini | `tax -m gpt-4o-mini` | Use GPT-4o-mini to generate content. |
| GPT-4o | `tax -i image_path -m gpt-4o ` | Upload an image and use GPT-4o to chat. |
| DALL·E 3 | `tax -m dalle` | Use DALL·E 3 to generate image. Currently, only one `1024x1024` image can be generated at a time. |
| Claude | `tax -m claude` | Use Claude to generate content. Use `-k your_claude_key` if you have set key in the environment variable. Only support single chat now. |
| Gemini Pro | `tax -m gemini-pro` | Use Gemini to generate content. Also support `-k google_api_key`. Only support single chat now. |
| Gemini Pro (Vision) | `tax -i image_path -m gemini-pro-vision ` | Upload an image and use Gemini Vision to chat. Also support `-k google_api_key`. || Mode | Command | Description |
| :--- | :--- | :--- |
| Chat with selected model | `tax -m model_name -c` | Chat with the selected model. |
| Use a third-party base url and key | `tax -u -k `| The url and key will be use before the environment variable. |
| Save result to file | `tax -o ` | Save response to a file. |
| Read prompts from file| `tax --prompt_file ` | Read prompt from file, one prompt per line. Please ensure tht you have enough quota. |
| Parallel processing | `tax -p --prompt_file input.txt -o output.txt --option max_workers=3 --option chat_mode=openai` | Set more options for parallel processing. For example, `--option max_workers=3` means that you can run 3 processes at the same time. |## Attention!
You can see a directive after the generated command that says
```
Do you want to execute the command? (y/n)
```
Please execute it or not at your own discretion. I am not responsible for the consequences of generated commands.## License
[GNU General Public License v3.0](LICENSE)
## Development Logs
0.1.x
#### 0.1.0
- Implement basic functions
- Support for Windows cmd and Linux shell
- Add `--file` option for saving the response to a file#### 0.1.1
- Add `--show_all` option for showing all contents of the response.
- Add `--url` option for users not under GFW.
- Add support for Windows Powershell#### 0.1.2
- Add Anthropic Claude API Support. Thanks to [jtsang4/claude-to-chatgpt](https://github.com/jtsang4/claude-to-chatgpt). (deprecated in 0.1.5)
- Add Support for Chinese on Linux and Windows. (also add a temporary solution for VSCode Terminal on Windows).
- Add a timeout function.
- Fix: C++ code block prefix.#### 0.1.3
- Fix: code block prefix bug (tax will act maybe a little faster).
- Modify: simplify the code.
- Test: test for multi-process. Now you can use tax more efficiently in terminal.#### 0.1.4
- Feat: Add support for reading prompt from file.
- Feat: Add support for DALL·E.
- Fix: Resolve the bug of curl command on Windows platform using IPv6 address to access Claude.#### 0.1.5
- Fix: Change api to a third-party proxy. Affected by GFW's DNS domain pollution, the original proxy is temporarily unavailable. `claude-to-chatgpt` is unavailable.
#### 0.1.6
- Feat: Add support for **Chat** on Linux. Now you can use tax as **ChatGPT CLI**!
- Feat: Add support for native Anthropic Claude API on Linux Shell, Windows cmd and Powershell.#### 0.1.7
- Feat: Add support for parallel processing with mode.
#### 0.1.8
- Feat: Add support for `gpt-4-vision-preview` model on all platforms (Beta feature). For example,
```bash
$ tax -i logo.jpg -m gpt-4-vision-preview what is this?
This appears to be a logo or emblem for something called "Most Creative Learning." The design features a stylized triangular shape, possibly an optical illusion known as a Penrose triangle, ...
```
- Refactor: Change the way of URL selection and image input.#### 0.1.9
- Feat: Update DALL·E to `dall-e-3` model.
- Refactor: Change the name of environment variable from `openai_key` to `tax_key`. And some options are also changed. Please check the help message for more details.
- Fix: Fix the bug of `--code` option when generating code to file.### 0.1.10
- Feat: Add support for Google Gemini Pro for single chat.
- Feat: Add support for Google Gemini Pro Vision (Beta feature).
- Feat: Add support for stream mode of OpenAI.### 0.1.11
- Feat: Add support for Anthropic Claude 3 Opus/Sonnet(Vision) API.