Skip to main content

ppm init

Initialize a new PPM project in the current directory or create a new directory with a basic project.toml configuration file.

Synopsis

Description

The ppm 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

Usage Examples

Basic Initialization

Initialize PPM in the current directory:
Creates a basic 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:
This will prompt you for:
  • 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 generated project.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 like dev, build, test, etc.

Post-Initialization Steps

After running ppm init, you’ll typically want to:
  1. Install dependencies:
  2. Review the configuration:
  3. Start development:
  4. 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

Error: Directory 'my-project' already existsSolution: Use --force to overwrite or choose a different name:
Error: Invalid project name 'my_project!'Solution: Use alphanumeric characters and hyphens only:
Error: Permission denied: cannot create directorySolution: 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.