Content
# claude-config-cli
English | [中文](README.zh-CN.md)
A CLI tool for exporting and importing Claude Code configuration. Backs up Skills, Plugins, MCP Servers, CLAUDE.md, and custom commands as compressed archives, with full restore support.
## What Gets Exported
| Type | Source | Description |
|------|--------|-------------|
| CLAUDE.md | `~/.claude/CLAUDE.md` | Global instructions file |
| Commands | `~/.claude/commands/*.md` | Custom slash commands |
| Skills | `~/.claude/skills/*/` | All files in each skill directory |
| Plugins | `~/.claude/settings.json` + `installed_plugins.json` + `known_marketplaces.json` | Plugins, marketplace sources, full settings |
| MCP Servers | `~/.claude.json` top-level `mcpServers` | All MCP server definitions |
## Install
```bash
go build -o claude-config .
```
## Usage
### list — View current config
```bash
claude-config # Show all
claude-config list --skills # Skills only
claude-config list --plugins # Plugins only
claude-config list --mcp # MCP servers only
claude-config list --claude-md # CLAUDE.md only
claude-config list --commands # Commands only
```
### export — Create backup
```bash
claude-config export # Default: tar.zst archive (auto-named)
claude-config export -o backup.tar.zst # Specify output path
claude-config export --format gz -o backup.json.gz # gzip format
claude-config export --format zst -o backup.json.zst # JSON+zstd format
claude-config export --format json -o backup.json # Plain JSON
claude-config export --plugins # Plugins only
claude-config export --mcp # MCP servers only
claude-config export --skills # Skills only
```
Supported formats (`--format`):
| Format | Extension | Description |
|--------|-----------|-------------|
| `tar` (default) | `.tar.zst` | tar archive + zstd compression (~91% compression, 352MB → 30MB) |
| `zst` | `.json.zst` | JSON + zstd compression |
| `gz` | `.json.gz` | JSON + gzip compression |
| `json` | `.json` | Plain JSON (no compression) |
### inspect — View backup summary
```bash
claude-config inspect backup.tar.zst # Positional argument
claude-config inspect -i backup.tar.zst # Flag style
claude-config inspect backup.tar.zst --skills # Skills summary
claude-config inspect backup.tar.zst --mcp # MCP servers only
```
Shows file count and size per skill, plugin versions and marketplace sources, MCP server command/args/env (env values masked as `***`).
Works with all formats: `.tar.zst`, `.json.zst`, `.json.gz`, `.json`.
### import — Restore from backup
```bash
claude-config import backup.tar.zst # Import to ~/.claude
claude-config import backup.tar.zst -d ./restore # Import to custom directory
claude-config import backup.tar.zst --dry-run # Preview without writing
claude-config import backup.tar.zst --plugins # Plugins only
claude-config import backup.tar.zst --skills -d ./restore # Skills only to custom dir
```
Import **merges** with existing config (non-destructive):
- `settings.json` — merged by key, new values override
- `known_marketplaces.json` — merged by marketplace name
- `installed_plugins.json` — appended to existing records
- `~/.claude.json` `mcpServers` — merged by server name
- Skills / Commands / CLAUDE.md — written directly
Supports all export formats: `.tar.zst`, `.json.zst`, `.json.gz`, `.json`.
## Project Structure
```
├── main.go # CLI entry, cobra commands
├── internal/
│ ├── config/paths.go # ~/.claude/ path resolution
│ ├── model/types.go # Data structures
│ ├── reader/
│ │ ├── misc.go # Read CLAUDE.md, commands
│ │ ├── skills.go # Recursively read skill directories
│ │ ├── plugins.go # Read plugins, marketplaces, settings
│ │ └── mcp.go # Read ~/.claude.json mcpServers
│ ├── importer/importer.go # Import logic (merge write)
│ └── writer/
│ ├── format.go # Format type, extension mapping, auto-detect
│ ├── tar.go # tar.zst archive export/import
│ ├── json.go # JSON-based export/import (gz/zst/plain), inspect
│ └── table.go # Terminal table output
```
## Dependencies
- [cobra](https://github.com/spf13/cobra) — CLI framework
- [klauspost/compress](https://github.com/klauspost/compress) — zstd compression
- Go stdlib: `archive/tar`, `compress/gzip`, `encoding/json`, `text/tabwriter`
## License
MIT
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.