Skip to content

feat: add GitHub Copilot CLI support#107

Draft
lifejwang11 wants to merge 1 commit into
graykode:mainfrom
lifejwang11:feat/copilot-cli-support
Draft

feat: add GitHub Copilot CLI support#107
lifejwang11 wants to merge 1 commit into
graykode:mainfrom
lifejwang11:feat/copilot-cli-support

Conversation

@lifejwang11
Copy link
Copy Markdown

Adds support for monitoring GitHub Copilot CLI sessions in abtop, alongside the existing Claude Code and Codex CLI collectors.

What's new

  • New CopilotCollector (src/collector/copilot.rs) - discovers and monitors running copilot processes
  • Process detection - identifies Copilot CLI by binary name/path (Homebrew Cask path pattern)
  • Log file parsing - reads ~/.copilot/logs/process-{ts}-{pid}.log incrementally with offset tracking
  • Extracted data: session ID, session name, repository, context utilization + token counts, turn count, version
  • CWD via lsof (macOS) or /proc/pid/cwd (Linux)
  • Model read from ~/.copilot/settings.json
  • Status detection: Thinking / Executing / Waiting / Done
  • UI label: ^CP in teal (#2DD4BF), consistent with CC/CD label scheme
  • Integrated into MultiCollector; can be disabled with --hide copilot
  • 16 unit tests, all pass; cargo clippy clean

- New CopilotCollector in src/collector/copilot.rs
- Discovers copilot processes via ps (binary name = copilot, path contains copilot-cli)
- Maps each PID to its log file: ~/.copilot/logs/process-{ts}-{pid}.log
- Parses log incrementally for session ID, version, session name, repository,
  context utilization (CompactionProcessor lines), and turn count
- Gets CWD via lsof (macOS) or /proc/{pid}/cwd (Linux)
- Reads model from ~/.copilot/settings.json
- Status detection: Thinking (model generating) / Executing (active children) / Waiting / Done
- UI: agent label '^CP' in teal (#2DD4BF), consistent with CC/CD label scheme
- MultiCollector: copilot collector registered alongside claude and codex
- All 16 unit tests pass; supports --hidden copilot to disable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lifejwang11
Copy link
Copy Markdown
Author

@graykode

@lifejwang11
Copy link
Copy Markdown
Author

image

@graykode graykode marked this pull request as draft May 9, 2026 09:04
@graykode
Copy link
Copy Markdown
Owner

graykode commented May 9, 2026

@lifejwang11 Thanks for the PR. I moved this back to draft for now because Copilot CLI support is not planned for core yet.

I linked it in #45, where we are deciding the broader agent coverage strategy. I will keep this pending until that direction is settled.

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.

2 participants