CLIXtract is a deterministic CLI parsing engine for network devices. It converts raw CLI output into structured JSON
using a local LLM (Ollama). The system is designed to extract only explicitly present fields and never invent data.
Missing values are returned as "N/A".
Makefile # Build and utility commands
common/ # Shared utilities and helpers
llm/ # LLM clients and wrappers
main.py # FastAPI server entry point
prompts/ # System prompts and instructions
postman/ # Example Postman requests
requirements.txt # Python dependencies
schema/ # JSON schemas (optional)
settings.json # Configuration for LLM, server, and models
TODO.txt # Notes and tasks
version.json # Project version info
- Python 3.12+
- Ollama installed and model downloaded (e.g.,
llama3.1:latest) - macOS/Linux (Metal GPU recommended)
pipfor Python dependencies
- Create virtual environment and install dependencies:
make prepare-venv- Start Ollama server:
ollama serveCheck that your model is available:
ollama list- Format code:
make formatFormats Python code with black and isort.
- Clean project:
make cleanRemoves temporary files and virtual environment.
- Prepare virtual environment:
make prepare-venv- Run FastAPI server:
make run-serverServer port is picked from settings.json.
Endpoint: /parse-cli
Method: POST
Content-Type: application/json
Example for show version:
{
"command_name": "show version",
"command_output": "Cisco IOS Software, C3750X Software (C3750X-UNIVERSALK9-M), Version 15.2(6)E2, RELEASE SOFTWARE ...",
"user_instruction": "Extract software version (sw), firmware version (fw), hardware type, IOS version, system serial number, system image. Return strictly valid JSON. Use 'N/A' if not available."
}Example for show interface:
{
"command_name": "show interface",
"command_output": "GigabitEthernet1/0/1 is up, line protocol is up\n Hardware is Gigabit Ethernet, address is 001a.2b3c.4d5e (bia 001a.2b3c.4d5e)\n MTU 1500 bytes, BW 1000 Mbps, DLY 10 usec, ...",
"user_instruction": "Extract interface name, status, protocol, hardware, MAC address, MTU, bandwidth. Return strictly valid JSON. Use 'N/A' if not available."
}{
"sw": "C3750X Software (C3750X-UNIVERSALK9-M)",
"fw": "N/A",
"hardware": "WS-C3750X-24T-S",
"ios_version": "15.2(6)E2",
"serial_number": "FDO12345678",
"system_image": "flash:c3750x-universalk9-mz.152-6.E2.bin"
}- System prompts are in
prompts/system_prompt.txt. - They define parsing rules and instructions for the LLM.
- Always returns a strict JSON array, or an empty array
[]if no valid objects are found.
- Only strictly present fields in CLI output are included; missing fields return
"N/A". - LLM client settings are configured via
settings.json. - FastAPI server returns JSON for any network CLI command provided.
The postman/ folder contains example requests you can import to test the API.
See TODO.txt for ongoing tasks and improvements.