Skip to content

Separate Input Root

The --input-root <path> flag lets you point rulesync generate at a .rulesync/ source directory that is different from the current working directory. This decouples where your rule definitions live from where the generated tool configuration files are written.

Currently supported on generate only. At present, --input-root is wired into the rulesync generate command only. Other commands (import, convert, gitignore, install, fetch, init) still read .rulesync/ from the current working directory. To use the same source directory with those commands, cd into the input-root directory first.

Primary use case: centralized rules across all repos

A common workflow is to keep a single set of AI rules in a shared directory (e.g. ~/.aiglobal) and apply them to every project without switching directories:

bash
# In any project directory — rules are read from ~/.aiglobal/.rulesync/
rulesync generate --input-root ~/.aiglobal --targets "*" --features rules

Without --input-root, you would have to cd ~/.aiglobal && rulesync generate and then cd - back, and the output files would land in ~/.aiglobal instead of the current project.

Step-by-step setup

  1. Create and initialize a shared rules directory:

    bash
    mkdir -p ~/.aiglobal
    cd ~/.aiglobal
    rulesync init
  2. Edit your shared rules (~/.aiglobal/.rulesync/rules/overview.md, etc.) to your preferences.

  3. From any project, generate configurations using the shared rules:

    bash
    # In your project directory
    rulesync generate --input-root ~/.aiglobal --targets claudecode --features rules

Comparison with --global

These two flags serve different but complementary purposes:

--input-root--global
ChangesSource location (where .rulesync/ is read from)Output location (writes to user-scope config paths, e.g. ~/.claude/)
Use whenYour rule definitions live in a non-CWD directoryYou want the output to go to the tool's global (user-scope) config

They can be combined. For example, to read rules from ~/.aiglobal and write them to Claude Code's global settings:

bash
rulesync generate --input-root ~/.aiglobal --global --targets claudecode --features rules

--input-root does not enable --global. When --input-root is explicitly provided, Rulesync reads .rulesync/ from that directory, but output scope still follows the CLI flags: use --global for user-scope output, and omit it for project-scope output. A "global": true setting in the rulesync.jsonc under --input-root is not applied unless you also pass --global, and Rulesync will emit a warning when dropping it so the override is visible.

Rulesync follows symbolic links during file discovery. A symlink inside .rulesync/ that points outside the directory will be followed transparently, and the resolved file content will be copied into the generated output. This is intentional: it lets you centralize shared skills or rules in one place and reference them via symlinks from multiple project directories without duplication.

The trust boundary is the directory you point Rulesync at. --input-root is resolve()-ed to an absolute path before use, but there is no realpath-based boundary check on individual symlinks inside it. Only run Rulesync against trees you control. Directory symlink cycles are handled safely — discovery results are deduplicated by real path, so a cycle does not produce duplicated output. See the File Formats § Symlinks note for the behavior that applies across all features.

Released under the MIT License.