fallow init
fallow init creates a config file for the project, and optionally an AGENTS.md guide or a Git pre-commit hook.
Create a config file that fits the project, and optionally an AGENTS.md guide or a Git pre-commit hook.
For a first setup of fallow in a project, read Adopt fallow.
Synopsis
fallow init [OPTIONS]
Options
| Option | Description |
|---|---|
--toml | Generate TOML instead of JSONC |
--agents | Scaffold a starter AGENTS.md guidance file for coding agents |
--hooks | Scaffold a shell-level pre-commit git hook in .git/hooks/ that runs fallow on changed files. Alias for fallow hooks install --target git |
--decline | Record that this project deliberately stays unconfigured: persists a decline so the first-contact setup hint and the setup next-step stop appearing here. Writes no config file; idempotent |
The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.
Fallow detects TypeScript, the workspace patterns and the frameworks of the project, and writes the matching entry patterns and rules. Without --toml, the file is .fallowrc.json with JSONC content. Rename it to .fallowrc.jsonc to get editor support for comments. Fallow finds both names.
Fallow also adds .fallow/ to .gitignore. That directory holds local data, for example the cache. Fallow creates .gitignore when it does not exist, and changes nothing when the file already has the entry. When .gitignore is a symlink that leaves the project, fallow prints a warning and does not change it.
After it writes the config file, fallow prints the next step. When the config root is not the current folder, both commands of that line have --root. --quiet removes the line.
--agents writes a starter AGENTS.md with a table of agent tasks and their fallow commands. Fallow fills in the install, test and typecheck commands only when it can detect them without doubt. It does not change an existing AGENTS.md, and exits with code 2 when the file exists. The rules for each line:
| Line | Fallow fills it when |
|---|---|
| Install | The packageManager field of package.json names the package manager, or pnpm-workspace.yaml exists. Fallow never guesses from a lockfile. |
| Test | Exactly one test framework (Vitest, Jest or Playwright) is installed. |
| Typecheck or lint | tsconfig.json exists. The line is tsc --noEmit. |
| Module boundaries | The project is a monorepo. The line names the workspace patterns. |
An HTML comment above the filled lines says that fallow took them from package.json. Check these lines before you rely on them. fallow agent install writes the same task map, together with the skills, the MCP entry and the commit gate.
--hooks is the same as fallow hooks install --target git.
--decline writes no file. It stops the setup hint that a bare fallow run shows in a project without a config file.
Output
fallow init
Created .fallowrc.json
Detected: TypeScript
Detected: Vitest
Config includes test framework rules
Added .fallow/ to .gitignore
Next: run `fallow` for a first report. Run `fallow agent install --dry-run` to see the setup for coding agents.
The new file for this project:
{
// This file is JSONC: fallow reads these comments; generic JSON tools may not.
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"entry": [
"src/index.{ts,tsx,js,jsx}",
"src/main.{ts,tsx,js,jsx}"
],
"duplicates": {
// Hide pair-only clones; focus on widespread copy-paste
// worth refactoring. Lower to 2 to report every duplicate pair.
"minOccurrences": 3
},
"rules": {
"unused-dependencies": "warn"
}
}
The real file also holds a commented example of duplicates.ignore. The $schema line gives completion and validation in the editor.
Exit codes
| Code | Meaning |
|---|---|
0 | Fallow wrote the file. |
2 | A config file exists already, a target file is a symlink that leaves the project, or --decline cannot save its choice: the history file of fallow impact is from a newer fallow, cannot be read or does not parse, no user config folder resolves, or the write fails. |
See Exit codes.
Examples
# Create .fallowrc.json
fallow init
# Create fallow.toml
fallow init --toml
# Create the config file and a starter AGENTS.md
fallow init --agents
# Create the config file and a Git pre-commit hook
fallow init --hooks
# Keep the project without a config file, and hide the setup hint
fallow init --decline
Related
- Configuration overview: how fallow reads the config file.
fallow recommend: a proposed config from the findings of the project.fallow agent: the full setup for coding agents.