9Octopus CLI is a powerful, open-source AI coding agent that lives in your terminal. It empowers developers to interact with Large Language Models (LLMs) directly from the command line, enabling seamless coding assistance, file manipulation, and system automation.
Whether you want to use our backend service or connect directly to your favorite LLM provider (OpenAI, Anthropic) with your own API keys, 9Octopus gives you the flexibility and power you need.
- 🤖 AI Agent in Your Terminal: Chat with advanced LLMs without leaving your workflow.
- 🔌 Direct LLM Connection (BYOK): Connect directly to OpenAI or Anthropic using your own API keys. No middleman required.
- 🛠️ Tool Integration: The agent can read files, write code, run shell commands, and search your codebase.
- 🧠 Custom System Prompts: Tailor the agent's personality and capabilities with a
9octopus.system.mdfile. - 🔒 Privacy First: In Direct Mode, your data goes straight to the LLM provider.
- ⚡ LangGraph Powered: Built on the robust LangGraph framework for reliable agentic workflows.
npm install --global @9octopus/9octopus-cliBefore you start, you can configure your preferred model and provider.
Direct Mode (Recommended for Developers) To use 9Octopus with your own API keys, simply set the environment variables:
export 9OCTOPUS_SERVICE=false
export OPENAI_API_KEY=your_openai_key
# OR
export ANTHROPIC_API_KEY=your_anthropic_key
export GOOGLE_API_KEY=your_google_api_key
export GROK_API_KEY=your_grok_api_keyStart the interactive chat session:
9octopus-cliOnce inside the CLI, you can use slash commands to control the agent:
/models: List and manage available models./clear: Clear the conversation history./help: Show available commands./exit: Exit the CLI.
Want to customize how 9Octopus behaves? Create a 9octopus.system.md file in your project root. The agent will read this file and use it as its system prompt.
# 9octopus.system.md
You are a senior React developer. Always prefer functional components and hooks.9Octopus is built with a modular architecture:
- Core: Handles API communication, session management, and tool execution.
- UI: Built with Ink for a rich terminal user interface.
- Agent: Powered by LangGraph to manage conversation state and tool usage.
We welcome contributions! Please see our CONTRIBUTING.md for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the 9Octopus Team