Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Replacing a Commander import with burgee/commander does not make a command’s printed text become JSON data. In the example reported by burgee maintainer Ofri Peretz, an action that calls console.log() but returns no value produces a burgee JSON envelope with "data":null. The example used commander@15.0.0 and burgee@0.11.1; the behavior has not been independently reproduced here.

Why the JSON envelope contains null

Commander action handlers receive the command’s declared arguments, parsed options, and command object. Commander’s documentation shows handlers writing output, but printing output and returning a value are separate operations. Commander documentation

In Peretz’s example, the handler prints a human-readable line and returns no object. The adapter can wrap the action’s return value in its JSON envelope; it cannot infer structured data from text already written to the terminal. Thus the envelope can be valid JSON while its data field is null. This is the maintainer’s account of the example, not an independently verified result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Return data separately from user-facing output

For a command that must support both people and machine consumers, make its handler return a serializable result, and decide separately whether to print explanatory prose. For example:

#1 Best Overall
Sale
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
async function inspectFile(file) {
  const lines = await readLines(file);
  const result = { file, lines: lines.length };

  if (!isMachineMode()) {
    console.log(`Found ${result.lines} lines in ${file}`);
  }

  return result;
}

The return object is the data layer; the conditional message is the human-facing layer. Keep incidental prose off stdout when the caller expects a machine-readable stream. Peretz warns that an MCP invocation which prints a line before its JSON-RPC response can leave a client unable to parse that stream. That is a demonstrated risk in the article, not a claim that every client or invocation arrangement fails identically.

Do not treat the example’s mode check as a stable API

The maintainer’s sample checks whether --json or --mcp appears in process.argv to decide whether to suppress prose. He explicitly calls that check crude and says the burgee@0.11.1 façade has no public machine-mode flag. Treat it as an illustration, not a universal or current API. If you adopt a similar check, centralize it in one output helper rather than scattering argument inspection across handlers.

Rank #2
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

What the import change does—and does not establish

Peretz reports replacing the Commander import with burgee/commander in a file using seven invocations, with usage errors still exiting with status 1 in that example. He says his sample ran on Node 20 and 22, excluding Node 22.12.x, and that the package’s declared Node range changed from >=22.12.0 to ^20.19.0 || >=22.13.0 after Commander left the dependencies. These are author-reported, version-specific observations—not a statement of current support policy.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

He also notes that TypeScript’s legacy node module resolver cannot see the subpath. Check the resolver and runtime requirements for the exact project configuration before making the swap; the cited account does not establish compatibility for every TypeScript setup.

Rank #3
KOPJIPPOM Large Print Backlit Keyboard, USB Wired Computer Keyboard, Full Size Keyboard with White Illuminated LED Compatible for Windows Desktop, Laptop, PC, Gaming, Black
  • 【Large Print Keyboard】- 4X larger than standard keyboard fonts, clear and easy to find, and can really help those who have trouble seeing keyboards. Perfect for elderly, the visually impaired, schools, special needs departments and libraries, etc
  • 【White LED Backlight】- Bright and evenly distributed backlit keys, easy typing in lower light environment. Ideal for studio work, office. Backlit can choose to turn on/off and adjust brightness.
  • 【Full Size & Ergonomics Design】- Unfold the feet at back of the keyboard to reduce hand fatigue and enjoy long hours of playing. Full QWERTY English (US) 104 key keyboard layout with numeric keypad, Large Print keys provides superior comfort without forcing you to relearn how to type.
  • 【Plug and Play & Wide Compatibility】 - This USB keyboard takes away the hassle of power charging or swapping out batteries and is easy to setup. No drivers required.Compatible with Windows 2000/XP/7/8/10, Vista,Raspberry Pi 3/4, Mac OS(Note: Multimedia keys may not fully compatible with Mac, OS System).Works with your PC, laptop.
  • 【Spill-proof】- This durable keyboard features a spill-resistant design. So you don't have to worry about spilling coffee and water. Enjoy Keys life of more than 5000W times.

Reported fixes and a remaining error case

