---
draft: false
title: agentsmesh import
description: Import an existing AI tool's configuration into the canonical .agentsmesh/ directory. Supports all targets with lossless round-trip fidelity.
---

Import an existing tool's native config into the canonical `.agentsmesh/` directory. The import is lossless — internal file references, cross-skill links, and tool-specific metadata are all preserved.

## Usage

```bash
agentsmesh import --from <target>
```

```bash
agentsmesh import --global --from claude-code
```

## Flags

| Flag | Description |
|------|-------------|
| `--from <target>` | Source tool ID to import from. **Required.** |
| `--global` | Import from user-level tool paths into `~/.agentsmesh/`. See the global-mode sections below for target-specific paths and current importer caveats. |

## Supported targets

The table below lists every builtin target's project-scope import root. With `--global`, AgentsMesh uses the user-level paths documented in the global-mode sections below. This table is generated from the target catalog — see [the support matrix](../../reference/supported-tools/) for full feature coverage per tool.

{/* agentsmesh:import-targets:start */}
| Target ID | Tool | Reads from |
|-----------|------|-----------|
| `aider` | [Aider](https://aider.chat) | `CONVENTIONS.md` |
| `amazon-q` | [Amazon Q Developer](https://aws.amazon.com/q/developer) | `.amazonq/rules` |
| `amp` | [Amp](https://ampcode.com) | `AGENTS.md` |
| `antigravity` | [Antigravity](https://antigravity.google) | `.agents/rules` |
| `augment-code` | [Augment Code](https://www.augmentcode.com) | `.augment/rules` |
| `claude-code` | [Claude Code](https://www.anthropic.com/claude-code) | `CLAUDE.md` |
| `cline` | [Cline](https://cline.bot) | `AGENTS.md` |
| `codex-cli` | [Codex CLI](https://github.com/openai/codex) | `AGENTS.md` |
| `continue` | [Continue](https://continue.dev) | `.continue/rules` |
| `copilot` | [GitHub Copilot](https://github.com/features/copilot) | `.github/copilot-instructions.md` |
| `crush` | [Crush](https://github.com/charmbracelet/crush) | `CRUSH.md` |
| `cursor` | [Cursor](https://cursor.com) | `.cursor/rules/general.mdc` |
| `deepagents-cli` | [Deep Agents CLI](https://github.com/langchain-ai/deepagents) | `.deepagents/AGENTS.md` |
| `factory-droid` | [Factory Droid](https://www.factory.ai) | `AGENTS.md` |
| `gemini-cli` | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `.gemini/rules` |
| `goose` | [Goose](https://block.github.io/goose) | `.goosehints` |
| `jules` | [Jules](https://jules.google) | `AGENTS.md` |
| `junie` | [Junie](https://www.jetbrains.com/junie) | `.junie/rules` |
| `kilo-code` | [Kilo Code](https://kilocode.ai) | `AGENTS.md` |
| `kiro` | [Kiro](https://kiro.dev) | `AGENTS.md` |
| `opencode` | [OpenCode](https://opencode.ai) | `AGENTS.md` |
| `pi-agent` | [Pi Agent](https://github.com/earendil-works/pi) | `AGENTS.md` |
| `qwen-code` | [Qwen Code](https://github.com/QwenLM/qwen-code) | `QWEN.md` |
| `replit-agent` | [Replit Agent](https://replit.com) | `replit.md` |
| `roo-code` | [Roo Code](https://roocode.com) | `.roo/rules/00-root.md` |
| `rovodev` | [Rovo Dev](https://www.atlassian.com/solutions/devops/rovo-dev) | `AGENTS.md` |
| `trae` | [Trae](https://www.trae.ai) | `.trae/rules/project_rules.md` |
| `warp` | [Warp](https://www.warp.dev) | `WARP.md` |
| `windsurf` | [Windsurf](https://windsurf.com) | `AGENTS.md` |
| `zed` | [Zed](https://zed.dev) | `.rules` |
{/* agentsmesh:import-targets:end */}

## Examples

```bash
# Import Claude Code configuration
agentsmesh import --from claude-code

# Import Claude Code global configuration from ~/.claude/ into ~/.agentsmesh/
agentsmesh import --global --from claude-code

# Import Cursor rules and settings
agentsmesh import --from cursor
```

Any target ID from the table above is valid for `--from`. Run `agentsmesh init` first if you're unsure which tools have configs in the current project — it auto-detects every builtin target.

## What import maps

The same canonical structure under `.agentsmesh/` is produced regardless of which target you import from:

| Source feature | Canonical destination |
|----------------|----------------------|
| Root rule + per-file rules | `.agentsmesh/rules/_root.md`, `.agentsmesh/rules/*.md` |
| Commands / prompts / workflows | `.agentsmesh/commands/*.md` |
| Agents / subagents / droids | `.agentsmesh/agents/*.md` |
| Skills / SKILL bundles | `.agentsmesh/skills/<name>/SKILL.md` (+ supporting files) |
| MCP servers | `.agentsmesh/mcp.json` |
| Hooks | `.agentsmesh/hooks.yaml` |
| Permissions | `.agentsmesh/permissions.yaml` |
| Ignore patterns | `.agentsmesh/ignore` |

Each target's native file paths and feature support are listed in the [supported tools matrix](../../reference/supported-tools/). Embedded features (e.g., Codex CLI commands projected as skills) are restored to their original canonical format on import — not the projected wrapper.

## Global-mode caveats

A handful of targets have global-mode importer behavior worth noting. For every target not listed here, `--global` simply reads from the documented user-level paths and writes to `~/.agentsmesh/`.

### Antigravity

Project-only paths such as `.agents/workflows/` are not scanned in global mode.

### Cline

`agentsmesh generate --global --targets cline` writes rules and workflows to `~/Documents/Cline/`, but the current importer reads Cline's project-style paths under `$HOME` (`~/.clinerules`, `~/.cline/skills/`, `~/.cline/cline_mcp_settings.json`, `~/.clineignore`). Generated hook scripts under `~/Documents/Cline/Hooks/` are not imported back into `hooks.yaml` yet.

### Windsurf

`agentsmesh generate --global --targets windsurf` writes native user-level files under `~/.codeium/windsurf/`, but the current importer reads Windsurf's project-style paths under `$HOME` (`~/.windsurfrules` or `~/AGENTS.md`, `~/.windsurf/`, `~/.windsurfignore` or `~/.codeiumignore`).

### Codex CLI

`~/.codex/AGENTS.override.md` is preferred over `~/.codex/AGENTS.md` when both exist. Global import does **not** recurse nested `AGENTS.md` files under `$HOME`.

### Cursor

Global import reads `~/.cursor/rules/*.mdc` first, then falls back to legacy `~/.agentsmesh-exports/cursor/user-rules.md` or `~/.cursor/AGENTS.md`, and reads MCP, hooks, ignore, skills, agents, and commands from `~/.cursor/`.

## Reference rewriting

During import, AgentsMesh rewrites internal file references:
- `.claude/skills/api-gen/template.hbs` → `.agentsmesh/skills/api-gen/template.hbs`
- Tool-relative paths → canonical paths

This keeps cross-references valid after import.

## Import idempotency

Running import twice on the same source is safe. Existing canonical files are merged — no duplicates are created.

## Post-import: MCP server entry

After importing from a tool that manages MCP servers (e.g. `claude-code`, `cursor`, `gemini-cli`), the AgentsMesh self-serve MCP server entry is seeded into `.agentsmesh/mcp.json` if it is not already present. This ensures the [MCP Server](../../reference/mcp-server/) entry survives import round-trips and is always available after generation.
