feat(prompt): add GitHub Copilot CLI agent support#16
Open
anxkhn wants to merge 1 commit into
Open
Conversation
Launch the copilot agent non-interactively with 'copilot -s --allow-all-tools --no-ask-user -p "<prompt>"' so it runs autonomously without stopping for tool or trust prompts. Optional model selection is passed through via the COPILOT_MODEL env var. The auto watcher also recognizes Copilot's folder-trust panel. Adds tests for the command builder and documents usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds first-class support for the GitHub Copilot CLI (
copilot) as an agent, alongside the existingclaude,codex, andaideragents.Run it like any other agent:
Why
Plain
copilot "<prompt>"opens an interactive session and stops on tool and folder-trust prompts, which hangs in an unattended worktree. Copilot ships a print mode designed for exactly this, so the agent should be wired to use it.How
cmd/prompt/prompt.go: newbuildAgentCommandhelper. Forcopilotit buildscopilot -s --allow-all-tools --no-ask-user -p(the prompt is still appended by the existing send-keys template), so it runs one prompt, auto-approves tools, never callsask_user, and exits. Optional model passthrough viaCOPILOT_MODEL. All other agents pass through unchanged.cmd/watch/auto.go: Copilot's folder-trust dialog uses the same "Do you trust the files in this folder?" wording already handled, plus its panel title "Confirm folder trust" as a safeguard, souzi autokeeps it hands-free.cmd/prompt/prompt_test.go: tests for the command builder, model passthrough, and agent parsing.README.md: documents the new agent andCOPILOT_MODEL.Verification
go build ./...,go vet ./...,go test ./...all pass.uzi prompt --agents=copilot:1spawned a worktree, ran realcopilot, auto-approved, and produced the requested file.