Skip to main content

Dragon CLI

1785346956957

License: MIT Python 3.10+ Docs GitHub stars GitHub issues

Chat with local GGUF LLMs (100% CPU, via llama-cpp-python), with optional MCP (Model Context Protocol) tool-calling and a SQLite-backed conversation history.

Install

pip install -e .
dragon-cli-install-llm

This exposes a dragon-cli command. llama-cpp-python is intentionally kept out of the core dependencies, since it ships as C++ source on PyPI for many platforms — a plain pip install would try to compile it locally and fail without a C/C++ toolchain (Visual Studio Build Tools on Windows, gcc on Linux, Xcode command line tools on macOS).

dragon-cli-install-llm detects your OS/architecture (Windows, Linux, or macOS) and installs a prebuilt CPU wheel instead, so a compiler usually isn't needed at all. If no prebuilt wheel is available for your exact platform/Python combination, it prints the toolchain to install and the fallback command to run.

If you already have a working C/C++ toolchain and would rather build from source yourself, skip the installer and use the extra instead: pip install -e ".[llm]".

You can also run it without installing:

python dragon_cli.py
# or
python -m dragon_cli

Usage

dragon-cli                       # model menu + chat
dragon-cli --model 2             # skip the model menu
dragon-cli --list                # just list the model catalog
dragon-cli --no-mcp              # disable MCP connectors
dragon-cli --resume 3            # resume saved conversation #3
dragon-cli --list-conversations  # list saved conversations and exit
dragon-cli --db path/to/other.db # use a different conversation database
dragon-cli --serve               # serve the model over HTTP instead of chatting
dragon-cli --serve --port 8080   # custom port (default: 8000)
dragon-cli --serve --host 0.0.0.0  # expose beyond localhost (e.g. to your LAN) — opt-in only

HTTP server (--serve)

dragon-cli --serve loads a model and exposes it over a minimal OpenAI-compatible HTTP API instead of starting the interactive chat. It's built on FastAPI, so interactive docs come for free:

  • GET / — landing page with usage examples
  • GET /docs — Swagger UI
  • GET /redoc — ReDoc
  • GET /openapi.json — raw OpenAPI schema
  • GET /v1/models — lists the currently loaded model
  • POST /v1/chat/completions — same shape as OpenAI's endpoint, streaming ("stream": true, server-sent events) and non-streaming both supported, request body validated (422 with a clear error on malformed input)

Point any OpenAI-compatible client/SDK at http://127.0.0.1:8000/v1 (adjust host/port to match --host/--port) and it works without extra glue code. This mode does not expose MCP tool-calling — it's the model only, kept intentionally simple and predictable. It also binds to 127.0.0.1 by default (only reachable from your own machine); pass --host 0.0.0.0 explicitly if you want it reachable from other devices on your network.

In-chat commands

Command Description
/help show available commands
/models list the model catalog
/tools list connected MCP tools
/mcp show MCP server connection status
/clear clear the current in-memory history
/new [title] start a new conversation
/list list saved conversations
/resume <id> resume a saved conversation
/rename <id> <title> rename a saved conversation
/delete <id> delete a saved conversation
/search <text> search saved messages for text
/export <id> [md|json] export a conversation to a file
/exit, /quit end the program

Every message is autosaved to SQLite (dragon_cli.db by default) as soon as it's sent, so nothing is lost if the process crashes.

MCP connectors

On first run, an example mcp_servers.json is created in the working directory. Edit it to point at your MCP servers and restart to connect.

Project layout

src/dragon_cli/
├── cli.py            # argparse entry point
├── app.py             # model selection + orchestration
├── setup_llm.py        # cross-platform llama-cpp-python installer
├── server.py            # OpenAI-compatible HTTP server (--serve)
├── banner.py            # ASCII banner
├── config.py             # shared paths/colors
├── models/            # model catalog, download, loading
├── mcp/                # MCP server manager + tool-call parsing
├── storage/            # SQLite conversation store
└── chat/                # chat session, streaming, slash commands

Metadata

Release files for dragon-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dragon-cli 0.2.0
File Size Uploaded Provenance
dragon_cli-0.2.0.tar.gz 51.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dragon-cli 0.2.0
File Interpreter ABI Platform
dragon_cli-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 109.1 kB

Release files / dragon_cli-0.2.0.tar.gz

Download URL dragon_cli-0.2.0.tar.gz
Size 51.1 kB
Tags Source
SHA-256 checksum
How to use checksums
308c180890a02cb377bdf1c3aa3b21ac04b9ec0a5364493a5f5c38b910e82600
BLAKE2b-256 checksum
How to use checksums
d13ce68790c47d8cbebd4b76a6deaa749e42a6b043e146e54f7fab7b2e7f11b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dragon_cli-0.2.0-py3-none-any.whl

Download URL dragon_cli-0.2.0-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2331a2480caa873814161144f4c7111139e586b87ea25debaf4ba6ce2ae115c3
BLAKE2b-256 checksum
How to use checksums
2ac17c411f57daa64fbfa7cec1342d7303fe033f251134dc675fb7a121dde476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for dragon-cli 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page