Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

App Logo

Connpy (v6.4.0b4)

Connpy is a powerful Connection Manager and Network Automation Platform for Linux, Mac, and Docker. It provides a unified interface for SSH, SFTP, Mosh, Telnet, kubectl, Docker pods, and AWS SSM.

The v6 release introduces a comprehensive AI Copilot and AI Playbook Engine, transforming your terminal into an interactive network assistant that understands your device outputs, configures parameters safely, and runs simulations.


1. 🤖 AI System

1a. Terminal Copilot (Ctrl+Space)

Invoke the context-aware AI Copilot directly inside any active terminal session by pressing Ctrl + Space.

  • Context Modes: Cycles through LINES (sends raw scroll buffer), SINGLE (captures exactly one command + output block), and RANGE (logical group of recent commands) using Ctrl+Up/Down.
  • Slash Commands (/): Control the AI persona, safety settings, and mission mode:
    • /mission [objective]: Start an autonomous multi-step investigation mission with human approval.
    • /cancel: Abort active mission.
    • /architect / /engineer: Swaps the agent between high-level strategist and technical executor.
    • /trust / /untrust: Configures auto-run behavior for suggested non-destructive commands.
    • /os [system]: Manually overrides target OS parsing rules (e.g. /os cisco_ios).
    • /prompt [regex]: Overrides command prompt detection bounds.
    • /clear: Clear context history.

1b. AI Chat (conn ai)

Start a standalone persistent session with the AI Copilot. Manage sessions using --list, --resume, --session <id> (to restore a specific history), --delete <id>, or send a quick single-shot question directly from the terminal prompt:

conn ai "how do i check bgp summary on cisco?"

1c. MCP Integration (Client & Server)

Connect to external data sources and tools dynamically, or expose connpy as a native MCP server for external agents (Claude Desktop, Cursor, IDEs):

# MCP Client: Manage connected MCP servers
conn ai --mcp                        # Interactive configuration wizard
conn ai --mcp list                   # List configured MCP servers
conn ai --mcp add <name> <url> [os]  # Add a remote SSE MCP server

# MCP Server: Serve connpy inventory, diagnostic tools, and playbooks
conn ai --mcp serve                  # Standard I/O mode (default, for local clients)
conn ai --mcp serve --sse --port 8080 # Remote SSE mode
conn ai --mcp serve --trust          # Enable inventory mutations (CRUD) & configuration commands

1d. Local Interactive Shell (conn shell)

Launch a local interactive shell with AI Copilot support enabled directly on your host machine:

conn shell                     # Start local shell (default: $SHELL or /bin/bash)
conn shell -c /bin/zsh         # Override shell executable
conn shell --capture session.log # Log session output to file
  • Nested Sessions & Passthrough: Supports running nested conn / connpy connections inside conn shell. Automatically detects foreground conn processes and forwards Ctrl+Space down to the active device connection instead of triggering the local Copilot.
  • Shell Configuration: Configure default shell command, prompt regex, or OS type via conn config:
conn config --shell-command /bin/zsh
conn config --shell-prompt "\$\s*$"
conn config --shell-os ubuntu

2. ⚙️ Automation & Playbooks

2a. Quick Run (conn run)

Run commands in parallel directly on target nodes or folder structures:

conn run router1 "show interface"

2b. YAML Playbook Engine

Execute complex structured automation playbooks defined in YAML configuration files. Supports multi-task execution, variables (using global, per-node, or regex matching definitions), timeouts, and variable parallel execution bounds.

# example_playbook.yaml
- name: Verify Network Operations
  hosts: "@office"
  parallel: true
  tasks:
    - name: Get interface brief
      run: "show ip interface brief"
    - name: Check OSPF state
      run: "show ip ospf neighbor"
      test: "FULL"

Execute using the playbooks runner:

conn run example_playbook.yaml

2c. AI-Assisted Automation

Leverage AI to generate playbook templates (--generate-ai), simulate command changes before execution (--preflight-ai), or analyze consolidated execution logs post-run (--analyze). Use --test "expected text1" "expected text2" to specify assert-style output validations.

  • To generate an empty template: conn run --generate

