lps init
lps init creates a loopress.json file in the current directory. Run it once at the root of each project you want to manage with Loopress.
lps initThe command is interactive: it prompts you for each field and writes the result to loopress.json.
Prompts
Section titled “Prompts”| Prompt | Description |
|---|---|
| WordPress project | Select a project you have already configured with lps project config, or enter a project ID manually. When no project exists yet, lps init offers to run lps project config right away and continues with the project you create. |
| Root directory | Base directory for the project. All other paths are resolved relative to it. Defaults to .. |
It also adds * text=auto eol=lf at the top of a .gitattributes file next to loopress.json. It creates the file if needed, leaves it alone if the rule is already there, and keeps your own rules after it so they still take precedence (for example *.bat text eol=crlf). Git for Windows checks files out with CRLF line endings by default, so without this rule a snippet cloned on Windows would no longer match, byte for byte, what pull writes.
lps init doesn’t ask for resource directories. Snippets, ACF, hooks, pages and every other resource use their default directory under the root (snippets/, acf/, hooks/, and so on). To use another name, add the matching <kind>Dir key to loopress.json, for example "snippetsDir": "code".
The final summary lists what was configured and the next useful command.
Generated file
Section titled “Generated file”{ "projectId": "my-site", "rootDir": "."}Commit this file to Git. It ties the repository to a specific Loopress project and controls where every command reads and writes files. Every field, including the resource directories you can override, is documented in the loopress.json reference.
If loopress.json already exists
Section titled “If loopress.json already exists”lps init will ask whether to overwrite the existing file. Choose No to keep the current config and abort.
Next steps
Section titled “Next steps”# Pull everything already on the site: snippets, plugins, ACF, hooks, and morelps pull
# Commit everythinggit add .git commit -m "chore: add loopress config"