Skip to content

bug: squad nap fails when invoked via bang command (!) in Windows PowerShell terminal #734

Closed

Description

@diberry

Problem

Running squad nap via Copilot CLI's bang command (!squad nap or !npx @bradygaster/squad-cli nap) in a Windows PowerShell terminal fails. The ! prefix is used in Copilot CLI to execute shell commands directly from the chat interface.

Environment

  • OS: Windows 11
  • Terminal: PowerShell 7.6
  • Shell: Copilot CLI (ghcs / gh copilot)
  • Squad CLI: 0.9.1

Steps to Reproduce

  1. Open a Copilot CLI session in Windows PowerShell
  2. Run: !npx @bradygaster/squad-cli nap
  3. Observe failure

Expected Behavior

squad nap should execute the nap/archival cycle (decisions archive, history summarization, git commit) the same way it works when run directly in a PowerShell terminal outside of Copilot CLI.

Likely Causes

  • PowerShell ! history expansion conflict: In PowerShell, ! has special meaning for history recall (!n recalls command n). The bang prefix in Copilot CLI may conflict with PowerShell's history operator.
  • stdin/TTY issues: squad nap may require interactive stdin that's not available when invoked as a subprocess from Copilot CLI's bang command handler.
  • Process spawning: The bang command may spawn a child process differently than direct terminal execution — different env vars, working directory, or signal handling.

Additional Context

  • This was discovered during a Copilot CLI session working on bradygaster/squad (2026-04-01)
  • The nap command works fine when run directly in PowerShell (not via bang)
  • Other bang commands (!git status, !gh issue list) work normally in the same terminal
  • The issue may be specific to commands that do interactive work (git commits, file I/O) rather than read-only commands

Investigation Needed

  • Capture the exact error output when running via bang
  • Test if the issue is PowerShell-specific or affects cmd.exe too
  • Test if !npx @bradygaster/squad-cli nap --dry-run works (read-only mode)
  • Check if the nap command's git operations (git add, git commit) need a TTY

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions