Scripts

Proj Init Script, Feature 01 - Script

Goal

Implement a command-line utility that initializes a project directory structure based on a JSON configuration file. The tool should create a set of folders and files under a specified base path, ensuring idempotent behavior (existing files/folders are not overwritten), and provide console feedback for each operation.

Changes Needed

Implementation Blueprint

1. Configuration Schema

Expected JSON structure:

{
  "basePath": "string",
  "folders": ["relative/path/one", "relative/path/two"],
  "files": ["relative/file1.txt", "relative/file2.txt"]
}

2. Core Components

Config Loader

Path Resolver

Folder Creator

File Creator

3. Initialization Flow

  1. Parse CLI argument ConfigPath
  2. Load configuration
  3. For each folder in config:
    • Resolve full path
    • Create folder if needed
  4. For each file in config:
    • Resolve full path
    • Create file if needed
  5. Print completion message:
    • “Init project complete”

4. Execution Behavior

Acceptance Criteria