Skip to main content

execkit (Python)

Stateful, structured, safe shell sessions for AI agents - over local shells, SSH, and Docker. Native bindings to the execkit Rust core.

pip install execkit
from execkit import Session

with Session.local() as s:
    r = s.exec("echo hi; echo err >&2; cd /tmp")
    print(r.stdout, r.exit_code, r.cwd, r.stderr)   # hi 0 /tmp err

State (cwd, env) persists across exec calls. Every result is a structured ExecResult (split stdout/stderr, exit code, cwd, duration, truncated, timed_out), already secret-redacted and output-bounded. Pass a Policy for an advisory command fence: Session.local(policy=Policy(deny=["rm"])).

Timeouts

Session.local(timeout=...) sets the default per-command timeout in seconds, and exec(cmd, timeout=...) overrides it for one call. A command that outlives it is interrupted with Ctrl-C and returned with timed_out=True and exit_code == 124. The session keeps its cwd and env:

with Session.local() as s:
    r = s.exec("sleep 10", timeout=1)
    print(r.timed_out, r.exit_code)   # True 124

Only a command that ignores Ctrl-C raises execkit.Timeout and leaves the session unusable. stdin is closed, so commands that prompt get end-of-file instead of hanging; use non-interactive flags such as sudo -n.

Async callers: r = await asyncio.to_thread(s.exec, "npm ci") (the native call releases the GIL).

Unix-only (local sessions need a POSIX shell). See the project README for the full picture and the operator security model.

License

Apache-2.0.

Release files for execkit 0.10.1

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

Source distribution (sdist)

Source distribution for execkit 0.10.1
File Size Uploaded
execkit-0.10.1.tar.gz 115.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for execkit 0.10.1
File
execkit-0.10.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
execkit-0.10.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
execkit-0.10.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
execkit-0.10.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 10.4 MB

Release files / execkit-0.10.1.tar.gz

Download URL execkit-0.10.1.tar.gz
Size 115.2 kB
Tags Source
SHA-256 checksum
How to use checksums
358e5135e1df44eaa5577e142115c348711a504206fdfc9a0c2370f962799821
BLAKE2b-256 checksum
How to use checksums
3e2864b576db152c0752418cb4ad4557fcf24c9ccc83154d66630364c0a22c51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / execkit-0.10.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL execkit-0.10.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
aade0c9cbe7107edcb2fd23e4677fd23dde967fa4db58a03b8bc1a8d448b5512
BLAKE2b-256 checksum
How to use checksums
8b3be834aefaee2bcdb14f4b540ab6318d166b2a81e8188ad2d675aab56e1851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / execkit-0.10.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL execkit-0.10.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.4 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
bee1bf5815cbaf88d099682de73ec2e93d65a312f0135e7cbdd33551e34ea995
BLAKE2b-256 checksum
How to use checksums
d5c50c52bc17b06363b4d2f8011e9abba8d4d13c5e051bfc17fac1be41b814e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / execkit-0.10.1-cp38-abi3-macosx_11_0_arm64.whl

Download URL execkit-0.10.1-cp38-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
292916751e6eb6687b85c257d720dfb84721468eae9fa7ebc00b8c6c3477a234
BLAKE2b-256 checksum
How to use checksums
8399c9bae835012ee5a4e2b798922389a38e8b83013153deec7715bba4b56070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / execkit-0.10.1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL execkit-0.10.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e8956a2d493af02ab17f240617832fa4225b95c3ecef05930918b301366841b2
BLAKE2b-256 checksum
How to use checksums
bf95ea0765975da5fe95edc399d62e05b5f73aa914146586062243cd0a4002d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.1 This release

5 release files

0.10.0

5 release files

0.9.0

5 release files

0.8.0

5 release files

0.7.2

5 release files

0.7.1

5 release files

0.7.0

5 release files

0.6.1

5 release files

0.6.0

5 release files

0.0.1

2 release files

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