cloving-ai / cloving-cli

MIT License
6 stars 1 forks source link

Cloving

An AI pair-programmer for the command line.

LLM-powered shell commands, code generation, commit messages, code reviews, unit test generation, and more. Works with most popular LLMs including OpenAI, Claude, Gemini, Ollama, and more.

asciicast

Cloving CLI is a command line utility which integrates AI into your development workflow.

What makes the Cloving CLI different from other AI tools is that it builds sophisticated context-aware prompts to generate code, commit messages, and more.

Cloving gets to know your specific projects, the frameworks you use, the coding style you prefer, and the patterns you follow, and does its best to generate code that fits your existing project so that it actually works.

It delivers usable code that you can save directly into your project instead of copying and pasting code snippets from chat interactions.

Read the introduction announcement.

[!WARNING]

This project is still in the early stages of development and is not yet stable. Please use it with caution and report any issues you encounter

Features

Important

The cloving will ask you before submitting any prompt to the AI model. You can use the -s or --silent flag to run the command without asking for confirmation, but by default you will have the chance to review all prompts with all the context before submitting them. This is to ensure that you are aware of what is being sent to the AI model and can make any necessary changes before submitting the prompt.

Prerequisites

Installation

You have three options to install and use Cloving:

1. Global Installation via npm

Install Cloving globally using npm:

npm install cloving -g

This allows you to run cloving commands from anywhere in your terminal.

2. Run with npx

You can use npx to run Cloving without installing it globally:

npx cloving [command]

This method downloads and executes Cloving on-the-fly, ensuring you always use the latest version.

3. Clone and Install from Source

For development or to use the latest unreleased features:

  1. Clone this repository:

    git clone https://github.com/cloving-ai/cloving-cli.git
  2. Navigate to the project directory:

    cd cloving-cli
  3. Install dependencies and link the package:

    yarn install
    yarn link

After installation, configure Cloving with your API key and preferred model:

cloving config

Choose the installation method that best suits your needs and workflow. The global npm installation is recommended for most users, while npx is great for one-off usage or trying out Cloving. Cloning from source is ideal for contributors or those who want the absolute latest features.

Usage

Cloving provides several commands to help integrate AI into your development workflow:

Configuration

Configure Cloving with your API key and model:

cloving config

Initialization

Set up Cloving in the current project:

cloving init

Options:

Generating Commit Messages

Generate an AI-powered commit message:

cloving commit

or

cloving generate commit

Options:

Code Reviews

Get an AI-powered code review:

cloving generate review

Options:

Generating Code

Generate code based on a prompt:

cloving generate code

Options:

Generating Shell Commands

Generate a shell command based on a prompt:

cloving generate shell

or

cloving generate sh

Options:

Interactive Chat

Start an interactive chat session with the AI:

cloving chat

Options:

Proxy Server

Start a proxy server to use with Cloving:

cloving proxy

Options:

The proxy server allows you to integrate Cloving with other tools or applications. It starts a local server that can receive requests and forward them to the AI model, returning the responses. This is useful for creating custom integrations or using Cloving in scenarios where a direct CLI interaction isn't suitable.

Token Estimation

Estimate the number of tokens in the current working directory or specified files:

cloving tokens

or

cloving t

Options:

Generating Context

Create a context string for generating prompts outside of the cloving cli:

cloving generate context

Options:

Generating Unit Tests

Generate unit tests for changes or specific files:

cloving generate unit-tests

Options:

Command Line Options

Usage: cloving [command] [options]

Options:

Commands:

Most commands support the following options:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Acknowledgements