{"_id":"@dmille56/pi-piper-tts","name":"@dmille56/pi-piper-tts","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dmille56/pi-piper-tts","version":"0.1.0","description":"A Pi package that adds a /piper-tts command (and /tts alias) for speaking the latest assistant message with Piper TTS.","type":"module","license":"MIT","keywords":["pi-package","pi-extension","tts","piper","speech-synthesis"],"scripts":{"typecheck":"tsc -p tsconfig.json --noEmit","lint":"xo; echo EXIT:$?","lint-fix":"xo --fix","format":"prettier --write .","check":"npm run typecheck && npm run lint","build":"echo 'nothing to build'","release":"npm run check && npm version patch && npm publish --access public","prepublishOnly":"npm run check"},"repository":{"type":"git","url":"git+https://github.com/dmille56/pi-piper-tts.git"},"bugs":{"url":"https://github.com/dmille56/pi-piper-tts/issues"},"homepage":"https://github.com/dmille56/pi-piper-tts#readme","peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"devDependencies":{"@earendil-works/pi-coding-agent":"^0.74.0","@types/node":"^22.0.0","prettier":"3.7.4","typescript":"^5.8.0","xo":"^2.0.2"},"xo":{"space":true,"prettier":true,"rules":{"import-x/extensions":"off","function-paren-newline":"off","@stylistic/object-curly-newline":"off","@stylistic/operator-linebreak":"off","@stylistic/multiline-ternary":"off","@stylistic/arrow-parens":"off","@stylistic/function-paren-newline":"off","@stylistic/curly-newline":"off","capitalized-comments":"off","complexity":"off","max-lines-per-function":"off","max-lines":"off","max-params":"off","require-unicode-regexp":"off","unicorn/no-abusive-eslint-disable":"off","n/prefer-global/process":"off"}},"pi":{"extensions":["extensions"]},"gitHead":"2be6a1509125501ee375b49154894f1b75a97a73","_id":"@dmille56/pi-piper-tts@0.1.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-1ZdCbcuiREpQtEi8pvQ8n+AzAOAc967/MO+QWUby0MS7lTWqmbbaBmfwGvGLzc+i9DSdcz7d64jOWGLAiFq+QA==","shasum":"9897740bd22c1805697af03a9b4d3050f1f7ca02","tarball":"https://registry.npmjs.org/@dmille56/pi-piper-tts/-/pi-piper-tts-0.1.0.tgz","fileCount":4,"unpackedSize":22774,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID35K/ycO0qoZ3cRG98t4VgKQnJ+HBszBUmgkN3yxfxYAiAaTrWyi3Q65bk1YmwhUG7bzzh5u4BLSODNLYMiR0Z9hQ=="}]},"_npmUser":{"name":"dmille56","email":"donovanm256@gmail.com"},"directories":{},"maintainers":[{"name":"dmille56","email":"donovanm256@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-piper-tts_0.1.0_1778816359396_0.4429485485171467"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T03:39:19.248Z","0.1.0":"2026-05-15T03:39:19.531Z","modified":"2026-05-15T03:39:19.753Z"},"maintainers":[{"name":"dmille56","email":"donovanm256@gmail.com"}],"description":"A Pi package that adds a /piper-tts command (and /tts alias) for speaking the latest assistant message with Piper TTS.","homepage":"https://github.com/dmille56/pi-piper-tts#readme","keywords":["pi-package","pi-extension","tts","piper","speech-synthesis"],"repository":{"type":"git","url":"git+https://github.com/dmille56/pi-piper-tts.git"},"bugs":{"url":"https://github.com/dmille56/pi-piper-tts/issues"},"license":"MIT","readme":"# pi-piper-tts\n\nA Pi package that adds a `/piper-tts` slash command (and a `/tts` alias).\n\n## What it does\n\n`/piper-tts` speaks the latest assistant message from the current session branch using local Piper TTS.\n\nIt:\n\n- waits for Pi to finish the current turn\n- scans the active branch for the most recent assistant message\n- extracts only spoken text blocks\n- normalizes whitespace\n- calls Piper locally through `pi.exec()`\n\n## Install\n\nInstall from npm:\n\n```bash\npi install npm:@dmille56/pi-piper-tts\n```\n\nOr pin a version:\n\n```bash\npi install npm:@dmille56/pi-piper-tts@0.1.0\n```\n\nInstall from a local path while developing:\n\n```bash\npi install /absolute/path/to/pi-piper-tts\n```\n\n\n## Requirements\n\n- Pi with package support\n- Python 3\n- **Piper (piper-tts) installed locally**:\n\nUp-to-date install/docs: https://github.com/OHF-Voice/piper1-gpl\n\n```bash\npip install piper-tts\n```\n\n- **ffplay installed** (from `ffmpeg`) and available on your `PATH`\n- A Piper voice/model downloaded and available locally\n\n## Configuration\n\nYou can configure `/piper-tts` (and the `/tts` alias) using environment variables (highest priority) and/or Pi `settings.json`.\n\n### Environment variables\n\nSet these environment variables before launching Pi:\n\n- `PIPER_PI_MODEL` — required. Piper voice/model identifier or path passed to `-m`\n- `PIPER_PI_BIN` — optional. Overrides the Piper command. Default is `python3 -m piper`\n- `PIPER_PI_DATA_DIR` — optional. Passed to Piper as `--data-dir`\n- `PIPER_PI_EXTRA_ARGS` — optional extra arguments appended to the Piper command\n- `PIPER_PI_MAX_CHARS` — optional safety cap for long assistant messages (must be a positive integer)\n\n### Pi settings (`settings.json`)\n\nAlternatively (or in addition), you can set configuration in `settings.json`.\n\nSupported section/key names:\n\n- `pi-piper-tts` (preferred)\n- `pi-tts-command` (legacy alias)\n- `tts`\n- `piper`\n\nKeys in that section:\n\n- `piper-pi-model` — required (same value as `PIPER_PI_MODEL`)\n- `piper-pi-bin` — same as `PIPER_PI_BIN`\n- `piper-pi-data-dir` — same as `PIPER_PI_DATA_DIR`\n- `piper-pi-extra-args` — same as `PIPER_PI_EXTRA_ARGS`\n- `piper-pi-max-chars` — same as `PIPER_PI_MAX_CHARS`\n\nPi loads settings from:\n\n- `~/.pi/agent/settings.json` (global)\n- `<cwd>/.pi/settings.json` (project override, takes precedence)\n\nExample `settings.json`:\n\n```json\n{\n  \"pi-piper-tts\": {\n    \"piper-pi-model\": \"/path/to/your/voice.onnx\",\n    \"piper-pi-data-dir\": \"$HOME/.local/share/piper\",\n    \"piper-pi-bin\": \"python3 -m piper\",\n    \"piper-pi-extra-args\": \"--speaker 0\",\n    \"piper-pi-max-chars\": 8000\n  }\n}\n```\n\n\n### Quick environment-variable example\n\n```bash\nexport PIPER_PI_MODEL=/path/to/your/voice.onnx\nexport PIPER_PI_DATA_DIR=$HOME/.local/share/piper\npi\n```\n\nIf you want to override the command used to start Piper:\n\n```bash\nexport PIPER_PI_BIN=\"python3 -m piper\"\n```\n\nYou can also add extra arguments:\n\n```bash\nexport PIPER_PI_EXTRA_ARGS=\"--speaker 0\"\n```\n\n## Usage\n\nOnce Pi is running, type one of:\n\n```text\n/piper-tts\n```\n\nor the convenience alias:\n\n```text\n/tts\n```\n\nPi will speak the latest assistant message aloud.\n\n### `/tts` alias (optional)\n\nBy default, this extension registers both commands:\n\n- `/piper-tts` (primary)\n- `/tts` (alias for `/piper-tts`)\n\nIf you want to disable the `/tts` alias (it will be *unregistered*):\n\n**Environment variable (highest priority):**\n\n```bash\nexport PIPER_PI_ENABLE_TTS_ALIAS=0\n```\n\n**Pi `settings.json`** (global: `~/.pi/agent/settings.json`, or project: `<cwd>/.pi/settings.json`):\n\n```json\n{\n  \"pi-piper-tts\": {\n    \"enable-tts-alias\": false\n  }\n}\n\nThis is read when the extension loads; you may need to restart (or `/reload`) after changing it.\n```\n\n## Behavior\n\nIf something is wrong, the command will notify you and leave the session unchanged.\n\nCommon cases:\n\n- no assistant message yet\n- latest assistant message has no text\n- `PIPER_PI_MODEL` is missing\n- Piper is not installed (or `ffplay` is missing)\n- the configured voice/model cannot be loaded\n\n## Publishing\n\nThis package is ready to publish to npm.\n\n```bash\nnpm publish\n```\n\n## Notes\n\n- The extension is implemented in TypeScript and does not require compilation.\n- It uses argument arrays with `pi.exec()` and does not shell-escape a single command string.\n- It is local-only after installation.\n","readmeFilename":"README.md","_rev":"1-f39082f27b1e307f591c521d400b5bf9"}