Skip to content

fix(cli): avoid node util styleText dependency in setup wizard#12

Open
freelanceagent1 wants to merge 2 commits intocortexkit:mainfrom
freelanceagent1:fix/cli-node19-prompts
Open

fix(cli): avoid node util styleText dependency in setup wizard#12
freelanceagent1 wants to merge 2 commits intocortexkit:mainfrom
freelanceagent1:fix/cli-node19-prompts

Conversation

@freelanceagent1
Copy link
Copy Markdown
Contributor

Summary

Fixes the aft-opencode setup / doctor CLI crash on older Node runtimes where node:util.styleText is unavailable.

The failure reported was:

$ bunx @cortexkit/aft-opencode@latest setup
SyntaxError: The requested module 'node:util' does not provide an export named 'styleText'

Cause

The CLI prompt path depended on @clack/prompts, which pulled in a runtime path that expected newer Node node:util exports than are available on Node 19.9.0.

Fix

  • replace the CLI prompt wrapper with a small Node-native implementation
  • remove @clack/prompts from the plugin package dependencies
  • keep the existing setup / doctor CLI behavior intact

Validation

  • bun install
  • bun run build in packages/opencode-plugin
  • node packages/opencode-plugin/dist/cli.js

Additionally, the built dist/cli.js no longer contains:

  • styleText
  • stripVTControlCharacters
  • @clack/prompts
  • node:util

Compatibility note

  • validated on the current Windows host by rebuilding and running the bundled CLI
  • this change is intended to improve compatibility for older Node runtimes, including the reported macOS arm64 Node 19.9.0 case
  • I did not runtime-test on macOS in this branch from this machine

@freelanceagent1 freelanceagent1 force-pushed the fix/cli-node19-prompts branch from 7215f95 to 07cefc0 Compare April 16, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant