npm

Simplifying the command-line experience

Bridging the gap between natural language and the command-line interface with AI

zsh
bash
~ ai get my ip address
🤔 AI Thinking...
✅ AI Responded!
command: curl ifconfig.me
description: This command will fetch your public IP address
Run this command? (y/n) y
Executing command: curl ifconfig.me
123.45.67.123

Introduction

Getting started

Learn how to get up and running with Cookie AI CLI. This guide covers installation, configuration, and basic usage.

Installation

Step-by-step guide to installing Cookie AI CLI and setting it up on your system.

Configuration

Detailed instructions on how to configure Cookie AI CLI, including service types and model settings.

Adaptive Error Handling

Discover how Cookie AI CLI learns from command errors to suggest corrective actions.

How to Contribute

Join the development of Cookie AI CLI and help improve command-line interactions for everyone.

The quick links above provide step-by-step guides to setting up your system and installing the library. If you're looking for the quick start guide, continue reading below.


Quick start

Cookie AI CLI is a powerful tool that integrates natural language processing with command-line operations, enabling users to execute CLI commands using simple, natural language inputs. It is ideal for users unfamiliar with CLI syntax or those looking to streamline their command-line workflow.

Installing dependencies

Install Cookie AI CLI globally using npm or your package manager of choice. This will make the ai command available globally on your system.

npm install cookie-ai-cli -g

After installation, you can start using Cookie AI CLI to interpret natural language prompts into executable CLI commands.

Configuring the cli

Configure your Cookie AI CLI by initializing your settings with the ai --init command. This will prompt you to input your preferred AI service, endpoint, and optional API key.

Here's an example configuration for the OpenAI service:

{
  "service": "openai",
  "model": "gpt-4",
  "openai": {
    "key": "<your-open-ai-api-key>"
  }
}

For more detailed configuration options, refer to our Configuration Guide.

Customization

Cookie AI CLI is highly customizable, supporting various AI models and custom API endpoints.


Basic usage

Start by inputting your command after the ai command in your terminal. Cookie AI CLI interprets your natural language input and provides executable CLI commands.

Your first command

Try a simple command to get a feel for how Cookie AI CLI works:

ai list files in the current directory

Example response:

🤔 AI thinking...
✅ AI responded!
command: ls
description: Lists all the files in the current directory
Run this command? (y/n)  y
Executing command:  ls

The CLI will interpret your request and execute the corresponding command to list files.

Advanced Usage

For more complex commands or when using special characters, enter the CLI first:

ai
> Enter your command: find a file named 'config.json'?

Example response:

🤔 AI thinking...
✅ AI responded!
command: find . -name 'config.json'
description: Searches for a file named 'config.json' in the current directory and all subdirectories
Run this command? (y/n)  y
Executing command:  find . -name 'config.json'

Getting help

If you encounter any issues or have questions, there are several ways to get assistance.

Submit an issue

Found a bug or have a feature request? Submit an issue on our GitHub repository.

Join the community

Connect with other users and contributors in our community Discord server. Share tips, ask questions, and get the latest updates about Cookie AI CLI.