GeezerVison is showing github.com — feat(cli): show Prisma CLI path in version output by symbiosis-institute · Pull Request #29591 · prisma/orm
Conversation
/claim #7771
Fixes #7771
Summary
- add the running Prisma CLI package path to
prisma -v / prisma version
- resolve the path from the CLI package metadata so the reported location matches the CLI that is actually executing
- add test coverage for both the human-readable output and the JSON output
Why
Issue #7771 asks for a way to tell which Prisma CLI installation is actually running. This helps when prisma resolves to a parent or otherwise unexpected install and the current version output does not reveal that.
Implementation
- compute
prismaCliPath from path.dirname(require.resolve('../package.json'))
- append a
Prisma CLI Path row to the version output table
- update the inline snapshot for the version command
- add a JSON regression test asserting the
prisma-cli-path field
Verification
pnpm --filter "prisma..." build
pnpm test src/__tests__/commands/Version.test.ts
pnpm exec eslint packages/cli/src/Version.ts packages/cli/src/__tests__/commands/Version.test.ts
pnpm exec prettier --check packages/cli/src/Version.ts packages/cli/src/__tests__/commands/Version.test.ts
node packages/cli/build/index.js -v
node packages/cli/build/index.js version --json
This contribution was prepared with AI assistance under human direction and review. I inspected the change, verified the behavior described here, and am responsible for the submission.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
All committers have signed the CLA.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
May 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e2f9cfba-fcbe-4702-bc74-1afe9a5ffb0c
📥 Commits
Reviewing files that changed from the base of the PR and between 42f9102 and fd3a624.
📒 Files selected for processing (2)
packages/cli/src/Version.ts
packages/cli/src/__tests__/commands/Version.test.ts
Summary by CodeRabbit
- New Features
- The
version command now displays the Prisma CLI Path in its output, available in both table and JSON formats.
Walkthrough
The version command implementation now resolves and displays the Prisma CLI's installation directory path. The Version.ts module computes this path by resolving the CLI package.json and extracting its directory, then includes it in the version output table and JSON response. Corresponding test cases validate both human-readable and JSON output formats, with snapshot sanitization for stable test runs.
Changes
CLI Path Version Output
| Layer / File(s) |
Summary |
CLI path computation and output packages/cli/src/Version.ts |
The path module is imported. A prismaCliPath variable is computed by resolving the CLI package.json and extracting its directory with path.dirname(). A "Prisma CLI Path" row is added to the version output table for display in both CLI and JSON output. |
Version output test updates packages/cli/src/__tests__/commands/Version.test.ts |
The test file imports the path module. The human-readable version output snapshot is extended to include the CLI path line. A new test validates that version --json includes a prisma-cli-path field with the expected directory value. The snapshot sanitizer is updated to replace the CLI path value with a stable normalized value for reliable test assertions. |
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
⚠️ Warning |
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name |
Status |
Explanation |
| Title check |
✅ Passed |
The title clearly and specifically describes the main change: adding Prisma CLI path to version output. |
| Description check |
✅ Passed |
The description is directly related to the changeset, providing context, implementation details, and verification steps for the CLI path feature. |
| Linked Issues check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
✨ Simplify code
- Create PR with simplified code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks — this looks correct end to end: the resolution reuses the existing require('../package.json') pattern, the snapshot alignment matches formatTable's padding, the sanitizer is right, and the JSON test asserting the slugified prisma-cli-path key is a nice touch. No blocking issues from our review; we'll get full CI running on it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi @symbiosis-institute — thanks for this, and apologies for the slow reply.
We're clearing the open PR backlog ahead of moving this codebase to a v7 branch, with the Prisma Next rewrite taking over main.
We are closing this one: the CLI path output has already landed in #29573, and the remaining test coverage and follow-up are being consolidated in #29613. Keeping another implementation open would duplicate that work.
Thanks for the time you put into it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Output path of current Prisma in -v
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|