cli_buddy 0.0.6 copy "cli_buddy: ^0.0.6" to clipboard
cli_buddy: ^0.0.6 copied to clipboard

A CLI tool to call any AI to ask, auto-complete, and generate code directly from any command line tool.

cli_buddy #

[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] [![License: MIT][license_badge]][license_link]

Generated by the [Very Good CLI][very_good_cli_link] 🤖


Call any LLM from your terminal #

Light weight (2mb) and Fast #

Features #

  1. Ask for code and directly generate (or override) a file with it
    • you can also choose to copy to your clipboard or ask for explanation or chat with it
  2. Ask for shell command and directly execute it in your terminal
    • you can also choose to copy to your clipboard or ask for explanation
  3. Continously chat with AI in your terminal
  4. Save the chat history in json format locally and load it when you start a new session by using -s <session_id>
    • by default saving chat history is disabled

Demo

Getting Started 🚀 #

Installlation if Dark SDK is already installed #

dart pub global activate cli_buddy

Installlation if Dark SDK is not installed #

TODO: Add installation instructions using the binary executable and script

Get API key from OpenRouter which providers unified LLM APIs at the (almost) same cost as original LLM API provider #

Add secret.env #

Create a secret.env file in the root and add:

openrouter_key=YOUR_OPENROUTER_KEY

And then run buddy set -s <path/to/secret.env>

Or

Simply run buddy set -k <your openrouter key> secret.env and buddy.config files will be created at the default path

buddy.config example #

{
  "secret_env_path": "secret.env",
  "default_model": "openai/gpt-4o-mini-2024-07-18",
  "max_tokens": null,
  "temperature": 0.3,
  "top_p": null,
  "top_k": null,
  "frequency_penalty": null,
  "presence_penalty": null,
  "repetition_penalty": null,
  "min_p": null,
  "top_a": null,
  "seed": null,
  "logit_bias": null,
  "logprobs": null,
  "top_logprobs": null,
  "response_format": null,
  "stop": null,
  "save_session": false,
  "cmd_prompt": null,
  "explain_prompt": null,
  "code_prompt":null,
  "chat_prompt": null
}

Usage #

# Suggest command
$ buddy suggest how can I update homebrew

# if you want to use special character use ""
$ buddy suggest "how can I update homebrew?"

# Coding
$ buddy code "Generate a random number between 1 and 10 in dart"

# Chat
$ buddy chat "Tell me about SSH protocol"

# Show CLI version
$ buddy --version

# Show usage help
$ buddy --help

RoadMap #

  • Refractoring
  • Support Rag
  • Installation script for binary executable and set up
  • Support Google Voltex API

Contributions #

Contributions are welcome! Feel free to open issues or submit pull requests.

2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A CLI tool to call any AI to ask, auto-complete, and generate code directly from any command line tool.

Homepage
Repository (GitHub)
View/report issues

Topics

#cli #ai #llm #tool

License

unknown (license)

Dependencies

args, barbecue, cli_completion, dio, dotenv, flat_buffers, freezed_annotation, json_annotation, mason_logger, path, process_run, pub_updater, result_dart

More

Packages that depend on cli_buddy