Thanks to visit codestin.com
Credit goes to github.com

Skip to content

przadka/zrobi

Repository files navigation

zrobi

Sync slash commands across AI coding tools. Define once in ~/.zrobi/commands/, run zrobi build, and they appear in Claude Code, Gemini CLI, Codex CLI, OpenCode, and Cline.

Why

Each tool has its own command format and location:

Tool Location Format
Claude Code ~/.claude/commands/ Markdown + YAML
Codex CLI ~/.codex/prompts/ Markdown + YAML
Gemini CLI ~/.gemini/commands/ TOML
OpenCode ~/.config/opencode/command/ Markdown + YAML
Cline ~/Documents/Cline/Workflows/ Markdown

Maintaining the same commands across all of them by hand is tedious. zrobi handles the conversion and copying.

Installation

npm install -g zrobi

# Or use without installing
npx zrobi status

On first run, zrobi creates ~/.zrobi/commands/ automatically. Add your commands there.

Usage

# Check which tools are detected
zrobi status

# Build commands for all enabled tools
zrobi build

# Build for one tool only
zrobi build --tool gemini

# Preview without writing anything
zrobi build --dry-run

Sync mode

By default, zrobi build only adds and updates files. Deleted commands stay in tool directories until you remove them manually.

Use --sync to also clean up stale files:

zrobi build --sync --dry-run  # Preview what would be deleted
zrobi build --sync            # Do it

Warning: --sync deletes any files in tool directories not managed by zrobi, including manual customizations. Always run with --dry-run first.

Writing commands

Commands use Claude Code's format (Markdown + YAML frontmatter). Create a file in ~/.zrobi/commands/:

---
description: Short description shown in command list
argument-hint: '[optional-arg]'
---

Your prompt content here.

Use $ARGUMENTS for user input.
Use $1, $2 for positional arguments.

zrobi automatically converts placeholders per tool (e.g., $ARGUMENTS{{args}} for Gemini).

Then run zrobi build.

Subdirectories

Organize commands in folders:

~/.zrobi/commands/
├── git/
│   ├── commit.md      → /git:commit
│   └── review-pr.md   → /git:review-pr
└── deploy.md          → /deploy

Note: Codex CLI doesn't support subdirectories, so git/commit.md becomes git-commit.md. Avoid naming collisions like having both git-commit.md and git/commit.md.

Configuration

Copy config.example.yaml to ~/.zrobi/config.yaml and edit:

tools:
  claude:
    enabled: true
    global_path: ~/.claude/commands
  gemini:
    enabled: true
    global_path: ~/.gemini/commands

# Skip specific commands for specific tools
exclude:
  gemini:
    - some-claude-only-command

Per-tool overrides in frontmatter:

---
description: Default description
gemini:
  description: Gemini-specific description
---

Auxiliary files

README.md files in ~/.zrobi/commands/ are copied verbatim (not parsed as commands). This lets you include documentation alongside your commands.

~/.zrobi/commands/
├── README.md        # Copied to all tool directories
├── git/
│   ├── README.md    # Copied to git/ subdirectory
│   └── commit.md
└── deploy.md

Configure patterns in ~/.zrobi/config.yaml:

auxiliary:
  patterns:
    - "**/README.md"    # Default
    - "**/NOTES.md"     # Additional pattern

Note: Cline skips auxiliary files because it would parse README.md as a command.

Limitations

  • Global commands only - No project-level command support yet
  • One-way sync - Edits made directly in tool directories get overwritten on next build
  • Cursor/Windsurf - Not implemented (project-only commands complicate things)

Development

pnpm install
pnpm dev
pnpm test
pnpm lint
pnpm typecheck
pnpm build

Adding a new tool: create an adapter in src/adapters/ following the existing pattern.

License

MIT

About

Sync slash commands across AI coding tools (Claude Code, Gemini CLI, Codex CLI, etc.)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published