Skip to main content

LLM-powered network automation CLI with a Textual TUI

Project description

NetMind

LLM-powered network automation agent -- connect to Cisco IOS routers, talk to an AI that configures them for you.

NetMind uses Claude as the orchestration brain. You describe what you want ("Configure OSPF area 0 between these three routers"), and it discovers the topology, generates the right commands, asks for your approval, applies them, and verifies everything works.


Quick Start

# Clone and enter the project
cd netmind

# Create a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Set your API key
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY

# Run
python main.py

What It Does

  1. You add routers via the Device Manager (Ctrl+D) -- IP, username, password.
  2. You ask NetMind to configure something: "Set up OSPF area 0 on all routers."
  3. Claude discovers the current state by running show commands over SSH.
  4. Claude generates the exact IOS config commands needed.
  5. You review and approve in the approval screen.
  6. Claude applies the config, then verifies the result (neighbors up, routes learned).
  7. If something breaks, there's a checkpoint to roll back.

TUI Controls

Key Action
Ctrl+D Open Device Manager
Ctrl+R Toggle Read-Only / Interactive
Ctrl+L Clear Chat
Ctrl+C Quit
Escape Back (from sub-screens)

Architecture

User (TUI)
    |
    v
ClaudeAgent  <---->  Claude API (tool calling)
    |
    v
ToolRegistry  --->  DeviceManager  --->  DeviceConnection (Netmiko/SSH)
    |                                         |
    v                                         v
SafetyGuard                              Cisco IOS Router
ApprovalManager
CheckpointManager

Key principles:

  • Claude is the brain -- it decides what commands to run and in what order
  • Every config change requires user approval (ApprovalScreen)
  • Checkpoints are created before changes for rollback
  • Read-only mode is on by default

Project Structure

netmind/
├── main.py                         # Entry point
├── netmind/
│   ├── ui/                         # Textual TUI
│   │   ├── app.py                  # Main app class
│   │   ├── screens/                # Main, DeviceManager, Approval screens
│   │   └── widgets/                # ChatPanel, DeviceList, StatusBar
│   ├── core/                       # Device connectivity & safety
│   │   ├── device_connection.py    # Netmiko SSH wrapper
│   │   ├── device_manager.py       # Multi-device management
│   │   └── safety.py               # Approval flow, checkpoints, guard rails
│   ├── agent/                      # Claude integration
│   │   ├── claude_agent.py         # Main agent loop
│   │   ├── tool_registry.py        # Tool definitions
│   │   ├── conversation.py         # Message history management
│   │   ├── system_prompt.py        # Claude's persona and rules
│   │   └── tools/                  # Tool handler implementations
│   ├── protocols/                  # Protocol-specific helpers
│   │   └── ospf.py                 # OSPF verification
│   ├── models/                     # Pydantic data models
│   └── utils/                      # Config, logging, parsers
└── tests/

Safety Model

NetMind starts in read-only mode. Claude can run any show command but cannot make changes.

When you switch to interactive mode (Ctrl+R):

  • Config commands still require explicit approval
  • A config checkpoint is taken before every change
  • Dangerous commands (reload, erase, no ip address) are blocked or flagged
  • Rollback is available if something goes wrong

Testing

# Run all tests
python -m pytest tests/ -v

# Run parser tests only
python -m pytest tests/test_parsers.py -v

Requirements

  • Python 3.10+
  • Access to Cisco IOS devices (GNS3, EVE-NG, or real hardware)
  • Anthropic API key (Claude Sonnet 4.5)

Current Protocol Support

  • OSPF (MVP) -- full configure + verify + troubleshoot
  • BGP, EIGRP, VLANs -- planned

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sunset_cli-0.1.0.tar.gz (118.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sunset_cli-0.1.0-py3-none-any.whl (125.0 kB view details)

Uploaded Python 3

File details

Details for the file sunset_cli-0.1.0.tar.gz.

File metadata

  • Download URL: sunset_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 118.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sunset_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eaa00757fa24c6961816bfee19dd2b690518d6069e548c6e00fdf049912886fc
MD5 0827cb061c8a7efa150a64b3a001582f
BLAKE2b-256 a7a8da0f037ecb4e794af4c6d6974464361fe2b76d3fb093316dfad118a0c1b4

See more details on using hashes here.

File details

Details for the file sunset_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sunset_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 125.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sunset_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc1622697e7454f9107acefaed5d00c2167fcdb58bade7bc859cc310fcafad5d
MD5 3c600fcec92bcea155fe8c3ccbf6f1dc
BLAKE2b-256 5831cb3c8b27d5fa38c9fdea12f7b47f90e5e686540f549d8d8dfc70bae4c0c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page