CLI Reference
Everything agentsmd can do. Click the copy icon on any code block to grab the command.
Quick start
Four commands to get from zero to a synced workspace.
1. Install the CLI
2. Save your API token
3. Initialize in your project
4. Sync after edits
Common workflows
Three scenarios you'll hit often.
First time on a project
Run from any project folder. The CLI detects your existing agent files (or asks one question if there are none), creates a cloud workspace, and uploads everything.
Day-to-day editing
Edit your config files locally or via the dashboard. Sync brings both sides together. When the same file changed in both places, sync keeps the most recently edited version by default.
Setting up a second machine
Same login token, then pull the workspace into a new folder.
Commands
agentsmdlogin
Save an API token to this machine.
Saves your token so subsequent commands can authenticate. Generate a token from the dashboard's Tokens page.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| --token, -t | stringDefault: required | API token from the dashboard. |
Examples
# Save a token
agentsmdinit
Create a workspace in the current folder (or clone one from the cloud).
Detects existing agent config files (CLAUDE.md, .cursorrules, .claude/, etc.) and imports them. If none are detected, asks which AI tool you use, scans your repo, and generates a single config file using a template from the cloud. Auto-pushes to the cloud at the end. Use --from to pull down a workspace that already lives in the cloud.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| --name, -n | stringDefault: current folder name | Workspace name to use when creating a new workspace. Skips the interactive picker. |
| --from | stringDefault: — | Clone an existing cloud workspace by name into a new subfolder. |
| --directory, -d | PathDefault: ./<name> | Target folder for --from. Must be empty or non-existent. |
| --no-push | booleanDefault: false | Skip the automatic cloud upload at the end of init. Run 'agentsmd up' yourself later. |
| --no-hide-ide | booleanDefault: false | Skip auto-hiding the local sync folder from VS Code / Cursor / Zed / Sublime / JetBrains explorers. |
| --force, -f | booleanDefault: false | Overwrite the target file in generate-mode if it already exists. |
Examples
# First run in a new folder
# Pull a workspace onto a second machine
# Initialize without auto-pushing
agentsmdsync
Bidirectional sync with the cloud.
Uploads your local changes and downloads cloud changes in one pass. If the same file changed on both sides, sync prompts per file with [L] Keep local / [C] Keep cloud / [M] Merge so you decide each outcome. Prefer silent newest-wins? Pass --auto for one run, or save 'agentsmd config set conflict.strategy auto' as your default. The losing version is always preserved as a backup.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| workspace_path | PathDefault: current directory | The folder to sync. Defaults to your cwd. |
| --interactive / --auto, -i | booleanDefault: prompt (interactive) | Force the [L]/[C]/[M] prompt for one run (--interactive) or force silent newest-wins (--auto). If neither flag is given, the CLI uses your saved conflict.strategy preference, which defaults to interactive. |
Examples
# Sync the current folder
# Force prompts for this run
# Force silent newest-wins for this run
agentsmdstatus
Preview what sync would do.
Shows what's pending: uploads, downloads, and conflicts. Nothing is written. Use it before a sync when you're unsure of the state.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| workspace_path | PathDefault: current directory | The folder to check. |
Examples
# Check current folder
agentsmdresolve
Redo a past conflict outcome for one file.
If sync auto-resolved a conflict the wrong way (because you passed --auto, set conflict.strategy auto, or ran sync in a non-TTY like CI), run resolve on that file. The CLI loads the backed-up version, shows the [L] Keep local / [C] Keep cloud / [B] Keep both / [M] Merge prompt, applies your choice, and pushes the result.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| path | stringDefault: required | Relative path of the file to re-decide (e.g. CLAUDE.md). |
Examples
# Flip a CLAUDE.md decision
agentsmdlist
Show your cloud workspaces.
Lists every workspace owned by the authenticated account, with last-sync time and short id.
Syntax
Examples
# List all workspaces
agentsmdlink
Bind or unbind a folder to a cloud workspace.
Binds this folder to the named cloud workspace. Use --remove to clear the binding without affecting the cloud workspace itself.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| name | stringDefault: — | Workspace name to bind this folder to. |
| --remove | booleanDefault: false | Remove the local binding. Cloud workspace is preserved. |
Examples
# Bind current folder
# Unlink (cloud workspace stays)
agentsmddelete
Delete a cloud workspace and its files.
Deletes the workspace and its files from the cloud. If the folder you're standing in is bound to the workspace you're deleting, the local binding is also removed.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| name | stringDefault: required | Workspace name to delete. |
| --force, -f | booleanDefault: false | Skip the confirmation prompt. |
Examples
# Delete with confirmation
# Delete without prompt (scripts)
agentsmdconfig
Read or write user preferences.
Currently the only validated key is conflict.strategy. Set it to 'auto' to make sync silently pick the newer side, or 'interactive' to get the [L]/[C]/[M] prompt every time. Leaving it unset keeps the interactive default.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| <key> | stringDefault: — | Preference key (currently only conflict.strategy). |
| <value> | stringDefault: — | Allowed values for conflict.strategy: auto | interactive. |
Examples
# Always auto-resolve conflicts (no prompt)
# Always prompt per conflict
# Back to default (prompt per conflict)
# Show all preferences
agentsmdconvert
Translate between AI tool config formats.
Converts a single source format (e.g. .cursorrules) into other tools (e.g. CLAUDE.md, .windsurfrules), or use --reconcile to re-derive every detected format from the source of truth (AGENTS.md by default).
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| --from | agents | claude | cursor | windsurf | copilotDefault: — | Source format to convert from. Required unless --reconcile is set. |
| --to | stringDefault: all formats | Target format. Defaults to deriving every supported format. |
| --reconcile | booleanDefault: false | Auto-detect the source and re-derive every other detected format. |
| --dry-run | booleanDefault: false | Preview the result without writing files. |
Examples
# Convert Cursor rules to every other format
# Just Claude to Cursor
# Preview without writing
# Re-derive every detected format from AGENTS.md
agentsmdup
Upload local changes only.
Pushes local file changes to the cloud workspace. Never modifies local files, never downloads. Useful for CI scripts where you want a guaranteed one-direction operation.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| workspace_path | PathDefault: current directory | The folder to upload. |
Examples
# Upload current folder
agentsmddown
Download cloud changes only.
Pulls the cloud version, overwriting local. Never uploads. Useful for disaster recovery when you want exactly what's in the cloud.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| workspace_path | PathDefault: current directory | The folder to download into. |
Examples
# Pull cloud copy into current folder
agentsmdrestore
Undo the last sync, up, or down.
Replays the single-slot backup created automatically before any sync operation. Useful when you regret a download that clobbered local edits, or when a sync produced unexpected files.
Syntax
Options
| Parameter | Type / Default | Description |
|---|---|---|
| workspace_path | PathDefault: current directory | The folder to restore. |
| --dry-run | booleanDefault: false | Preview what would be restored without writing. |
Examples
# Undo last sync
# See what restore would do first
agentsmdlogout
Clear local credentials.
Clears your saved token. Local workspace bindings are left alone.
Syntax
Examples
# Sign out from this machine
Workspaces
A workspace is a named set of agent config files that lives in your AgentsMD cloud account. Each local folder is bound to one workspace, so commands like sync know what to push and pull.
You can rename or move the folder freely. The binding follows the directory. Free accounts get 1 workspace; Pro unlocks unlimited.
Agent config files we recognize
agentsmd init detects whichever of these your project already uses, and syncs them as-is. When generating from scratch, it asks which tool you primarily use and writes only that file.
CLAUDE.md, .claude/.cursorrules, .cursor/rules/.github/copilot-instructions.md.windsurfrules, .windsurf/rules/AGENTS.mdCONVENTIONS.md, .aider.conf.yml.clinerules.continue/.rulesKIMI.md, .kimi/Conflict handling
When the same file changed on both sides since the last sync, agentsmd sync prompts you per file by default with [L] Keep local / [C] Keep cloud / [M] Merge. No silent overwrites — you decide each one. If only one side changed, sync just applies it; the prompt only appears for real conflicts.
Prefer silent newest-wins instead? The more recently edited version is kept and the loser is preserved as a backup under .agentsmd/conflicts/. Switch the default once:
To go back to the prompt (or override your saved preference for a single run), use:
Non-TTY shells (e.g. CI) always fall back to newest-wins automatically — there's no terminal to prompt. If auto-resolve (yours or CI's) picked the wrong side, run agentsmd resolve <path>. You'll get a [L] [C] [B] [M] prompt to flip the decision and push it.