Skip to main content

AI for CLI

Project description

CLI-Agent

Talk to cli-agent and it will help you to write bash code to solve your problem.

Installation

pip install cli-agent

Configuration

  • Set the default model to use.

Based on Litellm , so most of the models are supported (https://github.com/BerriAI/litellm)

cli config default_model <model_name>
  • Set the default ask user behavior, when code is about to run it asks user if he wants to run it or not
    • always # ask user always
    • never # ask user never
    • sometimes # ask user when llms suggests to ask
cli config ask_user <always|never|sometimes>
  • Set the retry if generation fails
cli config retry_generation <number>

Usage

Commands:

cli : main cli command ci : direct chat with cli

  1. Make call through the cli command
cli run 'kill the chrome' --model cerebras/llama3.1-70b

or

ci 'convert this.mp4  to 720p and remove the audio' 
  1. If error happens, you can fix it with the following command.

Error-report takes account of the last command it executed, so it will fix the error with the last command

ci ' also flip the video' --model openai/gpt-3.5-turbo --error-report

command line interface

$ cli --help
Usage: cli [OPTIONS] COMMAND [ARGS]...

  CLI AI: Natural Language Command Line Interface

Options:
  --help  Show this message and exit.

Commands:
  config  View or set configuration values
  run     Run the main CLI AI application

$ cli run --help

Usage: cli run [OPTIONS] [USER_INPUT]...

  Run the main CLI AI application

Options:
  --n-hist INTEGER             Number of history items to consider
  --model TEXT                 Model name to use
  -er, --error-report BOOLEAN  Fix the last error with current modifications
  --help                       Show this message and exit.

Recommended models

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

cli_agent-0.1.3.tar.gz (18.3 kB view hashes)

Uploaded Source

Built Distribution

cli_agent-0.1.3-py3-none-any.whl (25.7 kB view hashes)

Uploaded Python 3

Supported by

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