@postman/postman-plugin 0.1.0 → 0.1.1-rc.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/README.md CHANGED
@@ -21,7 +21,7 @@ dependencies, ownership, runtime behavior, and the likely impact of a change.
21
21
  Install Postman in every compatible coding agent detected on your machine:
22
22
 
23
23
  ```bash
24
- npx @postman/postman-plugin
24
+ npx @postman/postman-plugin@next
25
25
  ```
26
26
 
27
27
  One command configures **Claude Code, Codex, Cursor, Kimi Code and OpenCode**.
package/dist/cli.js CHANGED
@@ -20,13 +20,7 @@ Options:
20
20
  -y, --yes Don't ask for confirmation (required when not in a terminal)
21
21
  --dry-run Print what would change without changing anything
22
22
  -h, --help Show this help
23
- -v, --version Show the version
24
-
25
- Exit codes:
26
- 0 Done, or nothing needed doing
27
- 1 Something failed or was blocked, you cancelled, or install found no agent
28
- 2 Bad usage, or confirmation needed but no terminal (use --yes)
29
- 3 Done, except a step only you can do (printed as "next:")`;
23
+ -v, --version Show the version`;
30
24
  function version() {
31
25
  const manifest = new URL('../package.json', import.meta.url);
32
26
  return JSON.parse(fs.readFileSync(manifest, 'utf8')).version;
@@ -46,13 +46,10 @@ export const kimi = {
46
46
  if (!(await system.which('npx'))) {
47
47
  blocked('npx is not on PATH');
48
48
  }
49
- // Only picks the verb: an unreadable store must not stop the install that could repair it.
50
- const installed = await kimi.status(system).then((status) => status.installed, () => null);
51
- // An explicit --package outranks the npm_config_package an outer `npx -p` exports to us.
52
- await mustRun(system, 'npx', ['-y', `--package=${PLUGINS_CLI}`, 'plugins', 'add', REPO, '--target', 'kimi', '--yes'], {
49
+ await mustRun(system, 'npx', ['-y', PLUGINS_CLI, 'add', REPO, '--target', 'kimi', '--yes'], {
53
50
  env: { DISABLE_TELEMETRY: '1', DO_NOT_TRACK: '1' }
54
51
  });
55
- return result('done', `${installed ? 'updated' : 'installed'} ${PLUGIN_ID} in ${kimiHome(system)}`, NEXT);
52
+ return result('done', `installed ${PLUGIN_ID} into ${kimiHome(system)}`, NEXT);
56
53
  });
57
54
  },
58
55
  async remove(system) {
package/dist/run.js CHANGED
@@ -1,5 +1,6 @@
1
- export const EXIT = { ok: 0, failed: 1, usage: 2, manual: 3 };
2
- const FAILED = ['failed', 'blocked'];
1
+ export const EXIT = { ok: 0, failed: 1, usage: 2 };
2
+ // `manual` counts: the command did not finish, and a script needs to know the user has a step left.
3
+ const INCOMPLETE = ['failed', 'blocked', 'manual'];
3
4
  function padEnd(text, width) {
4
5
  return text + ' '.repeat(Math.max(1, width - text.length));
5
6
  }
@@ -75,15 +76,11 @@ export async function run(system, hosts, options) {
75
76
  }
76
77
  }
77
78
  if (!targets.length) {
78
- system.log(options.agents.length ?
79
- 'None of the requested agents was found.' :
80
- `No supported coding agent found. Supported: ${joinNames(requested)}.`);
79
+ system.log(`No supported coding agent found. Supported: ${joinNames(requested)}.`);
81
80
  reports.forEach((report) => system.log(` ${report.result.message}`));
82
- // Nothing to remove is a clean remove; nothing to install into is not a successful install.
83
- return options.command === 'install' || (options.command === 'remove' && reports.length) ? EXIT.failed : EXIT.ok;
81
+ return reports.length && options.command !== 'status' ? EXIT.failed : EXIT.ok;
84
82
  }
85
- // "Found:" over "not installed" read to agents as "not found"; the header says both things.
86
- system.log(`Found ${targets.length} coding agent${targets.length === 1 ? '' : 's'}. Postman in each:`);
83
+ system.log('Found:');
87
84
  printStatuses(system, targets, width);
88
85
  reports.forEach((report) => system.log(` ${padEnd(report.host.name, width)}${report.result.message}`));
89
86
  if (options.command === 'status') {
@@ -93,12 +90,12 @@ export async function run(system, hosts, options) {
93
90
  // remove also clears duplicates and half-finished installs that status doesn't count.
94
91
  const command = options.command;
95
92
  if (!options.yes && !system.dryRun) {
96
- const verb = command === 'install' ? 'install or update Postman in' : 'remove Postman from', names = joinNames(targets.map((target) => target.host));
97
93
  if (!options.isTTY) {
98
- system.log(`\nNothing changed: there is no terminal to confirm in. To ${verb} ${names}, re-run with --yes (add --agent <id> for only some).`);
94
+ system.log('\nNot running in a terminal, so there is no one to confirm. Re-run with --yes.');
99
95
  return EXIT.usage;
100
96
  }
101
- if (!(await options.confirm(`\n${verb[0].toUpperCase()}${verb.slice(1)} ${names}? [Y/n] `))) {
97
+ const verb = command === 'install' ? 'Install or update Postman in' : 'Remove Postman from';
98
+ if (!(await options.confirm(`\n${verb} ${joinNames(targets.map((target) => target.host))}? [Y/n] `))) {
102
99
  system.log('Cancelled.');
103
100
  return EXIT.failed;
104
101
  }
@@ -113,8 +110,5 @@ export async function run(system, hosts, options) {
113
110
  for (const { host, result } of reports) {
114
111
  system.log(` ${padEnd(host.name, width)}${padEnd(result.outcome, 9)}${result.message.split('\n')[0]}`);
115
112
  }
116
- if (reports.some(({ result }) => FAILED.includes(result.outcome))) {
117
- return EXIT.failed;
118
- }
119
- return reports.some(({ result }) => result.outcome === 'manual') ? EXIT.manual : EXIT.ok;
113
+ return reports.some(({ result }) => INCOMPLETE.includes(result.outcome)) ? EXIT.failed : EXIT.ok;
120
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman/postman-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-rc.0",
4
4
  "description": "Installs the Postman plugin into every supported coding agent on this machine.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",