3. 📂 Inventory Management

3a. Nodes

Manage connections using standard commands: add (conn --add node1), edit (conn --mod node1), delete (conn --del node1), show configuration (conn --show node1), or connect (conn node1).

3b. Profiles

Define credentials and templates globally and reference them inside node fields using the @profile_name placeholder. Manage profiles interactively or via commands:

conn profile -a profile_name
# Or equivalently:
conn -a profile profile_name

During the interactive conn --add prompt, you can input @profile_name in the username or password fields to reference it.

3c. Folders, Move, Copy, List

Organize nodes into logical folder hierarchies (@office, @datacenter@office). Move items (conn move [src] [dst]), copy (conn copy [src] [dst]), or list items with custom filters and formatting:

conn list nodes --filter ".*-prod" --format "{name} ({host}) runs {protocol}"

3d. Bulk, Export, Import

Bulk import connections from formatted text files (conn bulk -f nodes.txt), or export/import connection folders using YAML configurations (conn export @folder > backup.yaml / conn import backup.yaml).

3e. Tags System

Customize connection settings dynamically using tags. Configure per-node settings like custom OS types (os), prompt regex rules (prompt), and page length triggers (screen_length_command).

# Custom tags dictionary (YANG / VSR context)
tags: { "os": "cisco_ios", "prompt": ".*#", "screen_length_command": "terminal length 0" }

4. 🔌 Protocols & Connection Features

4a. SSH / SFTP / Mosh / Telnet / kubectl / Docker / AWS SSM

Connect to various architectures using native protocols:

  • SSH / Telnet: Standard CLI protocols.
  • Mosh: Mobile Shell with roaming and local echo support.
  • SFTP: Transfer files securely (conn --sftp node).
  • Docker: Connect directly to local container names (host set to container name/ID).
  • Kubernetes (kubectl): Connect to pods (namespace customizable via options).
  • AWS SSM: Connect to EC2 instances using Instance IDs as hosts.

4b. Jumphosts

Support for single or chained intermediate gateway nodes (SSH, Mosh, SSM, kubectl, or docker jumphosts) to tunnel traffic safely into target environments.

4c. Debug Mode, Keepalive, Logging

Track connection steps (conn --debug node), set idle keepalive intervals (conn config --keepalive <seconds>), or define dynamic output log files using variables like ${unique}, ${host}, ${port}, ${user}, ${protocol}, or ${date 'format'}.


5. 🖥️ Remote Capture (conn capture - Core Plugin)

Perform remote packet capture (tcpdump) on hosts over secure SSH or Mosh reverse tunnels and stream packets live into your local Wireshark GUI:

conn capture router1 eth0 -w -f "port 80"
  • Requirements: Local installation of Wireshark or tshark is required for live piping (-w).
  • Advanced flags: Specify network namespaces (--ns <name>), custom filters (-f <filter>), or configure the Wireshark local path (--set-wireshark-path).

6. 🛡️ Context Filtering

Prevent accidental command execution in production by setting active regex contexts. This hides non-matching inventory items and restricts execution scope:

conn context production -a --regex ".*-prod"
conn context production --set
  • Manage Contexts: List defined filters (conn context --ls), show context details (conn context production -s), or delete contexts (conn context production -r).

7. 🔌 Plugin System

Extend connpy features and hook into core execution events (pre/post hooks) by writing Python scripts. Add, update, delete, or list plugins locally, or execute them on remote instances:

conn plugin --add my_plugin script.py
conn plugin --update my_plugin script.py
conn plugin --remote --sync

8. ⚙️ gRPC Client-Server Architecture

8a. Server (start/stop/restart/debug)

Execute tasks on a centralized remote host. Start gRPC server (conn api -s 50051), stop (conn api -x), restart (conn api -r), or debug in the foreground (conn api -d).

8b. Client Config

Shift the local CLI to communicate with a remote server instance:

conn config --service-mode remote
conn config --remote localhost:50051

8c. User Management & API Tokens

Manage server-side user credentials and Personal Access Tokens (PAT) for automated setups:

conn user --add username
conn user --list
conn user --regen-password username

