You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(repo): open a given page with repo view --web --path, or print its link for agents - #526
Before this PR, prismic repo view --web always opened the repository home. For example, in the one-prompt onboarding, prismic init creates a guest account and the agent builds a first page in a release. The login link the agent gives the guest at the end lands on the Work tab, not on that page. A plain link to the release does not help: a guest has no browser session, so it shows the login screen.
After this PR, --path opens a given page of the repository. For a guest, the login link redirects to that page. For a signed-in user, the browser opens that page directly.
The path is always relative to the repository, so the link stays on the repository's host.
With --no-browser, the command only prints the link: a guest's login link works once, so an agent that gives the user the link must not also open it in a tab first.
Checklist
If my changes require tests, I added them.
If my changes affect backward compatibility, it has been discussed.
If my changes require an update to the CONTRIBUTING.md guide, I updated it.
With no saved login, run prismic init, then prismic repo view --web --path builder/upcoming. Click "Open in Prismic": the Page Builder opens on the Planned tab, not on Work.
Summary by CodeRabbit
New Features
When opening a repository in the browser, you can now provide a path with --path alongside --web. Guest links will redirect to the specified page within the repository.
Bug Fixes
Browser links are now checked for valid URL formatting before they are opened.
Please use these labels when submitting a review:
❓ #ask: Ask a question.
💡 #idea: Suggest an idea. ⚠️ #issue: Strongly suggest a change.
🎉 #nice: Share a compliment. ↩
Add the --path option to `prismic repo view --web`. It opens a page of
the repository, such as a release in the Page Builder, instead of its
home. For a guest account, the login link redirects to that page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L1dGD5PHF4jHVaf88Hg4z5
This repository does not receive automatic reviews because it has fewer than 10 stars.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 3607995f-0506-4d14-913b-6abf3b09291c
Walkthrough
prismic repo view adds a web-only --path option. The command uses the path as the guest-link redirect target and validates links before opening them.
Changes: Repository page selection
Layer / File(s)
Summary
Path option and browser redirect src/commands/repo-view.ts, test/repo-view.test.ts
The command accepts --path with --web and appends the path, without leading slashes, to the browser target. Guest links redirect to that page. All links must match the allowed-character pattern and pass URL.canParse. A test checks the guest-account redirect path.
Passing a --path value that contains percent-encoded characters can print a success message without opening the browser. The effect is limited to such paths, and the printed link can still be opened manually.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a new --path option for prismic repo view --web that opens a given repository page. It also names the secondary behavior of printing the page link for agents. The …
Full details: Title check
Explanation
The title names the main change: a new --path option for prismic repo view --web that opens a given repository page. It also names the secondary behavior of printing the page link for agents. The raw summary confirms the --path option, its dependency on --web, and the guest-link redirect target, so the title matches the changeset.
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.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
The fake server percent-encodes redirect_uri. The command rejects the resulting % characters and skips browser launch, but these assertions still pass because the command prints Opening … unconditionally.
Add a harmless browser-launch probe and assert the destination it receives. Keep the existing redirect assertion. This will distinguish a completed browser workflow from the known no-op.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a43c406d-7808-421d-b6ef-7480ed286060
Commits
Reviewing files that changed from the base of the PR and between 9e4a247 and b20b13c.
Files selected for processing: 2
src/commands/repo-view.ts
test/repo-view.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Heavy lift
Handle valid encoded paths instead of reporting a browser launch that did not occur.
For a signed-in account, --path 'builder/upcoming/abc?label=a%20b' produces a valid destination, but this regex rejects %. The command skips openBrowser, prints Opening …, and exits successfully.
Support encoded destinations through shell-safe browser launching. If a destination cannot be opened safely, return an explicit error instead of reporting success. Do not simply remove the shell-safety check.
The reason will be displayed to describe this comment to others. Learn more.
Leaving this as is, on purpose.
% stays out of the allowed characters because openBrowser() runs a shell, and cmd.exe expands %NAME% even inside quotes. Allowing encoded paths safely means changing how the browser is launched on every platform, which is out of scope here.
The pages this option is for (builder/upcoming/<release id> and similar) need no encoding.
When the link fails the check, the command still prints it, so the user can open it by hand. Guest links already behaved this way before this PR.
On the test nitpick: the tests do not launch a browser on purpose. They assert the printed link, which is what the user sees, and the redirect it carries.
The reason will be displayed to describe this comment to others. Learn more.
@angeloashmore Thanks for explaining the scope and the shell-safety constraint. I won’t mark the finding as addressed.
Learnings added
Learnt from: angeloashmore
Repo: prismicio/cli PR: 526
File: src/commands/repo-view.ts:50-50
Timestamp: 2026-12-02T22:04:23.904Z
Learning: Within repository "prismicio/cli", only for files matching one of ["src/commands/repo-view.ts"]: In src/commands/repo-view.ts, `prismic repo view --web --path` targets pages such as `builder/upcoming/<release-id>` that do not need encoded paths. The command intentionally excludes `%` from links passed to `openBrowser()` because it runs a shell and Windows cmd.exe expands `%NAME%` even inside quotes. Links that fail the check are printed for manual use, as guest links were before this change. Do not broaden the allowed characters without addressing shell safety.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Learnings used
Learnt from: CR
Repo: prismicio/cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-24T21:00:06.580Z
Learning: Source excerpt:
- Assert what a user would see, not the calls made to get there. A refactor should pass without editing tests.
Add --no-browser to `repo view --web`. With it, the command prints the
link and does not open a browser. On a guest account, the link is the
one-time login link. An agent can give this link to the user as the
only link to click, so the link is not used up by a browser tab first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L1dGD5PHF4jHVaf88Hg4z5
angeloashmore
changed the title
feat(repo): open a given page with repo view --web --path
feat(repo): open a given page with repo view --web --path, or print its link for agents
Dec 2, 2026
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Resolves:
Description
Before this PR,
prismic repo view --webalways opened the repository home. For example, in the one-prompt onboarding,prismic initcreates a guest account and the agent builds a first page in a release. The login link the agent gives the guest at the end lands on the Work tab, not on that page. A plain link to the release does not help: a guest has no browser session, so it shows the login screen.After this PR,
--pathopens a given page of the repository. For a guest, the login link redirects to that page. For a signed-in user, the browser opens that page directly.The path is always relative to the repository, so the link stays on the repository's host.
With
--no-browser, the command only prints the link: a guest's login link works once, so an agent that gives the user the link must not also open it in a tab first.Checklist
Preview
How to QA 1
With no saved login, run
prismic init, thenprismic repo view --web --path builder/upcoming. Click "Open in Prismic": the Page Builder opens on the Planned tab, not on Work.Summary by CodeRabbit
--pathalongside--web. Guest links will redirect to the specified page within the repository.Generated by Claude Code
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