Skip to content

[codex] Validate template input and project paths#4

Draft
cgdusek wants to merge 1 commit into
Jatinp26:mainfrom
cgdusek:codex/cli-paths-template-validation
Draft

[codex] Validate template input and project paths#4
cgdusek wants to merge 1 commit into
Jatinp26:mainfrom
cgdusek:codex/cli-paths-template-validation

Conversation

@cgdusek
Copy link
Copy Markdown

@cgdusek cgdusek commented Apr 3, 2026

Summary

  • honor absolute destination paths instead of re-rooting them under process.cwd()
  • accept documented beginner template aliases like token and asset
  • fail fast for unknown template values instead of scaffolding an empty project

Why

Issue #3 reproduces in the current CLI:

  • absolute paths like /tmp/my-app are treated as relative to the current checkout
  • invalid --template values still report success after creating an empty scaffold
  • the help text advertises template values that do not align with the shipped beginner templates

Impact

  • scripted and non-interactive usage can target absolute paths safely
  • documented template names now work as expected
  • invalid template input is rejected early instead of generating a broken starter

Validation

  • node /Users/charlesdusek/Code/create-canton-app/bin/create-canton-app.js --help
  • env PATH="$HOME/.dpm/bin:$HOME/n/bin:/usr/bin:/bin:/usr/sbin:/sbin" node /Users/charlesdusek/Code/create-canton-app/bin/create-canton-app.js /tmp/pr2-verify/abs-token --template token
  • verified /tmp/pr2-verify/abs-token/daml.yaml contains name: abs-token
  • env PATH="$HOME/.dpm/bin:$HOME/n/bin:/usr/bin:/bin:/usr/sbin:/sbin" node /Users/charlesdusek/Code/create-canton-app/bin/create-canton-app.js invalid-template --template nope
  • verified the invalid template run exits non-zero and creates no project

Closes #3.

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.

Honor absolute paths and validate beginner template input

1 participant