Skip to main content

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 exec
  • codex 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-ng installed 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

  • transform reads stdin by default and writes plain text to stdout.
  • tts reads stdin by default and writes WAV bytes to stdout unless --output-file is set.
  • tts --device auto prefers CUDA and falls back to CPU.
  • transform refreshes ChatGPT tokens when the Codex backend returns 401.

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: run codex login
  • Expired auth: rerun codex login if 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_nd_co_agent_tools-0.1.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_nd_co_agent_tools-0.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_nd_co_agent_tools-0.1.0.tar.gz.

File metadata

  • Download URL: ai_nd_co_agent_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_nd_co_agent_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37b97b63a2399b5f29e28efaf03f8bd752849557845020133ce6b1e3551747c1
MD5 e9c77b423f866052613490777c8c524b
BLAKE2b-256 597a2f55546dfd3373743f078382430e253b122e4a37d0d677b5c59808aaab71

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_nd_co_agent_tools-0.1.0.tar.gz:

Publisher: release.yml on ai-nd-co/agent-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_nd_co_agent_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_nd_co_agent_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f7732c1ca18481a5dc5c3c79fdbc64106464120e3f6280a1ca98140b26389e5
MD5 0fb1bb26d1f20894944179c509d0a5ed
BLAKE2b-256 32b83e9b3184e38c25ce55841146e87e715509c82966a11fd2b9aea49f64b8b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_nd_co_agent_tools-0.1.0-py3-none-any.whl:

Publisher: release.yml on ai-nd-co/agent-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page