Rayfin

rayfin init ai-files

Install, refresh, disable, and audit Rayfin-managed agent files with rayfin init ai-files install and status.

rayfin init ai-files manages the agent context that Rayfin projects ship for coding agents. Scaffolding runs it automatically; run it again after upgrading the CLI or when rayfin up reports drift.

Managed items in 1.36.2

ItemIDBehavior
AGENTS.mdone-time installSeeded only when missing. Never overwritten by install, even with --force.
.mcp.json mcpServers.rayfin keymcp:rayfinOwned by Rayfin. The CLI updates only the mcpServers.rayfin key and preserves other servers.
.agents/skills/rayfin/SKILL.mdskill:rayfinCore Rayfin project skill.
.agents/skills/rayfin-functions/SKILL.mdskill:rayfin-functionsFunctions skill.
.agents/skills/rayfin-connectors/SKILL.mdskill:rayfin-connectorsConnectors skill.
.agents/skills/rayfin-storage/SKILL.mdskill:rayfin-storageStorage skill, installed only when the storage feature flag or service is enabled. New in 1.36 Experimental

The lockfile is rayfin/.lockfile.json. Commit it so every developer sees the same managed-item baseline.

ai-files install

npx rayfin init ai-files install

Idempotently reconciles managed items with the bundled 1.36.2 assets.

OptionDefaultDescription
-f, --force [ids...]no forceOverwrite managed items that were user-modified or restore missing items. With no IDs, applies to every managed item except AGENTS.md; with IDs, scopes the force.
-y, --yesfalseSkip the interactive prompt. Alias of --non-interactive, redeclared so it works after the subcommand.
--non-interactivefalseSkip the prompt and accept defaults: all items enabled.
--enable <id>[]Enable a managed item. Repeatable. Skips the prompt.
--disable <id>[]Disable a managed item and record the choice without writing the file. Repeatable.
--remove-filesfalseWith --disable, also remove on-disk content for previously installed items.
--jsonfalseEmit a single JSON envelope and suppress prompts.
-n, --dry-runfalseClassify what would change without touching disk.

ai-files status

npx rayfin init ai-files status --json
OptionDescription
--jsonEmit a JSON object instead of formatted lines.

Item states

StateMeaning
up-to-dateOn disk and matches the bundled content recorded in the lockfile.
update-availableOn disk and untouched, but the current CLI ships newer content.
user-modifiedThe user changed a managed file after the CLI wrote it.
missingThe lockfile records an item that is no longer on disk.
not-installedThe CLI knows about the item but has not installed it.
disabledOpted out by --disable, or for skills by removing the Rayfin-managed sigil.
orphanedThe lockfile records an item the current CLI no longer ships.
unreadableThe file exists but cannot be parsed, such as invalid JSON in .mcp.json.

Exit codes

CodeMeaning
0Success without warnings.
1Hard error.
3Success with warnings, usually because user-modified content was preserved.

Conflict resolution

The installer compares three things: the bundled asset in the current CLI, the lockfile entry that records what Rayfin last wrote, and the file currently on disk.

StateDefault install behaviorWith --force
not-installedInstall the item.Install the item.
up-to-dateNo-op.No-op.
update-availableRewrite with the new bundled content.Rewrite with the new bundled content.
user-modifiedWarn and preserve the file.Overwrite when the item is in force scope.
missingWarn and leave missing.Reinstall when the item is in force scope.
disabledSkip.Skip unless the item is also passed to --enable.
unreadableWarn and preserve.Rebuild when the item is in force scope.
orphaned, untouchedRemove lockfile and disk content.Remove lockfile and disk content.
orphaned, editedWarn and preserve.Remove when the item is in force scope.

AGENTS.md is the exception. It is installed only when missing and is never overwritten by install, even with --force.

Scripting examples

Check what would change without writing:

npx rayfin init ai-files install --dry-run --json

Refresh in CI or an agent session while preserving user edits:

npx rayfin init ai-files install --yes --json

Force only the MCP server entry after a malformed .mcp.json repair decision:

npx rayfin init ai-files install --force mcp:rayfin --yes

Drift nudge

rayfin up prints this nudge when managed files are stale, modified, missing, or newly available:

ℹ️  Your project's Rayfin agent files have changes available. Run `rayfin init ai-files install` to refresh.
PromptRefresh Rayfin agent files
Run `npx rayfin init ai-files status --json`, then run `npx rayfin init ai-files install --yes --json`. Preserve any user-modified items unless I explicitly approve a scoped `--force <id>` overwrite.
Something wrong on this page?Report an issueEdit this page

On this page