Config file structure
Your configuration file is a JSON object where each top-level key is a preset name:The top-level JSON key should match the
presetName field for consistency.Preset-level fields
Each preset has four main fields:presetName (required)
The unique identifier for your preset. Use kebab-case for consistency.description (optional)
A human-readable explanation of what the preset does. This helps other developers understand the preset’s purpose.packageManager (required)
The package manager to use. Must be one of:npm, pnpm, yarn, or bun.
packages (required)
An array of package configurations. This is where you define what to install and how to install it.Package-level fields
Each package in thepackages array is an object with these fields:
command (required)
The package name or command to run. This is the core identifier for what you’re installing.- ✅
"command": "gsap" - ✅
"command": "@react-three/fiber" - ❌
"command": "[email protected]" - ❌
"command": "gsap -D"
interactive (required)
Indicates whether the package requires user input during installation. Set totrue for:
- Project scaffolding tools (
create-next-app,create-vite) - CLI tools with initialization prompts (
shadcn init,prisma init) - Any command that asks questions during execution
false for:
- Standard npm packages
- Libraries that install silently
- Dependencies with no setup prompts
Interactive packages are run sequentially one at a time. Non-interactive packages are batched into a single install command for efficiency.
dev (optional)
Installs the package as a development dependency.- TypeScript type definitions (
@types/*) - Build tools and bundlers (
vite,webpack,rollup) - Testing libraries (
vitest,jest,@testing-library/react) - Linters and formatters (
eslint,prettier)
false (installs as regular dependency)
flags (optional)
An array of additional flags to pass to the install command. Each flag is a separate string in the array.Common use cases:
For interactive commands (scaffolding tools):npx create-next-app . (installs in current directory)
For packages with special installation requirements:
npx shadcn init --yes
Flags are appended to the command in the order they appear in the array.
version (optional)
Specifies the version to install. Can be a specific version number, a version range, or a tag likelatest or next.
npm install [email protected]
Version formats:
- ✅ For packages where you need a specific version for compatibility
- ✅ For production presets where you want reproducible builds
- ✅ For beta/experimental features (
"version": "next") - ❌ For most packages (let the package manager use latest by default)
Complete example with all fields
Here’s a real preset from PM-Auto’s source that demonstrates every configuration option:What this preset does:
- Scaffolds a Next.js project using
bunx create-next-app@latest . - Initializes shadcn/ui using
bunx shadcn@latest init - Batches non-interactive packages into one command:
Notice how the last package (
@types/three) uses "dev": true and gets the -d flag appended at the end of the batched command.Config file location
PM-Auto looks for aconfig.json file in the current directory by default. You can:
- Use the default location: Place
config.jsonin the root of your project or current directory - Use
pm-auto config: Run the config command to open and edit your configuration - Specify a custom path: Pass a custom config file path as a command-line argument (check
pm-auto --helpfor syntax)
Viewing your configuration
Use thepm-auto config command to view or edit your current configuration:
config.json file in your default editor.
Multiple presets in one config
You can define as many presets as you need in a singleconfig.json file:
Best practices
Keep presets focused
Keep presets focused
Each preset should have a clear purpose. Instead of one massive preset, create multiple targeted presets that can be composed together.Good:
Bad:
nextjs-base, ui-libraries, testing-setupBad:
everything-i-might-needDocument your presets
Document your presets
Always include a
description field. Your future self and teammates will thank you.Version critical dependencies
Version critical dependencies
For packages where version matters (breaking changes, specific features), explicitly set the
version field.Group related packages
Group related packages
Test your presets
Test your presets
Before sharing a preset, test it in a fresh project to ensure all packages install correctly and in the right order.