@automattic/vip 3.25.2-dev.0 → 3.25.3-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -72,12 +72,6 @@ Guide for future agents working on this codebase. Focus on traps, cross-cutting
72
72
  - `prepare` runs `npm run clean && npm run build`; npm package bins point to `dist/**`. Always rebuild before publishing so dist matches src.
73
73
  - `helpers/prepublishOnly.js` enforces branch `trunk` for `npm publish --tag latest` and optionally reruns `npm test`. Release flows expect a clean node version that satisfies `engines.node`.
74
74
 
75
- ## Standalone SEA Packaging
76
-
77
- - Canonical runbook for standalone executable build/signing is in `docs/SEA-BUILD-SIGNING.md`. Use it for macOS, Linux, Windows native, and WSL-mediated Windows builds.
78
- - SEA builds are Node 22 only (enforced in `helpers/build-sea.js`); always verify `node -v` before `npm run build:sea`.
79
- - The executable is self-contained for Node runtime + JS deps, but `dev-env` commands still require host Docker/Compose availability.
80
-
81
75
  ## Common Pitfalls Checklist
82
76
 
83
77
  - Running CLI without a token opens a browser (`open`) and waits for interactive input—pass `--help` or set `WPVIP_DEPLOY_TOKEN` in automation.
package/CLAUDE.md CHANGED
@@ -1,4 +1,3 @@
1
1
  # CLAUDE
2
2
 
3
3
  For guidance on working in this repo, traps, and migration notes, see `AGENTS.md`.
4
- For standalone SEA build/signing by platform, see `docs/SEA-BUILD-SIGNING.md`.
@@ -16,6 +16,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
16
16
  const examples = [{
17
17
  usage: 'vip @example-app.develop db phpmyadmin',
18
18
  description: "Generate access to a read-only phpMyAdmin web interface for the environment's database."
19
+ }, {
20
+ usage: 'vip @example-app.develop db phpmyadmin --print',
21
+ description: 'Print the phpMyAdmin URL to stdout instead of opening it in a browser.'
19
22
  }];
20
23
  const appQuery = `
21
24
  id,
@@ -35,16 +38,20 @@ void (0, _command.default)({
35
38
  module: 'phpmyadmin',
36
39
  requiredArgs: 0,
37
40
  usage: 'vip db phpmyadmin'
38
- }).examples(examples).argv(process.argv, async (arg, {
41
+ }).option('print', 'Print the phpMyAdmin URL to stdout instead of opening it in a browser.').option('silent', 'Do not print any output to the console.').examples(examples).argv(process.argv, async (arg, {
39
42
  app,
40
- env
43
+ env,
44
+ print: printUrl,
45
+ silent
41
46
  }) => {
42
47
  const trackerFn = (0, _tracker.makeCommandTracker)('phpmyadmin', {
43
48
  app: app.id,
44
49
  env: env.uniqueLabel
45
50
  });
46
51
  await trackerFn('execute');
47
- const cmd = new _phpmyadmin.PhpMyAdminCommand(app, env, trackerFn);
48
- await cmd.run();
52
+ const cmd = new _phpmyadmin.PhpMyAdminCommand(app, env, trackerFn, silent);
53
+ await cmd.run({
54
+ print: printUrl
55
+ });
49
56
  await trackerFn('success');
50
57
  });
@@ -10,23 +10,6 @@ var _userError = _interopRequireDefault(require("../lib/user-error"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const exampleUsage = 'vip dev-env exec';
12
12
  const usage = 'vip dev-env exec';
13
- const ENV_UP_CHECK_ATTEMPTS = 5;
14
- const ENV_UP_CHECK_DELAY_MS = 1500;
15
- const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
16
- async function waitForEnvironmentReadiness(lando, slug) {
17
- const instancePath = (0, _devEnvironmentCore.getEnvironmentPath)(slug);
18
- return pollEnvironmentReadiness(lando, instancePath, 1);
19
- }
20
- async function pollEnvironmentReadiness(lando, instancePath, attempt) {
21
- if (await (0, _devEnvironmentLando.isEnvUp)(lando, instancePath)) {
22
- return true;
23
- }
24
- if (attempt >= ENV_UP_CHECK_ATTEMPTS) {
25
- return false;
26
- }
27
- await sleep(ENV_UP_CHECK_DELAY_MS);
28
- return pollEnvironmentReadiness(lando, instancePath, attempt + 1);
29
- }
30
13
  const examples = [{
31
14
  usage: `${exampleUsage} --slug=example-site -- wp post list`,
32
15
  description: 'Run a WP-CLI command against a local environment named "example-site".\n' + ' * A double dash ("--") must separate the arguments of "vip" from those of the "wp" command.'
@@ -63,7 +46,7 @@ const examples = [{
63
46
  arg = process.argv.slice(argSplitterIx + 1);
64
47
  }
65
48
  if (!opt.force) {
66
- const isUp = await waitForEnvironmentReadiness(lando, slug);
49
+ const isUp = await (0, _devEnvironmentLando.isEnvUp)(lando, (0, _devEnvironmentCore.getEnvironmentPath)(slug));
67
50
  if (!isUp) {
68
51
  throw new _userError.default('A WP-CLI command can only be executed on a running local environment.');
69
52
  }
@@ -30,9 +30,13 @@ const examples = [{
30
30
  usage: `${exampleUsage} --editor=phpstorm --slug=example-site`,
31
31
  description: 'Start a local environment and generate a Workspace file for developing in PhpStorm.'
32
32
  }];
33
- (0, _command.default)({
33
+ const cmd = (0, _command.default)({
34
34
  usage
35
- }).option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, _devEnvironmentCli.processSlug).option('skip-rebuild', 'Only start services that are not in a running state.').option(['w', 'skip-wp-versions-check'], 'Skip the prompt to update WordPress; occurs if the last major release version is not configured.').option('vscode', 'Generate a Visual Studio Code Workspace file (deprecated, use --editor=vscode instead).').option('editor', 'Generate a workspace file for the specified editor (supports: vscode, cursor, windsurf, phpstorm).').examples(examples).argv(process.argv, async (arg, opt) => {
35
+ }).option('slug', 'A unique name for a local environment. Default is "vip-local".', undefined, _devEnvironmentCli.processSlug).option('skip-rebuild', 'Only start services that are not in a running state.').option(['w', 'skip-wp-versions-check'], 'Skip the prompt to update WordPress; occurs if the last major release version is not configured.').option('vscode', 'Generate a Visual Studio Code Workspace file (deprecated, use --editor=vscode instead).').option('editor', 'Generate a workspace file for the specified editor (supports: vscode, cursor, windsurf, phpstorm).');
36
+ if (process.platform !== 'win32') {
37
+ cmd.option('autofix-domain-resolution', 'Automatically fix domain resolution issues by updating the hosts file [UNSAFE].');
38
+ }
39
+ cmd.examples(examples).argv(process.argv, async (arg, opt) => {
36
40
  const slug = await (0, _devEnvironmentCli.getEnvironmentName)(opt);
37
41
  const lando = await (0, _devEnvironmentLando.bootstrapLando)({
38
42
  logFile: (0, _devEnvironmentCli.getDevEnvLogFile)(slug)
@@ -49,7 +53,8 @@ const examples = [{
49
53
  debug('Args: ', arg, 'Options: ', opt);
50
54
  const options = {
51
55
  skipRebuild: Boolean(opt.skipRebuild),
52
- skipWpVersionsCheck: Boolean(opt.skipWpVersionsCheck)
56
+ skipWpVersionsCheck: Boolean(opt.skipWpVersionsCheck),
57
+ autofixDomains: Boolean(opt.autofixDomainResolution)
53
58
  };
54
59
  try {
55
60
  await (0, _devEnvironmentCore.startEnvironment)(lando, slug, options);
package/dist/bin/vip.js CHANGED
@@ -7,8 +7,6 @@ var _debug = _interopRequireDefault(require("debug"));
7
7
  var _enquirer = require("enquirer");
8
8
  var _command = _interopRequireWildcard(require("../lib/cli/command"));
9
9
  var _config = _interopRequireDefault(require("../lib/cli/config"));
10
- var _internalBinLoader = require("../lib/cli/internal-bin-loader");
11
- var _seaDispatch = require("../lib/cli/sea-dispatch");
12
10
  var _token = _interopRequireDefault(require("../lib/token"));
13
11
  var _tracker = require("../lib/tracker");
14
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -22,28 +20,10 @@ if (_config.default && _config.default.environment !== 'production') {
22
20
  // Config
23
21
  const tokenURL = 'https://dashboard.wpvip.com/me/cli/token';
24
22
  const customDeployToken = process.env.WPVIP_DEPLOY_TOKEN;
25
- async function maybeExecuteSeaTargetCommand() {
26
- const targetBin = process.env.VIP_CLI_TARGET_BIN;
27
- if (!(0, _seaDispatch.isSeaRuntime)() || !targetBin || targetBin === 'vip') {
28
- return false;
29
- }
30
- const start = Number(process.env.VIP_CLI_TARGET_START ?? '0');
31
- const length = Number(process.env.VIP_CLI_TARGET_LENGTH ?? '0');
32
- const resolution = {
33
- start: Number.isInteger(start) ? start : 0,
34
- length: Number.isInteger(length) ? length : 0
35
- };
36
- process.argv = (0, _seaDispatch.rewriteArgvForInternalBin)(process.argv, resolution);
37
- const loaded = await (0, _internalBinLoader.loadInternalBin)(targetBin);
38
- if (!loaded) {
39
- throw new Error(`Unable to load SEA command target "${targetBin}"`);
40
- }
41
- return true;
42
- }
43
23
  const runCmd = async function () {
44
24
  const cmd = (0, _command.default)();
45
25
  cmd.command('logout', 'Log out the current authenticated VIP-CLI user.').command('app', 'Interact with applications that the current authenticated VIP-CLI user has permission to access.').command('backup', 'Generate a backup of an environment.').command('cache', 'Manage page cache for an environment.').command('config', 'Manage environment configurations.').command('dev-env', 'Create and manage VIP Local Development Environments.').command('export', 'Export a copy of data associated with an environment.').command('import', 'Import media or SQL database files to an environment.').command('logs', 'Retrieve Runtime Logs from an environment.').command('search-replace', 'Search for a string in a local SQL file and replace it with a new string.').command('slowlogs', 'Retrieve MySQL slow query logs from an environment.').command('db', "Access an environment's database.").command('sync', 'Sync the database from production to a non-production environment.').command('whoami', 'Retrieve details about the current authenticated VIP-CLI user.').command('wp', 'Execute a WP-CLI command against an environment.');
46
- await cmd.argv(process.argv);
26
+ cmd.argv(process.argv);
47
27
  };
48
28
 
49
29
  /**
@@ -54,89 +34,7 @@ const runCmd = async function () {
54
34
  function doesArgvHaveAtLeastOneParam(argv, params) {
55
35
  return argv.some(arg => params.includes(arg));
56
36
  }
57
- async function runLoginFlow() {
58
- console.log();
59
- console.log(' _ __ ________ ________ ____');
60
- console.log(' | | / // _/ __ / ____/ / / _/');
61
- console.log(' | | / / / // /_/ /______/ / / / / / ');
62
- console.log(' | |/ /_/ // ____//_____/ /___/ /____/ / ');
63
- console.log(' |___//___/_/ ____/_____/___/ ');
64
- console.log();
65
- console.log(' VIP-CLI is your tool for interacting with and managing your VIP applications.');
66
- console.log();
67
- console.log(' Authenticate your installation of VIP-CLI with your Personal Access Token. This URL will be opened in your web browser automatically so that you can retrieve your token: ' + tokenURL);
68
- console.log();
69
- await (0, _tracker.trackEvent)('login_command_execute');
70
- const answer = await (0, _enquirer.prompt)({
71
- type: 'confirm',
72
- name: 'continue',
73
- message: 'Ready to authenticate?'
74
- });
75
- if (!answer.continue) {
76
- await (0, _tracker.trackEvent)('login_command_browser_cancelled');
77
- return null;
78
- }
79
- const {
80
- default: open
81
- } = await import('open');
82
- open(tokenURL, {
83
- wait: false
84
- });
85
- await (0, _tracker.trackEvent)('login_command_browser_opened');
86
- const {
87
- token: tokenInput
88
- } = await (0, _enquirer.prompt)({
89
- type: 'password',
90
- name: 'token',
91
- message: 'Access Token:'
92
- });
93
- let token;
94
- try {
95
- token = new _token.default(tokenInput);
96
- } catch (err) {
97
- console.log('The token provided is malformed. Please check the token and try again.');
98
- await (0, _tracker.trackEvent)('login_command_token_submit_error', {
99
- error: err.message
100
- });
101
- return null;
102
- }
103
- if (token.expired()) {
104
- console.log('The token provided is expired. Please log in again to refresh the token.');
105
- await (0, _tracker.trackEvent)('login_command_token_submit_error', {
106
- error: 'expired'
107
- });
108
- return null;
109
- }
110
- if (!token.valid()) {
111
- console.log('The provided token is not valid. Please log in again to refresh the token.');
112
- await (0, _tracker.trackEvent)('login_command_token_submit_error', {
113
- error: 'invalid'
114
- });
115
- return null;
116
- }
117
- try {
118
- await _token.default.set(token.raw);
119
- } catch (err) {
120
- await (0, _tracker.trackEvent)('login_command_token_submit_error', {
121
- error: err.message
122
- });
123
- throw err;
124
- }
125
-
126
- // De-anonymize user for tracking
127
- await (0, _tracker.aliasUser)(token.id);
128
- await (0, _tracker.trackEvent)('login_command_token_submit_success');
129
- return token;
130
- }
131
37
  const rootCmd = async function () {
132
- if ((0, _seaDispatch.isSeaRuntime)() && !process.env.VIP_CLI_TARGET_BIN) {
133
- const resolution = (0, _seaDispatch.resolveInternalBinFromArgv)(process.argv);
134
- if (resolution.bin !== 'vip') {
135
- process.env.VIP_CLI_TARGET_BIN = resolution.bin;
136
- process.env.VIP_CLI_TARGET_START = String(resolution.start);
137
- process.env.VIP_CLI_TARGET_LENGTH = String(resolution.length);
138
- }
139
- }
140
38
  let token = await _token.default.get();
141
39
  const isHelpCommand = doesArgvHaveAtLeastOneParam(process.argv, ['help', '-h', '--help']);
142
40
  const isVersionCommand = doesArgvHaveAtLeastOneParam(process.argv, ['-v', '--version']);
@@ -146,22 +44,82 @@ const rootCmd = async function () {
146
44
  const isCustomDeployCmdWithKey = doesArgvHaveAtLeastOneParam(process.argv, ['deploy']) && Boolean(customDeployToken);
147
45
  debug('Argv:', process.argv);
148
46
  if (!isLoginCommand && (isLogoutCommand || isHelpCommand || isVersionCommand || isDevEnvCommandWithoutEnv || token?.valid() || isCustomDeployCmdWithKey)) {
149
- if (await maybeExecuteSeaTargetCommand()) {
150
- return;
151
- }
152
47
  await runCmd();
153
48
  } else {
154
- token = await runLoginFlow();
155
- if (!token) {
49
+ console.log();
50
+ console.log(' _ __ ________ ________ ____');
51
+ console.log(' | | / // _/ __ / ____/ / / _/');
52
+ console.log(' | | / / / // /_/ /______/ / / / / / ');
53
+ console.log(' | |/ /_/ // ____//_____/ /___/ /____/ / ');
54
+ console.log(' |___//___/_/ ____/_____/___/ ');
55
+ console.log();
56
+ console.log(' VIP-CLI is your tool for interacting with and managing your VIP applications.');
57
+ console.log();
58
+ console.log(' Authenticate your installation of VIP-CLI with your Personal Access Token. This URL will be opened in your web browser automatically so that you can retrieve your token: ' + tokenURL);
59
+ console.log();
60
+ await (0, _tracker.trackEvent)('login_command_execute');
61
+ const answer = await (0, _enquirer.prompt)({
62
+ type: 'confirm',
63
+ name: 'continue',
64
+ message: 'Ready to authenticate?'
65
+ });
66
+ if (!answer.continue) {
67
+ await (0, _tracker.trackEvent)('login_command_browser_cancelled');
68
+ return;
69
+ }
70
+ const {
71
+ default: open
72
+ } = await import('open');
73
+ open(tokenURL, {
74
+ wait: false
75
+ });
76
+ await (0, _tracker.trackEvent)('login_command_browser_opened');
77
+ const {
78
+ token: tokenInput
79
+ } = await (0, _enquirer.prompt)({
80
+ type: 'password',
81
+ name: 'token',
82
+ message: 'Access Token:'
83
+ });
84
+ try {
85
+ token = new _token.default(tokenInput);
86
+ } catch (err) {
87
+ console.log('The token provided is malformed. Please check the token and try again.');
88
+ await (0, _tracker.trackEvent)('login_command_token_submit_error', {
89
+ error: err.message
90
+ });
156
91
  return;
157
92
  }
93
+ if (token.expired()) {
94
+ console.log('The token provided is expired. Please log in again to refresh the token.');
95
+ await (0, _tracker.trackEvent)('login_command_token_submit_error', {
96
+ error: 'expired'
97
+ });
98
+ return;
99
+ }
100
+ if (!token.valid()) {
101
+ console.log('The provided token is not valid. Please log in again to refresh the token.');
102
+ await (0, _tracker.trackEvent)('login_command_token_submit_error', {
103
+ error: 'invalid'
104
+ });
105
+ return;
106
+ }
107
+ try {
108
+ await _token.default.set(token.raw);
109
+ } catch (err) {
110
+ await (0, _tracker.trackEvent)('login_command_token_submit_error', {
111
+ error: err.message
112
+ });
113
+ throw err;
114
+ }
115
+
116
+ // De-anonymize user for tracking
117
+ await (0, _tracker.aliasUser)(token.id);
118
+ await (0, _tracker.trackEvent)('login_command_token_submit_success');
158
119
  if (isLoginCommand) {
159
120
  console.log('You are now logged in - see `vip -h` for a list of available commands.');
160
121
  process.exit();
161
122
  }
162
- if (await maybeExecuteSeaTargetCommand()) {
163
- return;
164
- }
165
123
  await runCmd();
166
124
  }
167
125
  };
@@ -4,6 +4,7 @@ exports.__esModule = true;
4
4
  exports.PhpMyAdminCommand = exports.GET_PHP_MY_ADMIN_STATUS_QUERY = exports.GENERATE_PHP_MY_ADMIN_URL_MUTATION = exports.ENABLE_PHP_MY_ADMIN_MUTATION = void 0;
5
5
  var _chalk = _interopRequireDefault(require("chalk"));
6
6
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
7
+ var _promises = require("node:timers/promises");
7
8
  var _api = _interopRequireWildcard(require("../lib/api"));
8
9
  var exit = _interopRequireWildcard(require("../lib/cli/exit"));
9
10
  var _progress = require("../lib/cli/progress");
@@ -94,6 +95,45 @@ async function getPhpMyAdminStatus(appId, envId) {
94
95
  (0, _api.enableGlobalGraphQLErrorHandling)();
95
96
  return resp.data?.app?.environments?.[0]?.phpMyAdminStatus?.status ?? '';
96
97
  }
98
+ class MyProgressTracker extends _progress.ProgressTracker {
99
+ constructor(steps, silent) {
100
+ super(steps);
101
+ this.silent = silent;
102
+ }
103
+ setSilent(silent) {
104
+ this.silent = silent;
105
+ }
106
+ print() {
107
+ if (!this.silent) {
108
+ super.print();
109
+ }
110
+ }
111
+ startPrinting(prePrintCallback) {
112
+ if (!this.silent) {
113
+ super.startPrinting(prePrintCallback);
114
+ }
115
+ }
116
+ stopPrinting() {
117
+ if (!this.silent) {
118
+ super.stopPrinting();
119
+ }
120
+ }
121
+ stepRunning(stepId, additionalInfo) {
122
+ if (!this.silent) {
123
+ super.stepRunning(stepId, additionalInfo);
124
+ }
125
+ }
126
+ stepSuccess(stepId, additionalInfo) {
127
+ if (!this.silent) {
128
+ super.stepSuccess(stepId, additionalInfo);
129
+ }
130
+ }
131
+ stepFailed(stepId, additionalInfo) {
132
+ if (!this.silent) {
133
+ super.stepFailed(stepId, additionalInfo);
134
+ }
135
+ }
136
+ }
97
137
  class PhpMyAdminCommand {
98
138
  silent;
99
139
  steps = {
@@ -101,23 +141,23 @@ class PhpMyAdminCommand {
101
141
  GENERATE: 'generate'
102
142
  };
103
143
  progressTracker;
104
- constructor(app, env, track = async () => {}) {
144
+ constructor(app, env, track = async () => {}, silent = false) {
105
145
  this.app = app;
106
146
  this.env = env;
107
147
  this.track = track;
108
- this.progressTracker = new _progress.ProgressTracker([{
148
+ this.silent = silent;
149
+ this.progressTracker = new MyProgressTracker([{
109
150
  id: this.steps.ENABLE,
110
- name: 'Enabling PHPMyAdmin for this environment'
151
+ name: 'Enabling phpMyAdmin for this environment'
111
152
  }, {
112
153
  id: this.steps.GENERATE,
113
154
  name: 'Generating access link'
114
- }]);
155
+ }], silent);
115
156
  }
116
157
  log(msg) {
117
- if (this.silent) {
118
- return;
158
+ if (!this.silent) {
159
+ console.log(msg);
119
160
  }
120
- console.log(msg);
121
161
  }
122
162
  stopProgressTracker() {
123
163
  this.progressTracker.print();
@@ -141,19 +181,22 @@ class PhpMyAdminCommand {
141
181
  await (0, _utils.pollUntil)(this.getStatus.bind(this), 1000, sts => sts === 'running');
142
182
 
143
183
  // Additional 30s for LB routing to be updated
144
- await new Promise(resolve => setTimeout(resolve, 30000));
184
+ await (0, _promises.setTimeout)(30_000);
145
185
  }
146
186
  }
147
- async run(silent = false) {
148
- this.silent = silent;
187
+ async run({
188
+ print = false
189
+ } = {}) {
149
190
  if (!this.app.id) {
150
191
  exit.withError('No app was specified');
151
192
  }
152
193
  if (!this.env.id) {
153
194
  exit.withError('No environment was specified');
154
195
  }
155
- const message = 'Note: PHPMyAdmin sessions are read-only. If you run a query that writes to DB, it will fail.';
156
- console.log(_chalk.default.yellow(message));
196
+ if (!this.silent) {
197
+ const message = 'Note: PHPMyAdmin sessions are read-only. If you run a query that writes to DB, it will fail.';
198
+ console.log(_chalk.default.yellow(message));
199
+ }
157
200
  this.progressTracker.startPrinting();
158
201
  try {
159
202
  this.progressTracker.stepRunning(this.steps.ENABLE);
@@ -171,7 +214,7 @@ class PhpMyAdminCommand {
171
214
  if (error.graphQLErrors?.find(gqlError => gqlError.message === 'Unauthorized')) {
172
215
  exit.withError('You do not have sufficient permission to access phpMyAdmin for this environment.');
173
216
  }
174
- exit.withError('Failed to enable PhpMyAdmin. Please try again. If the problem persists, please contact support.');
217
+ exit.withError('Failed to enable phpMyAdmin. Please try again. If the problem persists, please contact support.');
175
218
  }
176
219
  let url;
177
220
  try {
@@ -187,11 +230,16 @@ class PhpMyAdminCommand {
187
230
  stack: error.stack
188
231
  });
189
232
  this.stopProgressTracker();
190
- exit.withError(`Failed to generate PhpMyAdmin URL: ${error.message}`);
233
+ exit.withError(`Failed to generate phpMyAdmin URL: ${error.message}`);
191
234
  }
192
- void this.openUrl(url);
193
235
  this.stopProgressTracker();
194
- this.log('PhpMyAdmin is opened in your default browser.');
236
+ if (print) {
237
+ // Output only the URL to stdout for scripting/automation use
238
+ console.log(url);
239
+ } else {
240
+ void this.openUrl(url);
241
+ this.log('phpMyAdmin is opened in your default browser.');
242
+ }
195
243
  }
196
244
  }
197
245
  exports.PhpMyAdminCommand = PhpMyAdminCommand;