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

ai-command-converter

v0.1.0

Published

Bi-directional converter between Claude Code and Gemini CLI command formats

Readme

AI Command Converter

Bi-directional converter between Claude Code and Gemini CLI command formats. This library enables seamless sharing of AI commands between different CLI tools, fostering a more connected AI assistant ecosystem.

Features

  • 🔄 Bi-directional conversion between Claude Code (.md) and Gemini CLI (.toml) formats
  • 🎯 Smart parameter mapping with type conversion and validation
  • CLI tool for batch conversions
  • 📦 Programmatic API for integration into other tools
  • 🔍 Compatibility checking with detailed warnings
  • 📝 Format preservation maintains metadata and structure where possible

Installation

npm install -g ai-command-converter

Or use in your project:

npm install ai-command-converter

Quick Sync Setup

To automatically sync your Claude Code and Gemini CLI commands:

# One-time bi-directional sync
npx ai-command-sync sync

# Watch for changes and auto-sync
npx ai-command-sync watch

# Sync in one direction only
npx ai-command-sync sync --direction claude-to-gemini

Quick Start

CLI Usage

Convert a single file:

ai-command-converter convert blog-writer.md --output blog-writer.toml

Convert an entire directory:

ai-command-converter convert ./claude-commands --output ./gemini-commands --format toml

Programmatic Usage

import { ClaudeCodeCommand, GeminiCommand, Converter } from 'ai-command-converter';

// Parse a Claude Code command
const claudeCmd = await ClaudeCodeCommand.fromFile('./commands/blog-writer.md');

// Convert to Gemini format
const geminiCmd = await Converter.toGemini(claudeCmd);

// Save the converted command
await geminiCmd.saveToFile('~/.gemini/commands/blog-writer.toml');

// Or go the other direction
const geminiCmd = await GeminiCommand.fromFile('./blog.toml');
const claudeCmd = await Converter.toClaudeCode(geminiCmd);

Command Sync

Keep your Claude Code and Gemini CLI commands automatically synchronized:

Basic Sync

# Sync all commands between ~/.claude/commands and ~/.gemini/commands
npx ai-command-sync sync

# Dry run to see what would change
npx ai-command-sync sync --dry-run

# Verbose output
npx ai-command-sync sync --verbose

Watch Mode

Automatically sync changes as they happen:

# Watch for changes every 5 seconds (default)
npx ai-command-sync watch

# Custom check interval
npx ai-command-sync watch --interval 10

Advanced Options

# Custom directories
npx ai-command-sync sync \
  --claude-dir ~/my-claude-commands \
  --gemini-dir ~/my-gemini-commands

# One-way sync
npx ai-command-sync sync --direction claude-to-gemini
npx ai-command-sync sync --direction gemini-to-claude

# Conflict resolution strategies
npx ai-command-sync sync --conflict newest  # Use newest file (default)
npx ai-command-sync sync --conflict skip    # Skip conflicts
npx ai-command-sync sync --conflict prompt  # Interactive prompt

Organization Support

The sync tool preserves organization structure:

  • Claude: ~/.claude/commands/github-import.md
  • Gemini: ~/.gemini/commands/anthropic/github-import.toml

Commands are matched by name, supporting both flat and organized structures.

Format Examples

Key Differences

  • Claude Code: Uses {{parameter}} placeholders for each parameter
  • Gemini CLI: Uses {{args}} for all arguments, which the AI parses based on the prompt instructions

Claude Code Format (.md)

---
title: "Generate Blog Post"
description: "Creates a blog post on any topic"
params:
  - name: topic
    type: string
    required: true
    description: "The blog topic"
  - name: tone
    type: enum
    options: [neutral, playful, formal]
    default: neutral
---

# Instructions

Write a comprehensive blog post about {{topic}} in a {{tone}} tone...

Gemini CLI Format (.toml)

description = "Creates a blog post on any topic"

prompt = """
Parse the provided arguments: {{args}}

Expected parameters:
- topic: The blog topic [required]
- tone: Writing tone (default: neutral) [optional]

Write a comprehensive blog post about the specified topic in the requested tone...
"""

API Reference

Core Classes

ClaudeCodeCommand

  • static fromFile(path) - Parse a .md file
  • static fromString(content) - Parse markdown content
  • toObject() - Get command as plain object
  • validate() - Validate command structure

GeminiCommand

  • static fromFile(path) - Parse a .toml file
  • static fromString(content) - Parse TOML content
  • toObject() - Get command as plain object
  • validate() - Validate command structure

Converter

  • static async toGemini(claudeCommand, options) - Convert to Gemini format
  • static async toClaudeCode(geminiCommand, options) - Convert to Claude format
  • static validate(command, targetFormat) - Check compatibility

Conversion Options

const options = {
  // Preserve organization structure in output path
  preserveNamespace: true,
  
  // Include source metadata in converted files
  includeSourceMetadata: true,
  
  // Validation strictness
  strict: false,
  
  // Custom parameter mapping (advanced use)
  parameterMapping: {
    'topic': 'subject'
  }
};

const geminiCmd = await Converter.toGemini(claudeCmd, options);

Compatibility

Supported Features

| Feature | Claude → Gemini | Gemini → Claude | |---------|----------------|-----------------| | Basic metadata | ✅ | ✅ | | String parameters | ✅ | ✅ | | Enum parameters | ⚠️ Converted to string | ✅ Inferred from usage | | Optional params | ✅ | ✅ | | Default values | ✅ | ⚠️ Parsed from usage | | Multi-line content | ✅ | ✅ | | MCP requirements | ⚠️ Added as comment | ❌ Not supported |

Limitations

  • Gemini → Claude: Parameter types must be inferred from usage documentation
  • Claude → Gemini: Complex parameter types are simplified to strings
  • Both directions: Some metadata may be lost in conversion

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MIT - See LICENSE for details.

Credits

Created by Commands.com to foster interoperability in the AI CLI ecosystem.