Command Palette

Search for a command to run...

Back to skills
skill № 01907

cli-wrapper-setup

One-shot setup that configures the CLI wrapper ecosystem across ALL AI harnesses (Claude Code, Gemini, Codex, Agy, OpenCode). Creates symlinks from Claude…

FreeNo executable scripts
Andersonlimahwby Andersonlimahw★ 19 GitHub stars

Install cli-wrapper-setup in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

CLI Wrapper Setup

Configura o ecossistema de CLI wrappers em TODOS os harnesses AI. Claude = single source of truth. Demais CLIs = symlinks.

Quick Start

/cli-wrapper:cli-wrapper-setup          — full auto-detect + setup
/cli-wrapper:cli-wrapper-setup --dry-run — preview, no changes
/cli-wrapper:cli-wrapper-setup --verify  — audit existing setup
/cli-wrapper:cli-wrapper-setup --add <cli> — add single CLI to ecosystem

What It Does

Phase 1: Discovery

  1. Detect installed CLIs: which gemini codex agy opencode claude
  2. Map each CLI to its config directory (~/.<cli>/)
  3. Check existing symlinks, skills, agents, config files
  4. Report what exists vs what needs creation

Phase 2: Claude Canonical Setup

  1. Ensure ~/.claude/skills/cli-wrapper/ exists → symlink to this plugin's source
  2. Ensure ~/.claude/agents/cli-wrapper/ exists → symlink to agents/
  3. Register in Claude's skill/agent registry

Phase 3: Cross-CLI Symlinks

For each detected non-Claude CLI:

CLI Skills Agents Config
Codex Already symlinked (skills → ~/.claude/skills) Create ~/.codex/agents/cli-wrapper/ → Claude agents Update ~/.codex/AGENTS.md
Agy Already symlinked (skills → ~/.claude/skills) Create ~/.agy/agents/ + symlinks Create ~/.agy/AGENTS.md
OpenCode Already symlinked (skills → ~/.claude/skills) Create ~/.opencode/agents/ + symlinks Create ~/.opencode/AGENTS.md
Gemini Individual skill symlinks in ~/.gemini/skills/ Individual agent symlinks in ~/.gemini/agents/ Update ~/.gemini/GEMINI.md

Phase 3.5: Agent Frontmatter Sync (MANDATORY)

Retrocompatibility contract: raw symlinks from ~/.{harness}/agents/ to Claude-format files BREAK OpenCode and may break Agy/Gemini because the frontmatter schema is harness-specific. This phase materializes per-harness copies via scripts/sync-agents.py with strict schema enforcement.

Why this exists: a previous setup created raw symlinks to Claude-format agents. OpenCode then silently dropped name: (file name = agent identity) and the missing description: caused a hard parse error. A migration attempt that uppercased tools: to Tools: and pluralized color: to colors: would also be invalid — both keys are rejected.

Per-harness schema (strict):

Harness Top-level keys kept Drops Sidecar
Claude name, description, color, mode, permission, tools — —
Codex name, description, color, mode, permission — .toml
Gemini name, description, color, mode, permission — —
Agy name, description, color, mode, permission — —
OpenCode description, color, mode, permission name —

Behavior:

  • Reads canonical agents from plugins/cli-wrapper/agents/*.md
  • Emits materialized files (not symlinks) at ~/.{harness}/agents/{name}.md
  • Codex additionally gets ~/.codex/agents/{name}.toml with the same body
  • Drops any key not in the harness whitelist; logs a [warn] line
  • Idempotent: re-running with no source change = no writes
  • --dry-run previews writes; --verify audits existing files (exit 1 on drift)

Commands:

python3 scripts/sync-agents.py            # apply
python3 scripts/sync-agents.py --dry-run  # preview
python3 scripts/sync-agents.py --verify   # audit, exit 1 on drift
python3 scripts/sync-agents.py --harness opencode  # single harness

This phase is wired into scripts/setup-symlinks.sh and scripts/menu.sh so any symlink run automatically syncs agent frontmatter.

Phase 4: Config Injection

Add to each CLI's main config file:

## 🔌 CLI Wrapper Policy (managed by cli-wrapper-setup)

⚠️ **PREFER** `/cli-wrapper:<cli>-cli invoke ...` over raw `<cli> ...` commands.
Wrapped CLIs save 60-95% tokens per invocation. List: `/cli-wrapper list`
Setup: `/cli-wrapper:cli-wrapper-setup --verify`

Files updated:

  • ~/.claude/CLAUDE.md — append policy block
  • ~/.gemini/GEMINI.md — append policy block
  • ~/.codex/AGENTS.md — append policy block
  • ~/.agy/AGENTS.md — create + append
  • ~/.opencode/AGENTS.md — create + append

Phase 5: Verification

  1. Every symlink resolves correctly
  2. cli-wrapper list works in each CLI
  3. Token audit runs without errors
  4. Config files contain the policy block
  5. Report: green checkmarks or red X's

Architecture — Single Source of Truth

lemon-ai-hub/plugins/cli-wrapper/     ← CANONICAL SOURCE (git)
  ├── SKILL.md
  ├── plugin.json
  ├── skills/                          ← wrapper skills
  │   ├── cli-wrapper-setup/
  │   ├── claude-cli/
  │   ├── gemini-cli/
  │   ├── codex-cli/
  │   ├── opencode-cli/
  │   └── agy-cli/
  ├── agents/                          ← wrapper agents
  │   ├── claude-cli.md
  │   ├── gemini-cli.md
  │   ├── codex-cli.md
  │   ├── opencode-cli.md
  │   └── agy-cli.md
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the cli-wrapper-setup skill do?

One-shot setup that configures the CLI wrapper ecosystem across ALL AI harnesses (Claude Code, Gemini, Codex, Agy, OpenCode). Creates symlinks from Claude (single source of truth) to every other CLI, registers wrapper skills/agents in each harness, and injects the "prefer wrapped CLI" policy into each CLI's config file. Run once per machine or after adding a new CLI to the ecosystem.

How do I install the cli-wrapper-setup skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the cli-wrapper-setup skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare cli-wrapper-setup with