Skip to main content

An AI assistant for your terminal.

Project description

term-assist

project / repo / mailing list / issues

Code style: black builds.sr.ht status

ℹ️ Note
The canonical project locations are linked above. Other locations are mirrors.

An AI assistant for your terminal.

[screenshot: ta unzip a tgz archive] [screenshot: ta how to exit vim]

Features

  • Works with Anthropic and OpenAI models
  • Configurable parameters: change models, system prompt, response length, and other parameters
  • Automatic environment detection: automatically detects your system and shell environment for accurate responses
  • Automatic copy and paste: optionally copies the generated response to the clipboard and pastes it in your terminal, ready to execute

Installation

  1. Install pipx

  2. Install term-assist using pipx:

    pipx install term-assist
    
  3. In your terminal, configure your API keys depending on which model(s) you want to use.

Usage

usage: ta [-h] [--version] [--model MODEL] [prompt ...]

term-assist: an AI assistant for your terminal.

positional arguments:
  prompt                prompt for the AI model

options:
  -h, --help            show this help message and exit
  --version             display the program version
  --model MODEL, -m MODEL
                        specify a model to use in the format BRAND:MODEL (overrides the setting in your config file)

Examples

> ta unzip a tgz archive
> ta how to exit vim
> ta --model openai:gpt-4o follow a file as it updates

Configuration

The configuration file is ~/.config/term-assist/config.json and will be created on first run and initialized with default configuration parameters if it does not already exist.

See ~/.config/term-assist/config_default.json for the default configuration.

AI configuration

model

The AI model to use.

This parameter should be set in the format BRAND:MODEL. For example, to use OpenAI's GPT-4o model, set this parameter to openai:gpt-4o.

See ~/.config/term-assist/models.json for available models.

max_tokens

The maximum number of tokens that will be generated for output.

temperature

The amount of randomness injected into the response. Ranges from 0.0 to 1.0.

system_prompt

The system prompt that is given to the model.

This prompt must contain the format strings {system} and {shell}, which the program will replace with information it gathers from your system.

Program behavior configuration

auto_copy

If true, automatically copy the AI's response to your clipboard.

auto_paste

If true (and if auto_copy is true), automatically paste the AI's response so it is ready to execute.

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_assist-0.5.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

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

term_assist-0.5.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file term_assist-0.5.0.tar.gz.

File metadata

  • Download URL: term_assist-0.5.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for term_assist-0.5.0.tar.gz
Algorithm Hash digest
SHA256 26dc797d61eb1f297f836ac542873d7cc5c96b9721b89f965019eef6a67cdc7c
MD5 55dd900eb06848ae7528acfe8bf7bc2b
BLAKE2b-256 b293dff3f2cf18683164f83567fa7961d2738a378c2ba80cde5f3a4c0739c798

See more details on using hashes here.

File details

Details for the file term_assist-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: term_assist-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for term_assist-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f49185aa2cfe9faa0caeb0cde66057b16c83623c1dfa7e01602f1395b38f10ac
MD5 3fdc7d4669c8cb13a64519d644364236
BLAKE2b-256 2bb2da11baa8d5349d1a31351c25712862a1bbce8add86b72133af87fa9e75ba

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