Skip to content

Large language model in the terminal! Less `--help` and `man` and more getting stuff done

License

Notifications You must be signed in to change notification settings

closedloop-technologies/autocomplete-sh

Repository files navigation

Autocomplete.sh

--help less, accomplish more: Command your terminal

Command your terminal with intelligent suggestions

Autocomplete.sh adds AI-powered command-line suggestions directly to your terminal. Just type <TAB><TAB> and it calls an LLM (OpenAI by default) to return the top suggestions for you.

Autocomplete.sh Demo

Use natural language without copying between CoPilot or ChatGPT

Quick Start

wget -qO- https://autocomplete.sh/install.sh | bash

Features

  • Context-Aware: Considers terminal state, recent commands, and --help information
  • Flexible: Supports various LLM models, from fast and cheap to powerful
  • Secure: Enables local LLMs and sanitizes prompts for sensitive information
  • Efficient: Caches recent queries for speed and convenience
  • Cost-Effective: Monitors API call sizes and costs

Supported Models

We support OpenAI, Groq, Anthropic, and Ollama models. Configure your model with:

autocomplete model

Model Selection

How It Works

Autocomplete.sh provides faster, more accurate suggestions by considering:

  • Your machine's environment
  • Recently executed commands
  • Current directory contents
  • Command-specific help information

View the full prompt with:

autocomplete command --dry-run "your command here"

Tips and Tricks

  1. For command parameters: ffmpeg # reformat video to fit youtube then <TAB><TAB>
  2. For complex tasks: # create a github repo, init a readme, and push it then <TAB><TAB>

Configuration

source autocomplete config

Configuration Options

Update settings with:

autocomplete config set <key> <value>

Usage Tracking

autocomplete usage

Usage Statistics

Use Cases

  • Data Engineers: Manipulate datasets efficiently
  • Backend Developers: Deploy updates swiftly
  • Linux Users: Navigate systems seamlessly
  • Terminal Novices: Build command-line confidence
  • Efficiency Seekers: Streamline repetitive tasks
  • Documentation Seekers: Quickly understand commands

Development

Local Installation

git clone git@github.com:closedloop-technologies/autocomplete-sh.git
ln -s $PWD/autocomplete.sh $HOME/.local/bin/autocomplete
. autocomplete.sh install

Testing

sudo apt install bats
bats tests

Docker Testing

docker build -t autocomplete-sh .
docker run --rm -e OPENAI_API_KEY=$OPENAI_API_KEY autocomplete-sh

Maintainers

Currently maintained by Sean Kruzel @closedloop at Closedloop.tech

Contributions and bug fixes are welcome!

Support Open Source

The best way to support Autocomplete.sh is to just use it!

If you want to help me keep up the energy to build stuff like this, please:

"Buy Me A Coffee"

License

See the MIT-LICENSE file for details.

About

Large language model in the terminal! Less `--help` and `man` and more getting stuff done

Resources

License

Stars

Watchers

Forks

Packages

No packages published