Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Jan 28, 2026

Summary

Renames the --template-path flag to --template (with -t alias) for a cleaner CLI experience. The new --template flag can parse combined paths like pnpm/module and automatically extract the dir and fromPath components.

New usage:

pgpm init --template pnpm/module    # Equivalent to: pgpm init module --dir pnpm
pgpm init -t pgpm/workspace         # Short form

Backward compatibility is maintained - --template-path still works but is deprecated.

Updates since last revision

  • Fixed -w alias: Added missing CLI alias mapping for -wcreateWorkspace. Without this, pgpm init --template pgpm/module -w would fail with "NOT_IN_WORKSPACE" error.
  • Updated README: Documented the new --template and -w flags in the Getting Started section and updated the Templates section to reference --template instead of --template-path.

Review & Testing Checklist for Human

  • Test --template with -w flag together: Run pgpm init --template pgpm/module -w outside a workspace - should create workspace first, then module inside it
  • Verify parsing edge cases: Test with --template workspace (no slash), --template pnpm/sub/module (multiple slashes), and --template /module (leading slash)
  • Test precedence behavior: When both --template pnpm/module and --dir supabase are provided, --template silently overrides --dir - verify this is the desired behavior
  • Verify backward compatibility: Test that --template-path pgpm/workspace still works as expected

Recommended test plan:

# Test new flag with create-workspace
pgpm init --template pnpm/module -w   # Should create workspace + module

# Test new flag standalone
pgpm init --template pnpm/workspace
pgpm init -t pgpm/module

# Test backward compatibility  
pgpm init --template-path pgpm/workspace

# Test edge cases
pgpm init --template workspace  # No slash - should work as fromPath only

Notes

This PR depends on the pgpm-boilerplates repo having the pgpm/ folder (merged in PR #25).

Link to Devin run: https://app.devin.ai/sessions/86fc90000ad24b2cacf3b750dc077be3
Requested by: Dan Lynch (@pyramation)

- Rename --template-path to --template with -t alias
- --template parses 'dir/fromPath' format (e.g., --template pnpm/module)
- When --template is provided, it takes precedence over --dir and positional args
- Keep backward compatibility with --template-path (deprecated)
- Update tests to use new --template flag
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 26b8b97 into main Jan 28, 2026
52 checks passed
@pyramation pyramation deleted the devin/1769587579-template-flag-rename branch January 28, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants