npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-elevenlabs-tts

v0.1.2

Published

Pi extension that reads assistant text responses aloud with ElevenLabs text-to-speech.

Readme

pi-elevenlabs-tts

Pi extension that reads assistant text responses aloud with ElevenLabs text-to-speech. Tool calls and tool results are ignored. Bare http:// and https:// URL schemes are removed before speech. Current playback is stopped when the user submits a new message. On macOS, TTS skips playback by default when pmset reports active system audio or WebRTC audio activity, and the Pi status line shows when audio is blocking speech.

Requirements

  • Pi (@mariozechner/pi-coding-agent)
  • ElevenLabs API key
  • An audio player:
    • macOS: built-in afplay
    • Linux/other: mpv or ffplay, or set ELEVENLABS_PLAYER

Setup

Install and authenticate the ElevenLabs CLI. The CLI is useful for login/account setup; TTS behavior is configured in the Pi extension via environment variables and /speak commands.

npm install -g @elevenlabs/cli
elevenlabs auth login

The extension reads the API key from either:

  1. ELEVENLABS_API_KEY, or
  2. ~/.elevenlabs/api_key created by elevenlabs auth login

Try locally

From this package directory:

pi -e ./extensions/elevenlabs-tts/index.ts

Or install as a local Pi package:

pi install /Users/ajsharp/code/pi-elevenlabs-tts

Then restart Pi or run /reload.

Commands

Inside Pi:

/speak status                  # show current config
/speak on                      # enable auto-read
/speak off                     # disable auto-read
/speak stop                    # stop playback
/speak last                    # replay last spoken assistant text
/speak voices [search]         # list available ElevenLabs voices
/speak voice <voice-id>        # set voice
/speak model <model-id>        # set TTS model
/speak skip-when-audio on|off  # skip TTS when macOS reports active audio
/speak stability <0-1>         # set voice stability
/speak similarity <0-1>        # set similarity boost
/speak style <0-1>             # set style exaggeration
/speak speed <0.7-1.2>         # set speaking speed
/speak boost on|off            # speaker boost
/speak reset                   # reset to environment/default config

Command changes are persisted into the current Pi session and restored after /reload.

Configuration

Environment variables:

| Variable | Default | Description | | --- | --- | --- | | ELEVENLABS_API_KEY | read from ~/.elevenlabs/api_key | ElevenLabs API key | | ELEVENLABS_TTS_ENABLED | true | Auto-read responses aloud | | ELEVENLABS_VOICE_ID | JBFqnCBsd6RMkjVDRZzb | Voice ID | | ELEVENLABS_MODEL_ID | eleven_turbo_v2_5 | TTS model | | ELEVENLABS_OUTPUT_FORMAT | mp3_44100_128 | ElevenLabs output format | | ELEVENLABS_API_BASE | https://api.elevenlabs.io | API base URL | | ELEVENLABS_MAX_CHARS | 4000 | Max characters spoken per response | | ELEVENLABS_STRIP_CODE_BLOCKS | true | Remove fenced code blocks from spoken text | | ELEVENLABS_SKIP_WHEN_AUDIO_ACTIVE | true | On macOS, skip TTS when pmset reports active output audio or WebRTC audio activity | | ELEVENLABS_AUDIO_ACTIVE_STATUS_INTERVAL_MS | 30000 | Status-line polling interval for macOS audio activity | | ELEVENLABS_STABILITY | ElevenLabs default | Voice stability, 0-1 | | ELEVENLABS_SIMILARITY_BOOST | ElevenLabs default | Similarity boost, 0-1 | | ELEVENLABS_STYLE | ElevenLabs default | Style exaggeration, 0-1 | | ELEVENLABS_SPEED | ElevenLabs default | Speaking speed, usually 0.7-1.2 | | ELEVENLABS_USE_SPEAKER_BOOST | ElevenLabs default | true/false speaker boost | | ELEVENLABS_PLAYER | afplay on macOS, mpv --really-quiet elsewhere | Audio player command |

Example:

export ELEVENLABS_VOICE_ID="JBFqnCBsd6RMkjVDRZzb"
export ELEVENLABS_MODEL_ID="eleven_turbo_v2_5"
pi -e ./extensions/elevenlabs-tts/index.ts