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

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.0
File Size Uploaded
execkit-0.10.0.tar.gz 113.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for execkit 0.10.0
File
execkit-0.10.0-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.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
execkit-0.10.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
execkit-0.10.0-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.0.tar.gz

Download URL execkit-0.10.0.tar.gz
Size 113.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a403f1b794864b15d2028d19ff83e5ebd55c989129ab9ccba1591472bb43e2d4
BLAKE2b-256 checksum
How to use checksums
b60be86546571d506c8dac1f3af29568b3b869dc097bcb1dfd3d8c6092e801a3
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 25, 2026.

Transparency log

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

Download URL execkit-0.10.0-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
4530fa0298cbc1071fb70b312d9b7070a0a010a89b27fe725dc4147af66685dd
BLAKE2b-256 checksum
How to use checksums
dacc879a5db2c1531e41c3aaf80c9b6f6d19f7526fbcb6852bbe24b9d6de7d71
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 25, 2026.

Transparency log

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

Download URL execkit-0.10.0-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
ea3198c6bb418a65bf91e08a20e956836816db040cf7734bba234e50d872cc6d
BLAKE2b-256 checksum
How to use checksums
03392ea96c970a48ff8f6de22eb1703611dd68c861610b839b689bbe96e13bf7
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 25, 2026.

Transparency log

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

Download URL execkit-0.10.0-cp38-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b9f3e2e12b3d278c80bb29e54012225f93967c8638b24602bd95f89c141f23d9
BLAKE2b-256 checksum
How to use checksums
faaf415235394a01d415a96b27d60cb163fba4a3c5a90f44d5aee8700bc4523a
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 25, 2026.

Transparency log

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

Download URL execkit-0.10.0-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
21bd5015cbe43226d4b8dc8d0028c68672fdcb01b63424863a7046e8807f17bb
BLAKE2b-256 checksum
How to use checksums
6225974cc56ac1681670e44240a294fe00fce1e5e15e4838a18e7a5811237646
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

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