Skip to main content

Module init

Module init 

Source

Structs§

InitOptions
InitResult
OnboardResult

Constants§

CONFIG_FILES
GITATTRIBUTES_BASE_ENTRIES
Path-pattern -> Git attribute lines for the joy-managed .gitattributes block. The YAML driver covers every Joy YAML file (items, milestones, releases, project metadata). The log entry uses Git’s built-in union driver as an interim until JOY-0112 (Merkle-DAG log) ships.
GITATTRIBUTES_BLOCK_END
GITATTRIBUTES_BLOCK_START
GITIGNORE_BASE_ENTRIES
GITIGNORE_BLOCK_END
GITIGNORE_BLOCK_START
HOOK_FILES
LAST_SYNC_VERSION_KEY
Per-clone git config key recording the joy version that last synced this repo. Compared against env!("CARGO_PKG_VERSION") to drive the auto-sync hook. See JOY-0164-B5.
LEGACY_AI_ARTIFACTS
Dead pre-ADR-024 artefacts under .joy/. Before ADR-024 the AI integration synced intermediate instruction/skill/capability files into .joy/ai/ and .joy/capabilities/; today every template is embedded in the binary and rendered straight into the tool directories (.claude/, .qwen/, AGENTS.md, .github/). The current CLI neither reads nor writes these files, but AI tools that stumble over them in an old repo treat their content as authoritative. joy update and joy ai init remove them.
MERGE_DRIVER_CMD_KEY
MERGE_DRIVER_CMD_VALUE
MERGE_DRIVER_NAME_KEY
MERGE_DRIVER_NAME_VALUE
PROJECT_FILES

Functions§

ensure_lazy_activation
Best-effort registration check, called before every joy invocation that has a project root. Brings .gitattributes and the local git merge-driver config in line with the current binary, so users who upgraded joy without re-running joy init still get the merge driver. See JOY-0162.
init
last_sync_version
Read the recorded last-sync version from this clone’s git config. None if not a repo or the key is unset.
onboard
Onboard an existing project: set up local environment (hooks, etc.).
run_sync
One-shot core-side sync of a repo against the current binary: ensure_lazy_activation + stamp joy.last-sync-version. The full joy update orchestrator wraps this with the auth and AI refresh routines (see joy-cli’s commands::update::run_full_sync).
set_last_sync_version
Stamp the current binary version into this clone’s git config.
update_gitattributes_block
Update the joy-managed block in .gitattributes with the given lines. Replaces the block if it exists, appends otherwise.
update_gitignore_block
Update the joy-managed block in .gitignore with the given entries. Each entry is (path, comment). Replaces the block if it exists, appends otherwise.