Configuration file format
PM-Auto uses a JSON configuration file where each top-level key represents a preset. You register the config path with:Schema overview
The configuration file is a JSON object where each key is a preset identifier, and each value conforms to theConfigType interface.
TypeScript interfaces
Preset-level fields
Each preset in your configuration must include these fields:The name you use to reference this preset in CLI commands. Must match the parent key in the JSON structure.
Human-readable description of what this preset installs. Displayed in
pm-auto list and pm-auto describe commands.The package manager to use for all installations in this preset.Valid values:
npmpnpmyarnbun
Ordered list of packages to install. PM-Auto executes these commands sequentially in the order defined.Each item must be a
PackageType object (see package-level fields below).Package-level fields
Each object in thepackages array represents a single install command:
The package name or CLI tool to install. Can be:
- A single package:
"react" - Multiple packages:
"react react-dom" - A scoped package:
"@types/node" - An executable tool:
"create-next-app"
Indicates whether this command prompts for user input during installation.Set to
true for:create-next-appshadcn init- Any tool that requires interactive prompts
false for:- Standard package installations
- Non-interactive commands
Install as a development dependency.
true: Adds-Dor--save-devflagfalseor omitted: Installs as regular dependency
Specific version to install. Can be:
- Exact version:
"3.11.4" - Version range:
"^5.0.0" - Tag:
"latest"or"next"
Additional CLI flags or arguments to append to the install command.Examples:
["."]- Install in current directory["init"]- Run init command["--peer-deps"]- Include peer dependencies["--legacy-peer-deps"]- Use legacy peer deps resolution
Validation rules
PM-Auto validates your configuration when you run commands:- Required fields:
presetName,packageManager, andpackagesmust be present - Package manager: Must be one of:
npm,pnpm,yarn, orbun - Packages array: Must contain at least one package entry
- Package fields: Each package must have
commandandinteractivefields - JSON syntax: File must be valid JSON (no trailing commas, comments must be removed)
Complete example
Here’s a comprehensive example showing all available fields:Command generation
PM-Auto constructs install commands based on your configuration: Input configuration:Related commands
- Install command - Install packages from a preset
- Config command - Set config file path
- Describe command - View preset details