pi-unify-cmd

Load slash commands from Claude Code, OpenCode, Codex, and Gemini CLI into pi — adapter pattern with configurable sources and formats

Packages

Package details

extensionskill

Install pi-unify-cmd from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-unify-cmd
Package
pi-unify-cmd
Version
0.2.1
Published
May 31, 2026
Downloads
288/mo · 11/wk
Author
buihongduc132
License
MIT
Types
extension, skill
Size
67.2 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-unify-cmd

npm version license tests

Load slash commands from Claude Code, OpenCode, Codex, and Gemini CLI into pi — using the adapter pattern with configurable sources and formats.

Features

  • Multi-agent discovery — automatically scans .md and .toml command files from Claude Code, OpenCode, Codex, and Gemini CLI
  • Agent-prefixed commands — each command gets a namespaced name (e.g. /claude:review, /codex:opsx-apply, /gemini:change)
  • Full argument interpolation — normalizes $ARGUMENTS, $1, $@, ${@:N:L}, {{args}} across all agents
  • Custom adapters — add your own command sources with configurable formats
  • Global + project config — deep merge of ~/.pi/agent/unify-cmd.json and .unify-cmd.json
  • Management slash commands — list, reload, scan, and config inspection

Installation

For humans

# Add to your pi settings:
pi --add-package pi-unify-cmd

Or manually add to ~/.pi/agent/settings.json:

{
  "packages": ["pi-unify-cmd"]
}

For AI agents

Add "pi-unify-cmd" to the packages array in ~/.pi/agent/settings.json, then run pi install.

Git-sourced

{
  "packages": [
    "github:buihongduc132/pi-unify-cmd"
  ]
}

Usage

Once installed, pi-unify-cmd automatically discovers command files from other CLI agents and registers them as pi slash commands.

Supported Agents

Agent Format Global Dir Project Dir
Claude Code YAML frontmatter ~/.claude/commands/ .claude/commands/
OpenCode YAML frontmatter ~/.config/opencode/commands/ .opencode/commands/
Codex YAML frontmatter ~/.codex/prompts/
Gemini TOML + YAML frontmatter ~/.gemini/commands/
Custom Configurable Configurable Configurable

Argument Interpolation

Agent Syntax Example
Claude $ARGUMENTS Review: $ARGUMENTS
Codex $1, $@, ${@:N:L} Create $1 with $@
Gemini {{args}} Run: {{args}}
Pi $1, $@, ${@:N:L} Build $1 ${@:2}

Management Commands

/unify-cmd:list    — List all discovered commands
/unify-cmd:reload  — Rescan all directories
/unify-cmd:scan    — Show directory discovery details
/unify-cmd:config  — Show current configuration

Configuration

Global: ~/.pi/agent/unify-cmd.json Project: .unify-cmd.json

{
  "agents": {
    "claude": { "enabled": true, "globalDir": "~/.claude/commands", "projectDir": ".claude/commands" },
    "opencode": { "enabled": true, "globalDir": "~/.config/opencode/commands", "projectDir": ".opencode/commands" },
    "codex": { "enabled": true, "globalDir": "~/.codex/prompts" },
    "gemini": { "enabled": true, "globalDir": "~/.gemini/commands" }
  },
  "custom": [
    {
      "name": "my-agent",
      "enabled": true,
      "globalDir": "~/.my-agent/cmds",
      "format": "yaml-frontmatter"
    }
  ],
  "labelFormat": "[{scope}] ({agent}) | {description}",
  "prefixFormat": "{agent}:{name}"
}
Option Description Default
agents.*.enabled Enable/disable agent true
agents.*.globalDir Global commands directory agent-specific
agents.*.projectDir Project-level commands directory agent-specific
custom Array of custom adapter configs []
labelFormat Autocomplete description format [{scope}] ({agent}) | {description}
prefixFormat Command name format {agent}:{name}

Tokens: {scope}G/L, {agent} → agent name, {name} → command name, {description} → command description

License

MIT © buihongduc132

Repository: buihongduc132/pi-unify-cmd