Skip to main content

No project description provided

Project description

Term-Assistant

Term Assistant is a command-line tool designed to assist users with prompt-based responses from various models. It supports customizable contexts, different models and providers, and options for managing input and output behaviors.

Installation

To install Term Assistant, you can use pip to install.

$ pip install term-assistant

Or you can install the whl file in releases.

Also, you can install the package from the source code, see the Contributing section.

Usage

The tool must run in tmux context ($TMUX environemnt variable must be set) since it uses tmux to capture the terminal history.

Config

You can copy the assistant.yaml.example to your home directory and rename it to assistant.yaml.

You can fill your API keys to the providers section, for example

...
providers:
  openai:
    base_url: ''
    api_key: 'sk-abc123456'

After filling the key, you can use all openai models.

More Providers

Term Assistant uses litellm as the SDK, so you can use any provider and model that litellm supports.

The full list of providers and models can be found in the litellm documentation.

To use a provider, you need to fill the api_key in providers section in the config file (even if the key is not required for that provider, e.g., ollama).

The base_url is optional, and you can leave it empty if you are using the official providers.

Advanced Config

  • generation.temperature: The temperature setting for the model.
  • generation.top_p: The top-p setting for the model.
  • generation.with_tools: Whether to use the tools in the generation.
  • default_model: The default model to use.
  • default_system_message: The default system message name to use. See the system_messages section.
  • contexts: The contexts to use.
  • history_context_options.size: The nunber of lines of the history context.
  • history_context_options.all_panes: Whether to use all panes in the history context.
  • system_messages: The list of available system messages, and you can add your own ones.

Example

Ask what happened in this session:

term_assistant talk "what happened"

You can specify the model if you do not want to use the default model:

term_assistant talk "what happened" -m openai/gpt-4o-mini

You can also specify the system messages:

term_assistant talk "how to install nginx" -s "another_assistant_prompt"

Or you can directly pass the system message:

term_assistant talk "how to use tmux" -s "You are a terminal assistant, and you must not answer the questions unrelated to terminal."

Logging

The chat context, user prompts, model responses, etc. will be recorded to the log file ~/.assistant.log.

Contributing

If you would like to contribute to the project, please submit a pull request or create an issue regarding any bug or idea for improvement.

You can download the repository and install the development dependencies.

$ git clone https://github.com/SiriusKoan/term-assistant.git
$ poetry install

Also you can build the package and install it locally.

$ poetry build
$ pip install dist/term_assistant-0.1.0-py3-none-any.whl

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

term_assistant-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

term_assistant-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file term_assistant-0.1.0.tar.gz.

File metadata

  • Download URL: term_assistant-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.12.6-amd64

File hashes

Hashes for term_assistant-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90f8b77e0ddef0c1934cf4e023f0c0928e2b5108536f4c19cd9fca2a5a75831a
MD5 954894ac7300f3a3f1a805eb339e569e
BLAKE2b-256 0cd319191081fab5341ce9b67c87283f9ef3a4d5f8e6ea9fe01b4d24f42ea281

See more details on using hashes here.

File details

Details for the file term_assistant-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: term_assistant-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.12.6-amd64

File hashes

Hashes for term_assistant-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 607b22f77de4e1f07f27759e6f54335fc8501bab9eb335aff94f2de85ba8d351
MD5 72974fe2720092857115a1dfd51b220e
BLAKE2b-256 0e29b6de3cbd81c8ae3809f3b6ddad22dfed60a1d9f23c540d040f362569107c

See more details on using hashes here.

Supported by

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