Skip to content

feat: add print option to phpMyAdmin command to output URL to stdout#2779

Open
sjinks wants to merge 3 commits intotrunkfrom
add/print-option-phpmyadmin
Open

feat: add print option to phpMyAdmin command to output URL to stdout#2779
sjinks wants to merge 3 commits intotrunkfrom
add/print-option-phpmyadmin

Conversation

@sjinks
Copy link
Member

@sjinks sjinks commented Mar 18, 2026

Description

Follow up on #2760 to address issues found by Copilot.

Adds a --print option to vip db phpmyadmin that outputs the phpMyAdmin URL to stdout instead of automatically opening it in the default browser. This is useful for opening in a non-default browser, i.e., a specific one. In my use case, there were networking issues, and I could not easily debug Chrome network logs in the browser when the auto-opened link was used. Additional use cases are scripting, automation, and piping to clipboard utilities.

This PR also adds the --silent option to suppress all informational messages so that vip @app.env db phpmyadmin --print --silent just prints the URL and nothing else (the original PR mentioned "scripting, automation, and piping to clipboard utilities").

Changelog Description

Added

  • vip db phpmyadmin: Added --print option to output the phpMyAdmin URL to stdout instead of opening it in a browser.
  • vip db phpmyadmin: Added --silent option to suppress all informational messages (useful for scripting).

Pull request checklist

New release checklist

Steps to Test

From the original PR:

  1. Check out PR.
  2. Run npm install && npm run build.
  3. Run ./dist/bin/vip-db-phpmyadmin.js @<app>.<env> --help and verify --print appears in the options list.
  4. Run ./dist/bin/vip-db-phpmyadmin.js @<app>.<env> (without --print) and verify it opens phpMyAdmin in the default browser as before.
  5. Run ./dist/bin/vip-db-phpmyadmin.js @<app>.<env> --print and verify the URL is printed to stdout and no browser is opened.
  6. Verify the printed URL is valid by pasting it into a browser manually.
  7. Run npx jest --forceExit __tests__/commands/phpmyadmin.ts and verify all tests pass.

@sjinks sjinks self-assigned this Mar 18, 2026
@sjinks sjinks requested a review from Copilot March 18, 2026 10:03
@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a --print option to the vip db phpmyadmin CLI flow to allow retrieving the generated phpMyAdmin URL without auto-opening it in the default browser, supporting scripting/automation use cases.

Changes:

  • Update PhpMyAdminCommand.run() to support a { print } option and conditionally print the generated URL.
  • Expose a new --print CLI flag and add a help example for it.
  • Add a Jest test covering the --print behavior.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/commands/phpmyadmin.ts Adds print handling to output the generated URL instead of opening a browser.
src/bin/vip-db-phpmyadmin.ts Registers the new --print CLI option and passes it into the command.
tests/commands/phpmyadmin.ts Adds test coverage for printing URL vs opening browser.

You can also share your feedback on Copilot code review. Take the survey.

@sjinks sjinks force-pushed the add/print-option-phpmyadmin branch from b74b174 to 07d08c5 Compare March 18, 2026 12:13
@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a --print mode to the vip db phpmyadmin command so users can obtain the generated phpMyAdmin URL without auto-opening a browser, supporting scripting/automation workflows.

Changes:

  • Add --print (and --silent) CLI options to vip db phpmyadmin.
  • Update PhpMyAdminCommand to optionally print the URL instead of opening it, and introduce a silent progress tracker mode.
  • Extend Jest coverage to verify --print prints the URL and does not open the browser.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/commands/phpmyadmin.ts Adds print-to-stdout mode and introduces a silent-aware progress tracker wrapper.
src/bin/vip-db-phpmyadmin.ts Exposes --print / --silent options and wires them into the command execution.
tests/commands/phpmyadmin.ts Adds a test to validate print behavior (stdout output, no browser open).

You can also share your feedback on Copilot code review. Take the survey.

@sjinks sjinks added [Status] Needs Review [Status] Needs Docs The feature or update requires an update to our public VIP Documentation labels Mar 18, 2026
@sjinks sjinks requested a review from a team March 18, 2026 12:19
@sjinks
Copy link
Member Author

sjinks commented Mar 18, 2026

Note: #2670 was merged into this branch, not to trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Docs The feature or update requires an update to our public VIP Documentation [Status] Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants