codex-tool-mock
Codex tool mocking plugin and CLI. Useful for testing and evaluating skills on Codex by mocking shell-like tool calls and asserting that expected commands were used.
See docs/usage.md for setup and usage, docs/publishing.md for PyPI publishing, and SPEC.md for the MVP behavior and milestone plan.
MVP
- Shell-like
Bashhook support. - Exact and regex command matching.
- Static mocked stdout/stderr/exit code responses.
- Python responder scripts executed through
uv run --script, including uv inline dependency metadata. - Project-local fixtures and recordings under
.codex/tool-mocks/. - Pytest-style verification helpers.
Install With uv
For normal use, install the CLI as a persistent uv tool:
uv tool install codex-tool-mock
codex-tool-mock --help
Then install the Codex plugin globally:
codex-tool-mock install-global
This is the recommended uv workflow because Codex hooks will keep using the
Python environment created by uv tool install.
To install from a local checkout instead of a package index:
uv tool install .
codex-tool-mock install-global
To try the CLI without installing it persistently:
uvx --from codex-tool-mock codex-tool-mock --help
If you use uvx to install the Codex plugin, make the hook re-run through uvx
so it does not depend on the temporary uvx environment:
uvx --from codex-tool-mock codex-tool-mock install-global --hook-runner uvx
For local development from this checkout:
uv sync
uv run codex-tool-mock --help
uv run codex-tool-mock install-global
Install With pip
Install from a package index with pip:
pip install codex-tool-mock
codex-tool-mock --help
Initialize mock storage in the project you want to test:
codex-tool-mock init
Then add fixtures:
codex-tool-mock add-shell --id git-status --command "git status --short" --stdout "" --exit-code 0
To install the Codex plugin globally after a persistent pip or uv tool
install:
codex-tool-mock install-global
The installer copies the plugin into ~/.codex/plugins/cache/debug/codex-tool-mock/local
and enables these entries in ~/.codex/config.toml. The installed hook command
uses the Python environment that ran the installer, so the package must remain
installed there.
[features]
plugins = true
plugin_hooks = true
[plugins."codex-tool-mock@debug"]
enabled = true
You can preview target paths without writing files:
codex-tool-mock install-global --dry-run
More examples are in docs/usage.md.
Metadata
Release files for codex-tool-mock 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| codex_tool_mock-0.1.0.tar.gz | 21.4 kB | With provenance | Details for codex_tool_mock-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codex_tool_mock-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for codex_tool_mock-0.1.0-py3-none-any.whl |
Total release size: 38.2 kB
Release files / codex_tool_mock-0.1.0.tar.gz
| Download URL | codex_tool_mock-0.1.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f32a147fb607f9386f14c36850e6f3ad16459230edc665ddd45de3776ff61ae5
|
|
BLAKE2b-256 checksum How to use checksums |
8c3ea8caeb89502f5edade448a6042ab4eb50b29929282a02b4082260d8a2fec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 12, 2026.
Transparency logRelease files / codex_tool_mock-0.1.0-py3-none-any.whl
| Download URL | codex_tool_mock-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61a47384375ab75d233552a05e12ae698653271dee207715a9f81ab617e9dbb3
|
|
BLAKE2b-256 checksum How to use checksums |
d752e1522375d3a058fb1871a9303ce33e50f7c9448ce12441a04b34862be07c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 12, 2026.
Transparency logSecurity for codex-tool-mock 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for codex_tool_mock-0.1.0.tar.gz
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 May 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.