Configuration
Learn how to customize and manage your project preferences using pphatdev.json.
Persistent Configuration (pphatdev.json)
When you run pphat init, a pphatdev.json file is generated at your project root. The CLI reads this configuration on subsequent runs so you don't need to specify output directories or framework formats each time.
Formats and sections you don't select during initialization are written with "use": false and default directories, so you can easily enable them later by changing the flag or using CLI commands.
Example pphatdev.json
{
"name": "Default configuration",
"icons": {
"svg": {
"dir": "public/icons",
"use": false
},
"nextjs": {
"dir": "components/icons",
"use": true
},
"nuxtjs": {
"dir": "components/icons",
"use": false
}
},
"components": {
"nextjs": {
"dir": "components/ui",
"use": false
},
"nuxtjs": {
"dir": "components/ui",
"use": false
}
}
}
Configuration Fields
name: The display name for your configuration preset.icons: Configuration settings for downloading vector icons.svg: Directory (dir) and toggle (use) for outputting raw.svgfiles.nextjs: Directory (dir) and toggle (use) for outputting React.tsxcomponents.nuxtjs: Directory (dir) and toggle (use) for outputting Vue.vuecomponents.
components: Configuration settings for downloading UI components.nextjs: Directory (dir) and toggle (use) for Next.js / React component files.nuxtjs: Directory (dir) and toggle (use) for Nuxt.js / Vue component files.
Managing Configuration via CLI
You can inspect or modify your pphatdev.json file directly via the config command:
Interactive Update
npx pphat configInspect All Settings
npx pphat config getGet a Specific Field
npx pphat config get icons.nextjs.dirUpdate a Specific Field
npx pphat config set icons.nextjs.use trueDynamic Command Overrides
You can temporarily override your saved configuration for a single command by passing -d (--dir) or -f (--format). Both the subcommand grammar (v1.4.0+) and the hyphenated aliases accept the same flags:
npx pphat add icon react -d src/custom/iconsnpx pphat add-icon react -d src/custom/iconsnpx pphat add component button -f nextjsnpx pphat add-component button -f nextjsThe remove command family accepts the same flags to scope a deletion to a specific format or directory:
npx pphat remove icon react -f svg -d public/iconsnpx pphat remove-component button -f nextjs -d src/components/ui