Peretz says he found two issues while drafting against burgee@0.9.2, and that both were fixed in burgee@0.11.1:

  • MCP argument mapping for a declared hyphenated flag.
  • Completion suggestions for negated flags.

He also reports that an action throw remains uncaught under --json. Account for that limitation in error handling rather than assuming the JSON mode converts every thrown error into a structured response. These fixes and the limitation are the maintainer’s release-specific report.

Rank #4
Sale
Logitech MK120 Full Size Wired Keyboard and Mouse Combo - Black
  • Durable and Reliable: This USB keyboard features a curved space bar, spill-resistant design (2), durable keys that can withstand 10 million keystrokes, and sturdy, adjustable tilt legs
  • Comfortable, Familiar Typing: You’ll enjoy a comfortable and familiar typing experience thanks to the deep-profile keys and standard layout with full-size F-keys and number pad
  • Full-size Sculpted Mouse: The high-definition optical USB mouse puts comfort and control in your hands with smooth, accurate tracking and an ambidextrous shape that feels good hour after hour
  • Simple Set-Up: Simply plug the keyboard and mouse into the USB ports on your desktop, laptop, or netbook and you're ready to work; compatible with Windows 7, 8, 10 or later
  • Clear and Convenient: The bold, bright white and long-lasting characters make the keys on this PC or laptop keyboard easy to read and extra durable
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to decide whether to make the swap

The choice is not simply whether a Commander-style command still runs. Weigh the adapter against the needs and constraints of the particular CLI:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision point What to check
Existing CLI behavior Exercise the commands, options, help output, and usage-error cases your users rely on; the reported seven-invocation example is not evidence for every CLI.
Machine-facing interfaces Decide whether JSON, schema, MCP, or shell completions are useful for your CLI. The product owner describes these as interfaces projected from one declaration; that is product positioning, not an independent evaluation. burgee product site
Handler design Identify actions that only print output. If machine consumers need their results, return structured values and keep stdout parseable in machine mode.
Runtime and TypeScript Verify the specific Node version and TypeScript module-resolution mode used by your project.
Package footprint Compare the dependency and bundle impact against the value of the additional interfaces for your deployment.

Interpret the published comparison narrowly

Peretz reports running Commander’s own suite with burgee/commander and with real Commander as a control: both runs passed 1360 / 1360 tests. He cautions that this measures retained behavior, not the adapter’s additional interfaces. He also reports Commander 15.0.0 unpacked at 207,368 bytes, versus 1,266,628 bytes for burgee 0.11.1 plus five sibling packages; his bundle gate reads 1.514×. These are the author’s version-specific measurements, not independently reproduced benchmarks or a like-for-like assessment of every deployment.

Best Value
Rii RK907 Ultra-Slim Compact USB Wired Keyboard for MAC and PC-Black(1PCS)
  • A plug-and-play USB connection with Low-profile keys give you a quiet, comfortable typing experience
  • Simple Wired USB Connection,You will enjoy a comfortable and quiet typing experience
  • The keyboard for business and office working is the budget-friendly keyboard that is built for longer use
  • Low profile keys for a more comfortable and quiet keystroke, desktop-centric design, splash resistant

Audit commands that print data agents need

A useful migration question is: “Which command in your CLI prints something an agent currently scrapes with a regex, and what would returning it instead break?” — Ofri Peretz, burgee maintainer. For each such command, identify the text consumers parse, define a stable structured return value, and check whether changing output or error behavior would affect existing scripts before adopting the adapter.

Quick Recap

SaleBestseller No. 1
SaleBestseller No. 2
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.39
SaleBestseller No. 4
Logitech MK120 Full Size Wired Keyboard and Mouse Combo - Black
Logitech MK120 Full Size Wired Keyboard and Mouse Combo - Black
Product carbon footprint: 5.03 kg CO2e
$17.77
Bestseller No. 5
Rii RK907 Ultra-Slim Compact USB Wired Keyboard for MAC and PC-Black(1PCS)
Rii RK907 Ultra-Slim Compact USB Wired Keyboard for MAC and PC-Black(1PCS)
Simple Wired USB Connection,You will enjoy a comfortable and quiet typing experience
$9.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.