Codex plugin and CLI for mocking shell-like tool calls in skill and agent tests.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_tool_mock-0.1.0.tar.gz.
File metadata
- Download URL: codex_tool_mock-0.1.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32a147fb607f9386f14c36850e6f3ad16459230edc665ddd45de3776ff61ae5
|
|
| MD5 |
78627a345fa4e343f1e6f109ccd49e31
|
|
| BLAKE2b-256 |
8c3ea8caeb89502f5edade448a6042ab4eb50b29929282a02b4082260d8a2fec
|
Provenance
The following attestation bundles were made for codex_tool_mock-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on DengYiping/codex-tool-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_tool_mock-0.1.0.tar.gz -
Subject digest:
f32a147fb607f9386f14c36850e6f3ad16459230edc665ddd45de3776ff61ae5 - Sigstore transparency entry: 1520919700
- Sigstore integration time:
-
Permalink:
DengYiping/codex-tool-mock@78cc53da613f5079a3ab6b16749f56103ed45e7a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DengYiping
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@78cc53da613f5079a3ab6b16749f56103ed45e7a -
Trigger Event:
push
-
Statement type:
File details
Details for the file codex_tool_mock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codex_tool_mock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a47384375ab75d233552a05e12ae698653271dee207715a9f81ab617e9dbb3
|
|
| MD5 |
69015f71783b8971080cd3007565290f
|
|
| BLAKE2b-256 |
d752e1522375d3a058fb1871a9303ce33e50f7c9448ce12441a04b34862be07c
|
Provenance
The following attestation bundles were made for codex_tool_mock-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on DengYiping/codex-tool-mock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_tool_mock-0.1.0-py3-none-any.whl -
Subject digest:
61a47384375ab75d233552a05e12ae698653271dee207715a9f81ab617e9dbb3 - Sigstore transparency entry: 1520920486
- Sigstore integration time:
-
Permalink:
DengYiping/codex-tool-mock@78cc53da613f5079a3ab6b16749f56103ed45e7a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DengYiping
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@78cc53da613f5079a3ab6b16749f56103ed45e7a -
Trigger Event:
push
-
Statement type: