rulesync-cli
v0.1.65
Published
CLI to sync CLAUDE.md files across repos via RuleSync
Maintainers
Readme
rulesync-cli
CLI to sync config files (like CLAUDE.md, AGENTS.md, and prompt files) across repos via RuleSync.
The command is invoked as rsc (preferred) or rulesync-cli (legacy alias). Both names point at the same binary — pick whichever fits your muscle memory.
Installation
No install required — run directly with npx:
npx rulesync-cliOr install globally and use the short rsc command:
npm install -g rulesync-cli
rsc --helpIn a project that lists rulesync-cli as a dependency:
pnpm rsc pull
pnpm rsc push ./CLAUDE.mdUsage
rsc [command]If no command is given, pull is run by default.
Version
rsc -v
rsc --versionCommands
| Command | Description |
| ---------------- | ------------------------------------------------------------------------- |
| login | Authenticate via browser-based login |
| pull [file] | Fetch files and write them locally (optionally just one file/slug) |
| push <file> | Publish a local file (shows colored diff, auto-creates new rulesets) |
| diff [path] | Show differences between local and remote files |
| list | List remote files and local file status |
| clean | Strip RuleSync boilerplate comments from local files |
| status | Show auth status |
| init | Deprecated: .rulesync.json is ignored |
Login
Authenticates via a browser-based flow and writes credentials to ~/.rulesync/auth.json.
rsc loginPull
Fetches your files and writes them locally. By default it syncs all files in your account, showing a per-ruleset table (with a local-existence indicator) before writing.
# Pull everything
rsc pull
# Pull a single file by output path...
rsc pull CLAUDE.md
# ...or by ruleset slug
rsc pull ai-prompts-blog- Single-file pulls: pass an output path or ruleset slug to fetch just that one file.
- Pull types: each file is either
replace(overwrite local content, the default) orask(show a diff and prompt before overwriting). - Boilerplate is stripped automatically —
Managed by RuleSync,Last synced, andRulesetscomment headers are removed on write. - Symlinks: any symlinks configured for a file are (re)created automatically.
- Any local
.rulesync.jsonfile is ignored. - Use
-y, --yesto skip interactive approval and write all files.
Push
Publishes a local file as a new version, showing a colored unified diff first so you can see exactly what's changing.
rsc push ./ai/prompts/blog.md- Colored diff before publishing: green = lines added, red = lines removed, cyan = hunk headers.
- Auto-creates rulesets the first time you push a path the server hasn't seen. The slug is derived from the file path (e.g.
./ai/prompts/blog.md→ai-prompts-blog). - Skips the API call entirely when local content already matches remote — no duplicate versions, no version-number churn.
- Existing rulesets are matched against your local file path automatically.
Example:
$ rsc push ./ai/prompts/blog.md
--- ai/prompts/blog.md (remote)
+++ ai/prompts/blog.md (local)
@@ -3,3 +3,3 @@
some context line
-old line being replaced
+new line that replaced it
another context line
Published ai-prompts-blog@v3Diff
Shows the difference between local files and the current remote output. Read-only — it never writes files.
# Diff all files
rsc diff
# Diff a single output path
rsc diff CLAUDE.mdList
Lists your remote files and checks whether each local output file exists, rendered as an aligned, color-coded table.
rsc listClean
Removes RuleSync boilerplate comment headers (Managed by RuleSync, Last synced, Rulesets) from your local files in place, reporting how many were cleaned vs. skipped.
rsc cleanStatus
Shows your current authentication status.
rsc statusCommon Flags
| Flag | Applies to | Description |
| --------------- | ------------------------------------------- | ------------------------------------------------- |
| -y, --yes | pull | Skip interactive approval, write all files |
| --dev | login, pull, push, diff, list, clean | Use localhost instead of rulesync.dev |
| --port <port> | login, pull, push, diff, list, clean | Dev server port (default: 3000, requires --dev) |
Quick Start
# 1. Authenticate
rsc login
# 2. Pull files into your project
rsc pullThat's it. No install or init step required — pull works immediately and syncs all your files.
Auth config (~/.rulesync/auth.json)
Created automatically by rsc login.
Changelog
See CHANGELOG.md for release history.
License
MIT
