Skip to content

An intelligent CLI for Docker with two modes: an AI co-pilot that generates commands from natural language, and an offline Learning Mode to master Docker concepts.

License

Notifications You must be signed in to change notification settings

Aj7Ay/docker-ai

Repository files navigation

Docker AI

Docker AI Logo

An AI-powered CLI for Docker.
Chat with an AI to generate Docker commands, or use the local learning mode to master Docker concepts offline.


🚀 Demo

Watch a quick demonstration of docker-ai in action.

Docker AI Demo

docker-ai is a command-line tool that makes it easier to work with Docker by translating natural language into executable commands. It also features a built-in learning mode to help beginners understand core Docker concepts without an internet connection.

Features

  • Interactive Shell: An intuitive shell for running Docker commands.
  • AI-Powered Commands: Generate Docker commands from natural language.
  • Learning Mode: Learn Docker concepts without leaving your terminal.
  • Context-Aware: The AI knows about your running containers.
  • Command History: Easily access your previously used commands.

Installation

Homebrew (macOS)

First, tap the repository:

brew tap Aj7Ay/homebrew-tap

Then, install docker-ai:

brew update
brew install docker-ai

From Source

  1. Clone the repository:
    git clone https://github.com/Aj7Ay/docker-ai.git
    cd docker-ai
  2. Build the binary:
    go build -o docker-ai ./cmd/docker-ai
  3. Move the binary to a directory in your $PATH:
    sudo mv docker-ai /usr/local/bin/

Usage

  1. Set your API Key:

    docker-ai supports Groq, Gemini, and OpenAI. Set the appropriate environment variable for your chosen provider.

    For Groq:

    export GROQ_API_KEY="your-groq-api-key"

    For Gemini:

    export GEMINI_API_KEY="your-gemini-api-key"

    For OpenAI:

    export OPENAI_API_KEY="your-openai-api-key"
  2. Run docker-ai:

    By default, docker-ai uses the Groq provider with the gemma-3n-e4b-it model.

    # This will use Groq by default
    docker-ai

    You can specify a different provider and model with flags. If you only specify the provider, a sensible default model for that provider will be used.

    # Use Groq with its default model (gpt-4o)
    docker-ai --llm-provider=groq
    
    # Use OpenAI with its default model (gpt-4o)
    docker-ai --llm-provider=openai
    
    # Use Gemini with a specific model
    docker-ai --llm-provider=gemini --model=gemini-1.5-pro

Learning Mode

To use the offline learning mode, set the DOCKER_AI_MODE environment variable:

export DOCKER_AI_MODE=learn
docker-ai

Special Commands

  • exit or quit: Exit the interactive shell.
  • reset confirm: Reset the confirmation prompt for cleanup commands.

Configuration

docker-ai will store a configuration file at ~/.docker-ai-config.json to remember your preferences, such as skipping cleanup warnings.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

About

An intelligent CLI for Docker with two modes: an AI co-pilot that generates commands from natural language, and an offline Learning Mode to master Docker concepts.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •