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

@juanibiapina/pi-extension-settings

v0.5.0

Published

Pi extension for centralized settings management across extensions

Readme

@juanibiapina/pi-extension-settings

A pi extension that provides centralized settings management for all extensions.

Features

  • /extension-settings command - Interactive UI to configure all registered extension settings
  • Helpers for reading/writing - getSetting() and setSetting() functions
  • Persistent storage - Settings stored in ~/.pi/agent/settings-extensions.json

For Users

Install the extension to get the /extension-settings command, which provides an interactive UI to configure settings for all extensions that support it:

pi install npm:@juanibiapina/pi-extension-settings

⚠️ Load Order: pi-extension-settings must appear before any extension that registers settings in your packages array in ~/.pi/settings.json. Extensions register via the event bus at load time, so if pi-extension-settings hasn't loaded yet, those registrations are silently lost.

Then use /extension-settings in pi:

  • Settings are grouped by extension with headers
  • Use arrow keys to navigate
  • Press Enter or Space to cycle through values (or edit string inputs)
  • Type to search/filter settings
  • Press Escape to close

For Extension Authors

If you're developing an extension and want to use the settings system, add this package as a dependency in your extension's package.json:

{
  "dependencies": {
    "@juanibiapina/pi-extension-settings": "^0.4.0"
  }
}

This gives you access to getSetting() and setSetting() helpers, and lets you register settings so they appear in the /extension-settings UI.

Register Settings (for the UI)

Emit the pi-extension-settings:register event during extension load to make your settings appear in /extension-settings:

import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import type { SettingDefinition } from "@juanibiapina/pi-extension-settings";

export default function myExtension(pi: ExtensionAPI) {
  pi.events.emit("pi-extension-settings:register", {
    name: "my-extension",
    settings: [
      {
        id: "timeout",
        label: "Request Timeout",
        description: "Timeout in seconds for API requests",
        defaultValue: "30",
        values: ["10", "30", "60", "120"],  // Cycles through these values
      },
      {
        id: "debug",
        label: "Debug Mode",
        description: "Enable verbose logging",
        defaultValue: "off",
        values: ["on", "off"],
      },
      {
        id: "projectName",
        label: "Project Name",
        description: "Name used in commit messages",
        defaultValue: "",
        // No 'values' = free-form string input
      },
    ] satisfies SettingDefinition[]
  });
}

Read/Write Settings

Use the helper functions to read and write settings:

import { getSetting, setSetting } from "@juanibiapina/pi-extension-settings";

// Read a setting (with default fallback - must match defaultValue from registration)
const timeout = getSetting("my-extension", "timeout", "30");

// Write a setting
setSetting("my-extension", "debug", "on");

API Reference

getSetting(extensionName, settingId, defaultValue?)

Get a setting value. Returns the stored value, or the provided default, or undefined.

const value = getSetting("my-extension", "timeout", "30");

setSetting(extensionName, settingId, value)

Set a setting value. Writes to ~/.pi/agent/settings-extensions.json.

setSetting("my-extension", "debug", "on");

SettingDefinition (type)

Type for settings registration (use with satisfies for type checking):

interface SettingDefinition {
  id: string;            // Unique ID within the extension
  label: string;         // Display label in UI
  description?: string;  // Optional help text shown when selected
  defaultValue: string;  // Default value if not set
  values?: string[];     // Values to cycle through (omit for free-form string input)
}

Event: pi-extension-settings:register

Emit this event to register settings for the UI:

pi.events.emit("pi-extension-settings:register", {
  name: string;                    // Extension name
  settings: SettingDefinition[];   // Array of setting definitions
});

Storage

Settings are stored in ~/.pi/agent/settings-extensions.json:

{
  "my-extension": {
    "timeout": "60",
    "debug": "on"
  },
  "another-extension": {
    "theme": "dark"
  }
}

License

MIT