Skip to content
petrogurcakPublic

About

Share project config between Claude Code and Gemini CLI. One AGENT.md, both tools read it.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

dual-cli

Share project configuration between Claude Code and Gemini CLI. One source of truth, both tools read it.

The Problem

Claude Code reads CLAUDE.md. Gemini CLI reads GEMINI.md. If you use both, you maintain two files with the same content.

The Solution

AGENT.md              ← write once (source of truth)
CLAUDE.md → AGENT.md  ← symlink (Claude Code reads this)
GEMINI.md → AGENT.md  ← symlink (Gemini CLI reads this)

Same pattern for MCP servers — one YAML, generates both formats.

Quick Start

New project

git clone https://github.com/petrogurcak/dual-cli.git
cd dual-cli
./setup.sh /path/to/your/project

Existing project with CLAUDE.md

cd your-project
mv CLAUDE.md AGENT.md
ln -s AGENT.md CLAUDE.md
ln -s AGENT.md GEMINI.md

That's it. Both tools now read the same instructions.

MCP Server Sync

Both Claude Code and Gemini CLI support MCP servers but store config differently:

Tool Config file Location
Claude Code .mcp.json project root
Gemini CLI .gemini/settings.json project root

The format is actually identical (mcpServers JSON), just different file paths. sync-mcp.sh generates both from one source:

# 1. Define servers once
vim mcp-servers.yaml

# 2. Generate both configs
./sync-mcp.sh
# → .mcp.json (Claude Code)
# → .gemini/settings.json (Gemini CLI)

mcp-servers.yaml format

servers:
  fetch:
    command: npx
    args:
      - -y
      - "@modelcontextprotocol/server-fetch"

  filesystem:
    command: npx
    args:
      - -y
      - "@modelcontextprotocol/server-filesystem"
      - "/path/to/project"

Skills

Both tools support skills via SKILL.md files with the same format:

---
name: my-skill
description: Use when...
---

# My Skill

Instructions...

Claude Code: Install through /plugins marketplace or plugin cache.

Gemini CLI: Link directly:

gemini skills link /path/to/skills/directory

If your skills live in one directory, Gemini CLI can symlink them all at once.

Global Config

Global configs can't be symlinked (different paths, different filenames):

Tool Global config
Claude Code ~/.claude/CLAUDE.md
Gemini CLI ~/.gemini/GEMINI.md

Keep them manually in sync, or maintain a shared source and copy on change. The universal parts (identity, rules, personality) are the same — only tool-specific paths differ.

What's Included

dual-cli/
├── README.md          # this file
├── AGENT.md           # example shared instructions
├── CLAUDE.md          # → AGENT.md (symlink)
├── GEMINI.md          # → AGENT.md (symlink)
├── mcp-servers.yaml   # MCP server definitions (source of truth)
├── sync-mcp.sh        # generates .mcp.json + .gemini/settings.json
├── setup.sh           # add dual-CLI to existing projects
└── .gitignore         # ignores generated configs

Requirements

  • Claude Code (any version)
  • Gemini CLI v0.29+ (npm install -g @google/gemini-cli)
  • Python 3 (for sync-mcp.sh)

License

MIT

About

Share project config between Claude Code and Gemini CLI. One AGENT.md, both tools read it.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages