Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

pyinfra

$ pyinfra Official High Risk
pyinfra · Cloud & Infra · MIT · macos / linux / windows

pyinfra automates ad-hoc commands and Python-based state deployments across SSH hosts, Docker containers, and local machines without remote agents. Unlike many provisioning tools, it combines native --dry diffing with --json output (which enforces non-interactive execution).

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
brew install pyinfra
CLI vs MCP Decision CLI Only

Direct SSH/Docker/local Python infrastructure runner with --dry --json; replaces multi-step remote SSH MCP tool calls.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

First-class --json output (automatically disabling interactive prompts) and --dry operation planning make headless automation clean.

  • Native --json output enforces non-interactive execution
  • Supports fact inspection and debug-inventory --json
Trust & Safety 19 / 25

--dry inspects real host facts before calculating diffs, though deploy.py executes arbitrary Python and SSH commands with full remote-host blast radius.

  • Accurate --dry diffing via live fact gathering
  • Executes arbitrary Python and SSH commands on remote fleets
Setup & Portability 13 / 15

Distributed via Homebrew, pip, and uvx across macOS, Linux, and Windows (Python runtime required; SSH/Docker targets).

  • Available via Homebrew, pip, and uvx
Utility & Efficiency 14 / 15

Much faster than Ansible because it executes Python logic directly over persistent SSH/Paramiko connections with no remote agent.

  • Agentless SSH/Docker/local execution with parallel fact gathering
Maintenance & Lineage 8 / 10

Actively maintained open-source project (pyinfra-dev/pyinfra) under MIT.

  • Active pyinfra-dev/pyinfra repo under MIT
Docs & Verifiability 9 / 10

Clean docs at docs.pyinfra.com detailing CLI flags, facts, and operations.

  • Comprehensive CLI and API docs at docs.pyinfra.com

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Uses local SSH agent / ~/.ssh/ keys, Docker socket, or --sudo-password / env vars; no proprietary credential store.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

MIT open-source and completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# pyinfra Agent Rules
- Always run `pyinfra <inventory> <deploy> --dry --json` before applying changes.
- Remember `--json` enforces non-interactive mode; ensure SSH keys/agent are loaded first.
- Never target production inventories with `exec` or `deploy.py` without explicit approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

Dry-run deployment with JSON output
pyinfra inventory.py deploy.py --dry --json

Gathers facts from target hosts and computes proposed operations as JSON without executing any mutations.

Query a read-only system fact across hosts
pyinfra inventory.py fact server.LinuxName --json

Fetches OS metadata from inventory targets as structured JSON.

Controlled Writes & Previews

Run a single ad-hoc command with confirmation skipped
pyinfra @local exec -- 'uname -a'

Executes an ad-hoc shell command against @local using pyinfra's connector.

Strengths for Agents

  • + --dry --json computes exact diffs from live host facts without mutating targets.
  • + --json automatically enforces non-interactive execution.
  • + Works seamlessly across @local, @docker, and SSH inventories with zero remote agents.

Caveats & Pitfalls

  • ! Executing deploy.py runs arbitrary Python and remote SSH mutations if --dry is omitted.
  • ! Windows control-node support is secondary compared to macOS and Linux.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI