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.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| execkit-0.9.0.tar.gz | 113.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| execkit-0.9.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.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| execkit-0.9.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| execkit-0.9.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.9.0.tar.gz
| Download URL | execkit-0.9.0.tar.gz |
|---|---|
| Size | 113.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47fa32a07f99392f7ebc9d194fe8ea193584db6b7ecfde646fb4107d2381f6f0
|
|
BLAKE2b-256 checksum How to use checksums |
5f0f1eb76aec562d1f1d68b2f86209befd20473facbcae2295093c2f1c0b9105
|
| 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 logRelease files / execkit-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | execkit-0.9.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 |
f6a0eed2a42edd605898054b426a432dcfc62f65104b9b97fd81a2784a562e2e
|
|
BLAKE2b-256 checksum How to use checksums |
c40f4b12ce134c84bb97ebf6299a5b3600486feefdc1840dc2f8406a39b89fcf
|
| 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 logRelease files / execkit-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | execkit-0.9.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 |
7f246b566f23a09b3222225778471c3cd48ca50639d2ceb358cc15058af73c50
|
|
BLAKE2b-256 checksum How to use checksums |
eeded98fbc8c71b76e7db0c698b1631dc04ed1a3a5d35d195df73d39b05f0773
|
| 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 logRelease files / execkit-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | execkit-0.9.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 |
212da0a70c124ec6d8c2721c780727f5b8f19182c644d1cdd9ff7b3896224579
|
|
BLAKE2b-256 checksum How to use checksums |
0bdc4b47a9d5cf71fd1d63a147b3f48001ca1e77386917e04426a5507d23a36b
|
| 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 logRelease files / execkit-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | execkit-0.9.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 |
957a8cdbaccd1cd0e05d93303d3fe7ccfb6604a27e4b1d629f32e54c5d7cdeb2
|
|
BLAKE2b-256 checksum How to use checksums |
49b3fd4e7b6f266fee8aba721637c7799f2be50221588c756e03a38d607dac63
|
| 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