Skip to main content

A terminal agent for terminal users.

Project description

Terminal-Agent-X

EN / 中文 / Wiki

Install

pip install terminal-agent-x

Config

You need to add the environment variable OpenAI_KEY to the path. Please get your OpenAI_KEY from OpenAI.

Use python -c "import os;print(os.environ.get('OpenAI_KEY'))" for testing.

Get Started

You can use the tax <prompt> to interact with the model, like:

$ tax write a python code for fibonacci

Use tax -h to get more information.

usage: tax.py [-h] [-k KEY] [--model MODEL] [-i INPUT] [-o OUTPUT] [--url URL] [--show_all] prompt [prompt ...]

Tax: A terminal agent using OpenAI/Claude API

positional arguments:
  prompt                Prompt

options:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     Your key for OpenAI/Claude.
  --model MODEL         Model name. Choose from gpt-3.5/4s or DALLE.
  -i INPUT, --input INPUT
                        Input file. If specified, the prompt will be read from the file.
  -o OUTPUT, --output OUTPUT
                        Output file. If specified, the response will be saved to the file.
  --url URL             URL for API request. Choose from ['openai_gfw', 'openai', 'claude'] or your custom url.
  --show_all            Show all contents in the response.

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.

Anthropic Claude API in not available since July 2023. Please use OpenAI API instead.

License

GNU General Public License v3.0

Development Logs

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.
  • 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 OpenAI 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminal-agent-x-0.1.5.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

terminal_agent_x-0.1.5-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file terminal-agent-x-0.1.5.tar.gz.

File metadata

  • Download URL: terminal-agent-x-0.1.5.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for terminal-agent-x-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c34ed666c6722be74114ffc1baeb10816a4e7a45ae351ba7f2a68bcd03ce99a2
MD5 990533563de9f34dda31cabd8f3e6512
BLAKE2b-256 6053a429693dd48d59e5e37b5f8dfd309befa67ad5a587e2ca3440fe4dda625a

See more details on using hashes here.

Provenance

File details

Details for the file terminal_agent_x-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_agent_x-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd97543c2c62034075c35cabeebf768caa22bd0fa9393615da46706eae50b40
MD5 ff92956dc6bcf2b8534a82e647402ec7
BLAKE2b-256 135e39195b2688cdfffd937ff0ac749091bb87e22a8d81f2d87b7f1274522dcc

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page