← Catalog

@hypabolic/pi-hypa

Pi extension for Hypa command rewrite and CLI-backed tools

Package

Install

Install with PiG

pig install npm:@hypabolic/pi-hypa

Install with Pi

pi install npm:@hypabolic/pi-hypa
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions"
  ]
}

README

Written by the package's publisher, shown as published in version 1.2.0 (README.md). PiG does not review it.

pi-hypa

Pi extension package for Hypa. Installing this package through Pi also installs @hypabolic/hypa as a package dependency and creates a best-effort user-level hypa shim when no hypa command is already on PATH. The shim delegates to a later global/system hypa install if one appears earlier on PATH, and otherwise falls back to the bundled dependency.

The current package provides:

  • bash rewrite interception via hypa rewrite --json
  • /hypa diagnostics
  • CLI-backed tools: hypa_shell, hypa_read, hypa_grep, hypa_find, hypa_ls
  • optional Hypa MCP proxy discovery tool: hypa_mcp_proxy

Bash interception mutates the Pi bash command before execution when Hypa returns Rewritten or GenericWrapper.

Install / smoke

pi -e ./packages/pi-hypa/extensions/index.ts
# or
pi install ./packages/pi-hypa
# after release
pi install npm:@hypabolic/pi-hypa

Configuration

VariableDefaultDescription
HYPA_BINbundled @hypabolic/hypa, then hypaHypa executable or absolute path.
HYPA_PI_MODEadditiveadditive keeps Pi builtins; replace disables each of Pi bash/read/grep/find/ls only while its matching hypa_* tool is active (fail-open if the replacement is absent, e.g. subagent/--tools allowlists).
HYPA_PI_REWRITE_TIMEOUT_MS5000Rewrite CLI timeout in milliseconds.
HYPA_PI_ASK_NON_INTERACTIVEdenyAsk fallback when ctx.hasUI === false: deny or allow.
HYPA_PI_ENABLE_MCP_PROXY0Enable hypa_mcp_proxy, a lazy discovery/invocation bridge for upstream MCP servers configured in Hypa.
HYPA_PI_ENABLE_MCPunsetLegacy alias for HYPA_PI_ENABLE_MCP_PROXY if needed.
HYPA_PI_MCP_PROXY_TIMEOUT_MS10000Timeout for hypa mcp ... proxy calls.
HYPA_PI_MCP_CONFIG~/.pi/agent/mcp.jsonPi MCP config path used to deduplicate Hypa upstream servers already configured directly in Pi.
HYPA_PI_CONFIG~/.hypa-pi/config.jsonJSON config file path. Set to none or an empty string to skip file loading.

Environment variables override config file values, and config file values override built-in defaults. The JSON file uses camelCase field names:

{
  "mode": "additive",
  "binary": "hypa",
  "rewriteTimeoutMs": 5000,
  "askNonInteractive": "deny",
  "mcpProxyEnabled": false,
  "mcpProxyTimeoutMs": 10000,
  "piMcpConfigPath": "~/.pi/agent/mcp.json"
}

All JSON fields are optional.

CLI-backed tools

When registered, the extension exposes Hypa-backed equivalents of Pi's file and shell builtins. In additive mode they sit alongside Pi's own tools; in replace mode each hypa_* tool takes over its matching builtin only when both are active.

ToolReplacesPurpose
hypa_shellbashRun shell commands with rewrite rules, compression, and evidence recording.
hypa_readreadRead files with full, outline, signatures, pruned, or smart selection.
hypa_grepgrepSearch file contents with safe ripgrep options.
hypa_findfindFind files with an optional result limit.
hypa_lslsList directory contents.

hypa_* tool outputs are capped at 50KB / 2000 lines; truncated full output is saved to a temp file for recovery.

MCP proxy discovery

When HYPA_PI_ENABLE_MCP_PROXY=1, the extension registers one compact tool, hypa_mcp_proxy, instead of dumping every upstream MCP server/tool into Pi context.

Supported actions:

  • list — compact list of upstream MCP servers configured in Hypa
  • search — search upstream tools by query
  • schema — fetch details/schema on demand for a selected server
  • invoke — invoke a selected upstream tool through Hypa's proxy/passthrough service
  • auth_check — validate auth for a selected upstream server

Servers already configured directly in Pi are filtered by default. Pass includeDuplicates=true to inspect/invoke through Hypa anyway.

Diagnostics

Run /hypa in Pi to show extension mode, binary resolution, MCP proxy setting, and the last rewrite status/error.

Safety

  • Commands already starting with hypa are not rewritten.
  • Parse, timeout, or process errors fail open by passing the original command through and recording diagnostics.
  • Deny blocks the tool call.
  • Ask confirms in UI mode and uses deterministic non-UI fallback.
  • hypa_* tool outputs are capped at 50KB / 2000 lines; truncated full output is saved to a temp file.