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.1.tar.gz (118.6 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.1-py3-none-any.whl (126.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sunset_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 118.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sunset_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d392b1735fddecc845af23c492f63ecd064cf404451bba2a0f322b5e3f952031
MD5 5e107ffa6eae02126adb4b13b065120f
BLAKE2b-256 e706aa7a279a0f57e98719822db8453790e0aae5cb6516f37ffefebe9f8ae881

See more details on using hashes here.

Provenance

The following attestation bundles were made for sunset_cli-0.1.1.tar.gz:

Publisher: publish.yml on adam-shlomo/netmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: sunset_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 126.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sunset_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f9f42b682bdeb79e4999f6f5b9f4d61eb0047675a416e65daf7656d38c3361b
MD5 e49710690132b82dc1d05d3feebbca93
BLAKE2b-256 0b3e8fb53c2cfdbd59746b8a284c13ef5af6af057def86f94cdec3117dda41f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sunset_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on adam-shlomo/netmind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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