Codex-backed text transformation and Kokoro TTS command-line tools.
Project description
agent-tools
Python CLI tools for:
- transforming piped text through the private Codex ChatGPT-backed backend used by local Codex
- synthesizing the result to WAV with Kokoro-82M
This repo is intentionally wired to the local Codex login state in ~/.codex/.
Status
This is an experimental public package with a private Codex dependency.
The transform command mirrors the current request shape used by the local Codex source tree and depends on ChatGPT-backed auth in ~/.codex/auth.json.
It does not use:
codex execcodex app-server- the public OpenAI API key flow
That means:
- you must already be logged into local Codex
- backend compatibility can break if Codex internals or backend contracts change
- this package is best suited for users who already use local Codex
Requirements
- Python 3.12+
- local Codex already logged in via ChatGPT
espeak-nginstalled for best Kokoro English fallback behavior
Install
cd repos/agent-tools
uv venv
uv pip install -e ".[dev]"
Public package install:
pip install ai-nd-co-agent-tools
Usage
Transform text
echo "Rewrite this into short spoken narration." | agent-tools transform \
--system-prompt-file prompt_examples/rewrite_for_tts.md
Optional controls:
echo "Input text" | agent-tools transform \
--system-prompt-file prompt_examples/rewrite_for_tts.md \
--model gpt-5 \
--reasoning-effort medium \
--fast
Text to speech
echo "Hello world." | agent-tools tts --output-file hello.wav
End-to-end pipeline
cat input.txt | agent-tools transform \
--system-prompt-file prompt_examples/rewrite_for_tts.md \
| agent-tools tts --voice af_heart --output-file out.wav
Notes
transformreads stdin by default and writes plain text to stdout.ttsreads stdin by default and writes WAV bytes to stdout unless--output-fileis set.tts --device autoprefers CUDA and falls back to CPU.transformrefreshes ChatGPT tokens when the Codex backend returns401.- semantic-release now owns future Python package version bumps and
py-v*tags.
CPU performance
Measured on this machine on April 15, 2026 with forced CPU:
| Scenario | Wall time | Audio time | Real-time factor |
|---|---|---|---|
| first-ever cold init after dependency/model setup | ~43.1s | n/a | n/a |
| cached init | ~2.9s | n/a | n/a |
| warm short | 0.309s | 4.80s | 0.064 |
| warm medium | 1.199s | 15.53s | 0.077 |
| warm long | 2.514s | 26.70s | 0.094 |
Interpretation:
- warm CPU generation on this machine is about 10x-15x faster than realtime
- the main cost is cold startup/model load, not steady-state synthesis
To reproduce locally:
python scripts/benchmark_tts_cpu.py
Troubleshooting
- Missing
~/.codex/auth.json: runcodex login - Expired auth: rerun
codex loginif refresh fails permanently - Missing
espeak-ng: install it for better English fallback behavior - Slow first run: expected; Kokoro downloads voices/models and initializes the pipeline
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 ai_nd_co_agent_tools-0.1.2.tar.gz.
File metadata
- Download URL: ai_nd_co_agent_tools-0.1.2.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f5c18d11bcc2554e032262465c3a076cdb3594f3b29e7d94556f40b9df1d5f
|
|
| MD5 |
b671ff3dc88e0fc22a98d75d4b9e8014
|
|
| BLAKE2b-256 |
4d49d16595cc309352a3c058b477bfa60045c9204a9d7782c6ce76f191d35941
|
Provenance
The following attestation bundles were made for ai_nd_co_agent_tools-0.1.2.tar.gz:
Publisher:
release.yml on ai-nd-co/agent-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_nd_co_agent_tools-0.1.2.tar.gz -
Subject digest:
19f5c18d11bcc2554e032262465c3a076cdb3594f3b29e7d94556f40b9df1d5f - Sigstore transparency entry: 1299231209
- Sigstore integration time:
-
Permalink:
ai-nd-co/agent-tools@6ca040ab10665735b53952d4d2867acf4238ee83 -
Branch / Tag:
refs/tags/py-v0.1.2 - Owner: https://github.com/ai-nd-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ca040ab10665735b53952d4d2867acf4238ee83 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ai_nd_co_agent_tools-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ai_nd_co_agent_tools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.4 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 |
12af49c84dadc6e81152091f9fbdfddd826e501988abab1b31311394cd032ae3
|
|
| MD5 |
ecb1e79c278ea952a58f8b26be1e14bc
|
|
| BLAKE2b-256 |
f0717e2ec6699796ab690a982df2210fd9d0c95fa54e296e9ac5ba19f07eb1ac
|
Provenance
The following attestation bundles were made for ai_nd_co_agent_tools-0.1.2-py3-none-any.whl:
Publisher:
release.yml on ai-nd-co/agent-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_nd_co_agent_tools-0.1.2-py3-none-any.whl -
Subject digest:
12af49c84dadc6e81152091f9fbdfddd826e501988abab1b31311394cd032ae3 - Sigstore transparency entry: 1299231318
- Sigstore integration time:
-
Permalink:
ai-nd-co/agent-tools@6ca040ab10665735b53952d4d2867acf4238ee83 -
Branch / Tag:
refs/tags/py-v0.1.2 - Owner: https://github.com/ai-nd-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6ca040ab10665735b53952d4d2867acf4238ee83 -
Trigger Event:
workflow_dispatch
-
Statement type: