feat(cli): allow optional positional cwd argument#1727
Conversation
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Small CLI enhancement adding an optional You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
…argument Merge upstream: feat(cli) allow optional positional cwd argument (pingdotgg#1727)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
What Changed
cwdargument to thet3CLI command.process.cwd().Why
The CLI previously always hardcoded
cwdtoprocess.cwd(), which prevented commands likenpx t3 ~/Developer/my-projectfrom targeting a specific project directory. This change enables explicit cwd selection while preserving existing default behavior and ensuring missing directories are upserted automatically.Testing
bun fmtbun lintbun typecheckbun run --cwd apps/server test src/cli-config.test.ts src/cli.test.tsChecklist
Note
Add optional positional
cwdargument to the server CLIcwdto set the working directory for provider sessions, defined in cli.ts.resolveServerConfigexpands home directory tokens, resolves the path to absolute, and creates the directory recursively if it does not exist; previouslyconfig.cwdwas alwaysprocess.cwd().cwdis provided, the resolved config'scwdreflects the supplied path rather than the process working directory.Macroscope summarized 0acaf5d.