API Reference
Fabric
A high-level Python library for executing shell commands over SSH to automate remote deployments.
Official Documentation ↗CompatibilityThis documentation covers version
v3.2. Check the official docs for the latest API surface.Installation
pip
pip install fabricMethods
No methods match this filter.
Fabric builds on Invoke and Paramiko to run commands on remote hosts from a fabfile.
Key Features
- Connection objects for remote hosts
- Task decorators and a fab CLI
- File transfer and sudo support
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
API reference evidence
Fetched from official sources on 2026-11-08T19:16:00+08:00 via WebFetch https://docs.fabfile.org/en/stable/api/connection.html.
fabric.Connection→ signature from https://docs.fabfile.org/en/stable/api/connection.html; official text: “class fabric.connection.Connection(host, user=None, port=None, config=None, gateway=None, forward_agent=None, connect_timeout=None, connect_kwargs=None, inline_ssh_env=None)”Connection.run→ signature from https://docs.fabfile.org/en/stable/api/connection.html; official text: “run(command, **kwargs) Execute a shell command on the remote end of this connection. This method wraps an SSH-capable implementation of [invoke.runners.Runner.run](https://docs.pyinvoke.org/en/latest/api/runners.”
FAQ
- How do I use sudo?
- Call c.sudo(command) which prompts for a password or uses a configured sudo password.
- How do I transfer files?
- Use c.put(local, remote) and c.get(remote, local) to move files over the connection.
- How do I run a task on many hosts?
- Use the Group or SerialGroup classes to run the same task across a list of connections.
Report a problem with this API docOpens a pre-filled issue on GitHub.