Skip to main content

Generate Unix commands in the terminal

Project description

Cliff: Generate Unix Commands in the Terminal

CI codecov PyPI Version

Cliff (Command Line InterFace Friend) is an AI assistant that helps you come up with Unix commands. Given an objective (for example, "kill the process running on port 8080"), Cliff will generate a command that does the objective and add it to your paste buffer for you to easily paste into your terminal.

demo

Cliff is compatible with LLMs from closed-source providers (OpenAI, Anthropic etc.), inference providers (Groq, Cerebras, etc.), as well as local models running with Ollama.

Why?

It's annoying having to open the browser when I forget how to do something in the terminal.

Requirements

Installation

You can install Cliff with homebrew:

brew install pkelaita/tap/cliff

Or with pip:

pip install cliff-cli

If installing with pip, it's recommended to use pipx or another isolated environment manager since Cliff is a globally-installed application.

Configuration

If you'd like to use models from an API-based provider, add its credentials as follows:

cliff --config add [provider] [api key]

The provider can be any of openai, anthropic, google, cohere, groq, replicate, mistral, or cerebras.

Otherwise if you want to use a local model, add it like this:

cliff --config add ollama [model]

For the full list of supported models and providers, see Cliff's Supported Models.

Configuration tips

  • In order to use local models, make sure you have Ollama installed and running and have the model loaded (their docs).
  • If you add multiple models, you can set your default model with: cliff --config default-model [model].

For a full overview of the configuration system, run cliff --config help.

Usage

Get started by running cliff with an objective.

cliff kill the process running on port 8080

Cliff will automatically add the command to your paste buffer, so no need to copy-paste it.

If needed (i.e., to avoid escaping special characters), you can use quotes.

cliff "kill the process that's running on port 8080"

If you want to specify which model to use, you can do so with the --model or -m flag.

cliff --model gpt-4o-mini kill the process running on port 8080

To view the man page, run cliff with no arguments.

Chat Memory

By default, Cliff has chat memory enabled with a sliding window size of 10 turns. You can view your memory with cliff --memory show and clear it with cliff --memory clear.

If you'd like to change the window size, run cliff --config memory-window [new size]. If you want to disable memory, just set the window size to 0.

Command Notepad

Cliff's chat memory does not have access to command outputs, but you can optionally share them with Cliff to help it debug and improve its responses via its command notepad.

  • To run a command and store its output for Cliff, run cliff --notepad run [command].
  • To view your command notepad, run cliff --notepad show, and to clear it, run cliff --notepad clear.
  • -n can be used as an alias for --notepad.

Tip: You'll usually have to put quotes around your command if it contains special characters – e.g., cliff --notepad run "ps ax | head -n 10" – for Cliff to properly capture and execute it.

Other Useful Features

  • The default generation timeout is 20 seconds. You can change it by running cliff --config timeout [new timeout].
  • To view your configuration, run cliff --config show.
  • You can run cliff --clear as a shortcut to clear both Cliff's chat memory and command notepad.

That's it! It's pretty simple which is the point.

Planned Features

  • Regular updates with new models, etc.
  • UX improvements: cosmetic updates, model aliases, etc.
  • Not sure what else this thing really needs, but open to suggestions!

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

cliff_cli-0.5.2.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

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

cliff_cli-0.5.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file cliff_cli-0.5.2.tar.gz.

File metadata

  • Download URL: cliff_cli-0.5.2.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cliff_cli-0.5.2.tar.gz
Algorithm Hash digest
SHA256 7bbf33e10590f3e655604f0e7bcf9a2ba471b679469f0d8809bb5cde6c7d1260
MD5 43d9887f6643a75c16bf336b4e95de2f
BLAKE2b-256 b28fc9a370a2c4ef947d479d0ef05e88707bb41d904d51361d8aef9f93df9e58

See more details on using hashes here.

File details

Details for the file cliff_cli-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: cliff_cli-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cliff_cli-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebbcf3ed1b76c19668d490e6b40f1301d8c5ed6119e268431d1bfd92457898ad
MD5 336ebe239e1a5dc6466fd86b8843cbf4
BLAKE2b-256 eb9c8afe456b6e4ab2e98bc423ce5aa859b2ba6a8ef93d081550d7786e7f7e4c

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