@ekkos/cli 0.2.1 → 0.2.2

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.
@@ -731,9 +731,9 @@ async function runWithSpawn(claudePath, args, options, state) {
731
731
  console.log('');
732
732
  let claude;
733
733
  if (isWindows) {
734
- // On Windows, spawn Claude directly
735
- // IMPORTANT: npx mode doesn't work well on Windows because Claude Code
736
- // detects non-TTY and defaults to --print mode expecting stdin input
734
+ // On Windows, Node.js spawn doesn't provide proper TTY support
735
+ // Claude Code detects non-TTY and defaults to --print mode
736
+ // Solution: Use cmd.exe /c to run claude directly with proper console
737
737
  if (claudePath === 'npx') {
738
738
  console.log('');
739
739
  console.log(chalk_1.default.red('═══════════════════════════════════════════════════════════════════'));
@@ -746,18 +746,39 @@ async function runWithSpawn(claudePath, args, options, state) {
746
746
  console.log(chalk_1.default.yellow(' Then try again:'));
747
747
  console.log(chalk_1.default.cyan(' ekkos run -b'));
748
748
  console.log('');
749
- console.log(chalk_1.default.gray(' Why? Windows spawn mode doesn\'t provide a proper TTY,'));
750
- console.log(chalk_1.default.gray(' causing Claude Code to expect piped input instead of interactive.'));
749
+ process.exit(1);
750
+ }
751
+ console.log(chalk_1.default.gray('Windows mode: launching Claude with proper TTY...'));
752
+ // Build the full command
753
+ const fullCmd = args.length > 0
754
+ ? `"${claudePath}" ${args.join(' ')}`
755
+ : `"${claudePath}"`;
756
+ // Use cmd.exe /c to get proper console behavior
757
+ // This replaces the current process with claude
758
+ const { spawnSync } = require('child_process');
759
+ // First try: Direct exec replacement
760
+ try {
761
+ const result = spawnSync('cmd.exe', ['/c', fullCmd], {
762
+ stdio: 'inherit',
763
+ cwd: process.cwd(),
764
+ env: process.env,
765
+ windowsHide: false,
766
+ shell: false
767
+ });
768
+ // If we get here, claude exited
769
+ (0, state_1.clearAutoClearFlag)();
770
+ process.exit(result.status || 0);
771
+ }
772
+ catch (err) {
773
+ console.error(chalk_1.default.red('Failed to launch Claude:'), err.message);
774
+ console.log('');
775
+ console.log(chalk_1.default.yellow('Try running claude directly:'));
776
+ console.log(chalk_1.default.cyan(' claude'));
751
777
  console.log('');
752
778
  process.exit(1);
753
779
  }
754
- console.log(chalk_1.default.gray('Windows mode: running Claude directly'));
755
- claude = (0, child_process_1.spawn)(claudePath, args, {
756
- stdio: 'inherit', // Full inherit for proper interactive mode
757
- cwd: process.cwd(),
758
- env: process.env,
759
- shell: true
760
- });
780
+ // This line won't be reached due to spawnSync + process.exit
781
+ return;
761
782
  }
762
783
  else {
763
784
  // Use script command for PTY on Unix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekkos/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Setup ekkOS memory for AI coding assistants (Claude Code, Cursor, Windsurf)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {