init Command
What It’s For
Section titled “What It’s For”Set up a workspace so Arashi can track repositories and worktrees.
What It Does
Section titled “What It Does”- Creates Arashi configuration in the current project.
- Offers to bootstrap a Git repository when you run it from a non-repository directory in an interactive terminal.
- Prepares workspace metadata used by other commands.
- Makes the workspace ready for repository registration.
- Reconciles safe configured repository and worktree paths with Git before creating managed directories.
arashi init [options]Key Options
Section titled “Key Options”--repos-dir <path>set a custom repos directory (default./repos).--worktrees-dir <path>set a custom worktree base directory (default.arashi/worktrees).--ignore-scope <local|tracked|none>choose repository-local rules, tracked rules, or no ignore-file writes.--forceoverwrite an existing Arashi config (with backup).--no-discoverskip automatic repository discovery.--dry-runpreview changes without writing files.--verboseprint detailed initialization steps.--jsonoutput machine-readable initialization results.--zero-configbootstrap the root.worktrees/convention for ad hoc use in a non-bare Git project that has not adopted Arashi configuration.
Examples
Section titled “Examples”# Standard initializationarashi init
# Share missing managed rules in the workspace-root .gitignorearashi init --ignore-scope tracked
# Manage ignore rules manually and receive warnings for unignored pathsarashi init --ignore-scope none
# Reset an existing clone to the repository-local default without --forcearashi init --ignore-scope local
# Run from a parent directory, then enter '.' at the prompt to initialize the current directoryarashi init
# Run from a parent directory, then enter 'my-arashi-repo' at the prompt to create a child repoarashi init
# Use a custom repositories directoryarashi init --repos-dir ../workspace-repos
# Use a custom worktree base directoryarashi init --worktrees-dir ../workspace-worktrees
# Reinitialize safely and preview file changesarashi init --force --dry-run
# Initialize and emit JSON for automationarashi init --json
# Use Arashi ad hoc in a project without persisted Arashi configurationarashi init --zero-config
# Preview the standalone bootstrap as structured outputarashi init --zero-config --dry-run --json- Run this command inside an existing Git repository root, or from a parent directory in an interactive terminal when you want Arashi to create the repository for you.
- In bootstrap mode, the repository target prompt accepts only
.or a direct child directory name such asmy-arashi-repo. - If
initis run outside a Git repository without an interactive terminal, it exits with guidance instead of prompting. - JSON mode does not prompt; provide explicit options when running initialization from automation.
initcreates.arashi/config.jsonand hook templates under.arashi/hooks/.initsetsworktreesDirto.arashi/worktreesby default.localis the default ignore scope. Missing safereposDirandworktreesDirrules are written to the common repository’s exclude file resolved through Git, normally.git/info/exclude; tracked.gitignoreis unchanged.trackedwrites missing safe rules to the workspace-root.gitignore.nonedoes not write tracked, local, or global ignore files and warns when a safe path remains unignored.- Explicit
trackedandnonechoices are stored asarashi.ignoreScopein clone-local Git configuration, not shared.arashi/config.json. Selectinglocalremoves the stored non-default preference. - On an existing valid workspace, supplying only
--ignore-scopeupdates the preference and reconciles current paths without requiring--forceor recreating config, hooks, or repositories. A forced init with no explicit scope preserves a valid stored preference. - Before writing, Arashi asks Git for each path’s effective ignore rule. Existing tracked, repository-local, nested, or global rules are preserved without duplication regardless of the selected scope.
- Arashi never creates or modifies
core.excludesFileor other global Git configuration. - Only normalized repository-relative subdirectories are safe to write. Repository root (
././), absolute paths, and parent traversal (../variants) are reported and skipped. - Reconciliation updates only Arashi-owned ignore blocks and removes stale owned entries in the active writable scope. User-authored rules remain untouched;
nonefreezes existing ignore content. --dry-runincludes planned scope, preference, and ignore changes without modifying them. JSON results expose effective sources, planned or applied rules, warnings, unsafe skips, and final changed/restored state under structured managed ignore data.- Prefer ordinary
arashi initwhenever the project can adopt Arashi, including single-repository projects that benefit from repository/workspace hooks, persisted defaults, or custom paths. --zero-configcreates the main-root.worktrees/directory and adds the literal.worktrees/rule to the Git-resolved repository-local exclude only when no effective tracked, local, or global rule already covers the bootstrap probe. It is an ad hoc path for otherwise-unconfigured projects and never writes tracked or global ignore state,.arashi/, hooks, or config.- Zero-config mode accepts
--dry-run,--verbose, and--json; it rejects configured-init options such as--repos-dir,--worktrees-dir,--ignore-scope,--force, and--no-discoverbefore mutation. - Use the Standalone Repository workflow for lifecycle scope, exact-destination ignore checks, and upgrading through ordinary
arashi init.