rulesync-cli
v0.1.60
Published
CLI to sync CLAUDE.md files across repos via RuleSync
Downloads
1,142
Maintainers
Readme
rulesync-cli
CLI to sync config 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 | Fetch files and write them locally |
| push | Publish a local file (shows colored diff, auto-creates new rulesets) |
| diff | Show differences between local and remote files |
| list | List remote files and local file status |
| status | Show auth status |
| init | Deprecated: .rulesync.json is ignored |
Pull
Fetches your files and writes them locally. Shows diffs and prompts for approval before writing each file.
- Syncs all files in your account.
- Any local
.rulesync.jsonfile is ignored.
Diff
Shows the difference between local files and the current remote output.
- Pass an optional
[outputPath]argument to show only the diff for that file. - Does not write files — read-only comparison.
List
Lists your remote files and checks whether each local output file exists.
Push
Publishes a local file as a new version, showing a colored unified diff first so you can see exactly what's changing.
- 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@v3Common Flags
| Flag | Applies to | Description |
| --------------- | ------------------------------- | ------------------------------------------------- |
| -y, --yes | pull | Skip interactive approval |
| --dev | login, pull, push, diff, list | Use localhost instead of rulesync.dev |
| --port <port> | login, pull, push, diff, list | 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
