Skip to main content

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] [--environment ENVIRONMENT]
          [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)
  --environment ENVIRONMENT, -e ENVIRONMENT
                        specify environment details (overrides
                        automatic environment detection)

Examples

Basic prompt

> ta unzip a tgz archive

Override AI model configuration

> ta --model openai:gpt-4o follow a file as it updates
> ta -m ...

Override environment detection

> ta --environment "windows 95 dos" list com ports
> ta --environment bash list free drive space
> ta -e ...

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.

Automatically collected information about your system environment will be appended to the end of the string. This information can be overridden using the --environment/-e command.

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.

Testing

Module tests are located in the src/term_assist/test/ directory.

  1. Install docker.
  2. Run run.sh, which will build the docker image and initiate testing inside a container.
  3. Results will be copied to an src/term_assist/test/output in both XML and plaintext log format.

Metadata

Release files for term-assist 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for term-assist 0.6.1
File Size Uploaded
term_assist-0.6.1.tar.gz 50.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for term-assist 0.6.1
File Interpreter ABI Platform
term_assist-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 88.9 kB

Release files / term_assist-0.6.1.tar.gz

Download URL term_assist-0.6.1.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c11106b39ce2174aff3f557a810b97dfe2b1c38fdb950ec1733b4149cc316598
BLAKE2b-256 checksum
How to use checksums
f7ede0d73e5ad4a83dd41b19e5060b6824766b5bbec05c24dd8f72ea1226ea7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / term_assist-0.6.1-py3-none-any.whl

Download URL term_assist-0.6.1-py3-none-any.whl
Size 38.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b65a7f70c516065d6b39c24f5866542a0dee43a9c305ff649ce5435e19e1aa0
BLAKE2b-256 checksum
How to use checksums
e195edce1eea07d325d07b30a35fd34256ad984f5ce64c86fc10f621e4f66848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page