ppm init
Initialize a new PPM project in the current directory or create a new directory with a basicproject.toml
configuration file.
Synopsis
Description
Theppm init
command sets up a new polyglot project with PPM. It creates the essential project.toml
configuration file and optionally sets up a basic project structure.
Arguments
project-name
(optional): Name of the new project. If provided, creates a new directory with this name.
Options
Option | Short | Description | Default |
---|---|---|---|
--name <name> | -n | Project name (overrides directory name) | Directory name |
--version <version> | -v | Initial project version | "1.0.0" |
--description <desc> | -d | Project description | "" |
--author <author> | -a | Project author | Git user.name |
--license <license> | -l | Project license | "MIT" |
--template <template> | -t | Project template to use | "basic" |
--js | Include JavaScript/Node.js support | false | |
--python | Include Python support | false | |
--both | Include both JavaScript and Python | false | |
--interactive | -i | Interactive mode with prompts | false |
--force | -f | Overwrite existing files | false |
--help | -h | Show help information |
Usage Examples
Basic Initialization
Initialize PPM in the current directory:project.toml
file:
Create New Project Directory
Create a new project in a new directory:Interactive Mode
Use interactive mode to customize the project setup:- Project name
- Version
- Description
- Author
- License
- Languages to include
- Template to use
Specify Project Details
Create a project with specific metadata:Language-Specific Initialization
Initialize with specific language support:Template-Based Initialization
Use a predefined template:Available Templates
basic
(Default)
Minimal setup with empty dependency sections:
web
Full-stack web application with React and Flask:
data-science
Data science project with Jupyter and visualization:
microservices
Microservices architecture template:
cli
Command-line tool template:
Project Structure
Depending on the template and options,ppm init
may create additional directories:
Web Template Structure
Data Science Template Structure
Configuration File Details
The generatedproject.toml
includes:
Project Metadata
- name: Project name (required)
- version: Semantic version (required)
- description: Project description
- author: Project author
- license: License identifier
Dependencies
- dependencies.js: JavaScript/Node.js packages
- dependencies.python: Python packages
- dev-dependencies.js: JavaScript development dependencies
- dev-dependencies.python: Python development dependencies
Scripts
Common development scripts likedev
, build
, test
, etc.
Post-Initialization Steps
After runningppm init
, you’ll typically want to:
-
Install dependencies:
-
Review the configuration:
-
Start development:
-
Customize the setup:
Edit
project.toml
to add or modify dependencies and scripts.
Interactive Mode Details
When using--interactive
, PPM will prompt for:
1
Project Information
- Project name
- Version (with semantic versioning validation)
- Description
- Author (defaults to Git configuration)
- License (with common license suggestions)
2
Language Selection
- JavaScript/Node.js support
- Python support
- Both languages
3
Template Choice
- Available templates based on language selection
- Custom template options
4
Additional Options
- Git repository initialization
- README.md generation
- License file creation
Common Use Cases
1. Quick Prototype
2. Production Web App
3. Data Science Project
4. Converting Existing Project
Error Handling
Common Errors
Directory already exists
Directory already exists
Error:
Directory 'my-project' already exists
Solution: Use --force
to overwrite or choose a different name:Invalid project name
Invalid project name
Error:
Invalid project name 'my_project!'
Solution: Use alphanumeric characters and hyphens only:Permission denied
Permission denied
Error:
Permission denied: cannot create directory
Solution: Check directory permissions or run with appropriate privileges:Integration with Other Commands
After initialization, common next steps:The
ppm init
command is your starting point for any polyglot project. It sets up the foundation for unified dependency management and development workflows.