Flux-CLI

Introduction

Python 3.10+MIT LicensedOpenAI-compatible

Flux-CLI is a powerful, open-source AI coding agent that runs directly in your terminal. Inspired by tools like Claude Code CLI and Gemini CLI, it is built from scratch in Python to help you write, refactor, and understand code through natural language.

What is Flux-CLI?

Flux-CLI is not just an LLM wrapper — it is a complete, event-driven agentic system that:

Learning-First Project

This project was created as a learning initiative to deeply understand how AI coding agents work under the hood — from reasoning loops and tool orchestration to streaming architectures and safety systems.

Why "Flux"?

The name reflects constant flow and adaptation. Just as flux in physics is the rate of flow through a surface, Flux-CLI enables a continuous flow of work — reasoning → acting → learning → adapting — through every turn.

What You Can Do

CapabilityDescription
Code UnderstandingRead, search, and explore codebases of any size
File OperationsCreate, edit, and write files with surgical precision
Shell CommandsExecute terminal commands safely with timeout controls
Web ResearchSearch the web and fetch content for up-to-date context
Task ManagementTrack multi-step tasks with session-scoped todo lists
Persistent MemoryRemember user preferences across sessions
Sub-Agent DelegationSpawn specialists for code review and investigation
MCP IntegrationConnect external servers via the Model Context Protocol

Tip

All capabilities are available as tools — the agent decides which to use and in what order. See Tool System for the full catalog.

Architecture at a Glance

The system follows a layered, event-driven architecture:

High-level flow
CLI Entry Point (main.py)
      │
      ▼
Agent Engine (agent/agent.py) ◄── Hook System
      │
      ├──► Context Engine (compaction & pruning)
      ├──► Tool Registry (built-in + MCP + custom)
      └──► LLM Client (AsyncOpenAI wrapper)

Each component is modular, testable, and independently configurable — jump to Architecture for a deep dive.

Next step

Ready to run it? Head to Quick Start and get Flux-CLI working in under 5 minutes.

On this page