Repository navigation
Add agentctl for local Copilot custom-agent execution across repositories - #30
Merged
Merged
Conversation
Co-authored-by: Daigrin <198701947+Daigrin@users.noreply.github.com>
Co-authored-by: Daigrin <198701947+Daigrin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CLI tool for invoking Copilot custom agents
Add agentctl for local Copilot custom-agent execution across repositories
Oct 3, 2026
…ol-for-agents Co-authored-by: Daigrin <198701947+Daigrin@users.noreply.github.com>
Daigrin
approved these changes
Oct 5, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Checkout validation has unresolved case-handling defects affecting valid origins and Git override isolation on Windows.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds a standalone agentctl command for safely running installed Copilot custom agents in validated local checkouts without changing MCP behavior.
Changes:
- Adds checkout validation, subprocess execution, permissions, and exit handling.
- Bundles nine installable custom-agent profiles.
- Adds comprehensive tests and usage/security documentation.
| File | Description |
|---|---|
cmd/agentctl/main.go |
Adds the executable entry point. |
internal/agentctl/command.go |
Implements CLI commands and execution. |
internal/agentctl/command_test.go |
Tests execution, validation, IO, and cancellation. |
internal/agentctl/checkout.go |
Validates checkout paths and origins. |
internal/agentctl/checkout_test.go |
Tests checkout and remote validation. |
internal/agentctl/profiles.go |
Embeds and safely installs profiles. |
internal/agentctl/profiles_test.go |
Tests profile installation and restrictions. |
internal/agentctl/profiles/coder.agent.md |
Defines the coding profile. |
internal/agentctl/profiles/errorfixer.agent.md |
Defines the error-fixing profile. |
internal/agentctl/profiles/issue-planner.agent.md |
Defines the issue-planning profile. |
internal/agentctl/profiles/researcher.agent.md |
Defines the research profile. |
internal/agentctl/profiles/reviewer.agent.md |
Defines the review profile. |
internal/agentctl/profiles/security-auditor.agent.md |
Defines the security-audit profile. |
internal/agentctl/profiles/summarizer.agent.md |
Defines the summarization profile. |
internal/agentctl/profiles/test-writer.agent.md |
Defines the test-writing profile. |
internal/agentctl/profiles/workflow-debugger.agent.md |
Defines the workflow-debugging profile. |
download.md |
Documents installation, usage, permissions, and limitations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+27
to
+31
| if path, ok := strings.CutPrefix(remote, "git@github.com:"); ok { | ||
| repo = path | ||
| } else { | ||
| u, err := url.Parse(remote) | ||
| if err != nil || u.Host != "github.com" || u.RawQuery != "" || u.Fragment != "" || u.RawPath != "" { |
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.

Summary
Add
agentctlto invoke installed Copilot custom agents in explicitly selected local GitHub checkouts. Execution uses the real Copilot CLI—not simulated completions or cloud-session APIs.Why
Provide reusable cross-repository agent invocation with verified checkout identity, explicit permissions, and honest subprocess results.
What changed
list,install, andrun; help/version, multiline prompts, and mutually exclusive prompt-file input.--forcereplacement.agentctl install reviewer --user agentctl run reviewer --repo OWNER/REPO --path /absolute/checkout \ --prompt "Review the selected files; report findings only."MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint— invoked throughsh; 0 issues../script/test— invoked throughsh; full race suite passed.Uncached focused race tests, all three command builds, and offline CLI checks passed. Tests cover argv/cwd/IO, failures, cancellation, remote validation, injection-like inputs, and installation safety.
Secret scans were clean; CodeQL reported 0 alerts. Independent review found no remaining blockers. Automated review was unavailable; live Copilot authentication/model calls were not tested.
Docs