# Personal Access Tokens (PAT) for non-interactive API access
conn user --create-token "CI/CD Token" --expires-in 30
conn user --list-tokens
conn user --revoke-token <token_id>

Use --path to specify custom configuration folders in server Mode B. Pass API tokens via CONNPY_TOKEN environment variable.

8d. SSO / OIDC

Configure identity providers (e.g. Authelia, Keycloak) for SSO gRPC authentication using the interactive wizard:

conn sso --add provider_name

8e. Login / Logout

Authenticate client sessions (conn login [username]), check connection status (conn login --status), or close sessions (conn logout).


9. ⚡ Installation & Configuration

9a. pip install

pip install connpy

9b. Shell Completion + FZF

Install autocompletions and fuzzy-search wrappers into your shell profile:

eval "$(conn config --completion bash)"
eval "$(conn config --fzf-wrapper bash)"

9c. conn config options

View configuration details (conn config) or customize variables like case sensitivity (--allow-uppercase), FZF list picker (--fzf true), configurations directory (--configfolder), or persistent AI API keys and models (--engineer-model).

9d. Theming

Customize CLI panel styles and colors by pointing to built-in presets or external YAML styles:

conn config --theme /path/to/theme.yaml

10. 🔒 Privacy, Security & Synchronization (conn sync)

Encrypts inventory and profiles locally via RSA/OAEP. Backup and sync configurations to Google Drive manually (conn sync --once, --list, --restore) or schedule auto-sync. Segregate restores (--nodes / --config) or sync remote nodes with --sync-remote.


11. 🐍 Python API

Embed connection and automation routines programmatically in Python:

import connpy

# 1. Direct single node interaction
router = connpy.node("router1", "1.1.1.1", user="admin")
router.run(["show ip int brief"])
print(router.output)

# 2. Parallel nodes execution with variables
config = connpy.configfile()
nodes_info = config.getitem("@office", ["router1", "router2"])
routers = connpy.nodes(nodes_info, config=config)
variables = {
    "router1@office": {"id": "1"},
    "__global__": {"mask": "255.255.255.0"}
}
routers.run(["interface lo{id}", "ip address 10.0.0.{id} {mask}"], variables)

# 3. AI Copilot prompts
myai = connpy.ai(connpy.configfile())
response = myai.ask("Show BGP status.")
print(response)

Supports additional programmatic features like node.test(), node.interact(), configfile.encrypt(), connapp embeds, and ClassHook / MethodHook plugin hooks.


12. 🐳 Docker Deployment

Run connpy containerized and silent:

docker compose run --rm connpy-app [command]

Add alias conn='docker compose run --rm connpy-app' to your shell for a transparent container experience.


13. 📜 License

PolyForm Noncommercial 1.0.0

Metadata

Release files for connpy 6.4.0b4

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

Source distribution (sdist)

Source distribution for connpy 6.4.0b4
File Size Uploaded Provenance Actions
connpy-6.4.0b4.tar.gz 274.3 kB Without provenance Details for connpy-6.4.0b4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for connpy 6.4.0b4
File Interpreter ABI Platform Actions
connpy-6.4.0b4-py3-none-any.whl Python 3 none any Details for connpy-6.4.0b4-py3-none-any.whl

Total release size: 585.1 kB

Release files / connpy-6.4.0b4.tar.gz

Download URL connpy-6.4.0b4.tar.gz
Size 274.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b3e79eab50ec919377a34802dfb9b67e2976e5a5e58cc8feaaa04f9b2b41ee53
BLAKE2b-256 checksum
How to use checksums
f40398056128c4b8e6472a278fe844a4c910b0389d45136dc8280dc634c00d64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / connpy-6.4.0b4-py3-none-any.whl

Download URL connpy-6.4.0b4-py3-none-any.whl
Size 310.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78cc1551345782be233ca9fed88b8332c01b6d4d3a170d319591d9bc016ec37f
BLAKE2b-256 checksum
How to use checksums
b786ea97ce5ef0ae20bd95693653a81a681e3f2a5e934d9ba888db78a1a637e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for connpy 6.4.0b4

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
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