Skip to content

Commit 55839cb

Browse files
Merge pull request #2 from danielmeppiel/integrate-copilot-runtime
Integrate copilot runtime
2 parents 8d23abc + dcab2d2 commit 55839cb

24 files changed

+1593
-55
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.2] - 2025-09-25
9+
10+
- Copilot CLI Support
11+
812
## [0.4.1] - 2025-09-18
913

1014
### Fixed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,20 @@
2626

2727
> [!NOTE]
2828
> **📋 Prerequisites**: Get tokens at [github.com/settings/personal-access-tokens/new](https://github.com/settings/personal-access-tokens/new)
29-
> - **`GITHUB_APM_PAT`** - Fine-grained PAT for access to private APM modules (optional, recommended)
30-
> - **`GITHUB_TOKEN`** - User-scoped fine-grained PAT with read Models scope for GitHub Models API (optional, enables free GitHub Models access with Codex CLI and llm)
29+
> - **`GITHUB_COPILOT_PAT`** - User-scoped Fine-grained PAT with Copilot CLI subscription access
30+
> - **`GITHUB_APM_PAT`** - (optional) - Fine-grained PAT for access to private APM modules
3131
>
3232
> 📖 **Complete Setup Guide**: [Getting Started](docs/getting-started.md)
3333
3434
```bash
35-
# 1. Set your GitHub tokens (minimal setup)
36-
export GITHUB_APM_PAT=your_fine_grained_token_here
37-
export GITHUB_TOKEN=your_token_for_github_models
35+
# 1. Set your GitHub token (minimal setup)
36+
export GITHUB_COPILOT_PAT=your_fine_grained_token_here
3837

39-
# 2. Install APM CLI (GitHub org members)
38+
# 2. Install APM CLI
4039
curl -sSL "https://raw.githubusercontent.com/danielmeppiel/apm/main/install.sh" | sh
4140

42-
# 3. Set up runtime (uses free GitHub Models)
43-
apm runtime setup codex
41+
# 3. Set up runtime (GitHub Copilot CLI with native MCP support)
42+
apm runtime setup copilot
4443

4544
# 3. Create your first AI package
4645
apm init my-project && cd my-project
@@ -73,7 +72,7 @@ dependencies:
7372
- microsoft/azure-devops-mcp
7473

7574
scripts:
76-
start: "RUST_LOG=debug codex --skip-git-repo-check hello-world.prompt.md"
75+
start: "copilot --full-auto -p hello-world.prompt.md"
7776
```
7877
7978
## What You Just Built
@@ -93,7 +92,7 @@ APM solves the AI agent context scalability problem through constraint satisfact
9392

9493
```bash
9594
apm init <project> # Initialize AI-native project
96-
apm runtime setup # Install coding agents (codex for now)
95+
apm runtime setup # Install coding agents (copilot recommended)
9796
apm compile # Generate AGENTS.md for compatibility
9897
apm install # Install APM and MCP dependencies from apm.yml
9998
apm deps list # List installed APM dependencies

docs/cli-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export GITHUB_APM_PAT=your_fine_grained_token_here
1313
curl -sSL https://raw.githubusercontent.com/danielmeppiel/apm/main/install.sh | sh
1414

1515
# 3. Setup runtime
16-
apm runtime setup codex
16+
apm runtime setup copilot
1717

1818
# 4. Create project
1919
apm init my-project && cd my-project
@@ -717,7 +717,7 @@ apm list
717717

718718
## Tips & Best Practices
719719

720-
1. **Start with runtime setup**: Run `apm runtime setup codex`
720+
1. **Start with runtime setup**: Run `apm runtime setup copilot`
721721
2. **Use GitHub Models for free tier**: Set `GITHUB_TOKEN` (user-scoped with Models read permission) for free Codex access
722722
3. **Discover MCP servers**: Use `apm search` to find available MCP servers before adding to apm.yml
723723
4. **Preview before running**: Use `apm preview` to check parameter substitution

docs/getting-started.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ Welcome to APM - the AI Package Manager that transforms any project into reliabl
88

99
APM requires GitHub tokens for accessing models and package registries. Get your tokens at [github.com/settings/personal-access-tokens/new](https://github.com/settings/personal-access-tokens/new):
1010

11-
### GitHub Tokens Required
12-
13-
APM requires GitHub tokens for accessing models and package registries. Get your tokens at [github.com/settings/personal-access-tokens/new](https://github.com/settings/personal-access-tokens/new):
14-
1511
#### Required Tokens
1612

1713
##### GITHUB_APM_PAT (Fine-grained PAT - Recommended)
@@ -178,7 +174,15 @@ This creates a platform-specific binary at `./dist/apm-{platform}-{arch}/apm` th
178174

179175
APM works with multiple AI coding agents. Choose your preferred runtime:
180176

181-
### OpenAI Codex CLI (Recommended)
177+
### GitHub Copilot CLI (Recommended)
178+
179+
```bash
180+
apm runtime setup copilot
181+
```
182+
183+
Uses GitHub Copilot CLI with native MCP integration and advanced AI coding assistance.
184+
185+
### OpenAI Codex CLI
182186

183187
```bash
184188
apm runtime setup codex

docs/integration-testing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ All integration tests run on:
151151

152152
### E2E Tests Verify:
153153
- ✅ Complete golden scenario from README works
154+
-`apm runtime setup copilot` installs and configures GitHub Copilot CLI
154155
-`apm runtime setup codex` installs and configures Codex
155156
-`apm runtime setup llm` installs and configures LLM
156157
-`apm init my-hello-world` creates project correctly

docs/integrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Direct integration with OpenAI's development-focused models:
5353

5454
```bash
5555
# Install and configure
56-
apm runtime setup codex
56+
apm runtime setup copilot
5757

5858
# Features
5959
- GitHub Models API backend

docs/runtime-integration.md

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ APM manages LLM runtime installation and configuration automatically. This guide
44

55
## Overview
66

7-
APM acts as a runtime package manager, downloading and configuring LLM runtimes from their official sources. Currently supports two runtimes:
7+
APM acts as a runtime package manager, downloading and configuring LLM runtimes from their official sources. Currently supports three runtimes:
88

99
| Runtime | Description | Best For | Configuration |
1010
|---------|-------------|----------|---------------|
11-
| [**OpenAI Codex**](https://github.com/openai/codex) | OpenAI's Codex CLI | Code tasks, MCP support | Auto-configured with GitHub Models |
11+
| [**GitHub Copilot CLI**](https://github.com/github/copilot-cli) | GitHub's Copilot CLI (Recommended) | Advanced AI coding, native MCP support | Auto-configured, no auth needed |
12+
| [**OpenAI Codex**](https://github.com/openai/codex) | OpenAI's Codex CLI | Code tasks, GitHub Models API | Auto-configured with GitHub Models |
1213
| [**LLM Library**](https://llm.datasette.io/en/stable/index.html) | Simon Willison's `llm` CLI | General use, many providers | Manual API key setup |
1314

1415
## Quick Setup
@@ -19,20 +20,52 @@ APM acts as a runtime package manager, downloading and configuring LLM runtimes
1920
curl -sSL https://raw.githubusercontent.com/danielmeppiel/apm/main/install.sh | sh
2021

2122
# 2. Setup AI runtime (downloads and configures automatically)
22-
apm runtime setup codex
23-
24-
# 3. Set GitHub token for free models (fine-grained token preferred)
25-
export GITHUB_TOKEN=your_github_token
23+
apm runtime setup copilot
2624
```
2725

2826
### Runtime Management
2927
```bash
3028
apm runtime list # Show installed runtimes
3129
apm runtime setup llm # Install LLM library
30+
apm runtime setup copilot # Install GitHub Copilot CLI (Recommended)
3231
apm runtime setup codex # Install Codex CLI
3332
```
3433

35-
## OpenAI Codex Runtime (Recommended)
34+
## GitHub Copilot CLI Runtime (Recommended)
35+
36+
APM automatically installs GitHub Copilot CLI from the public npm registry. Copilot CLI provides advanced AI coding assistance with native MCP integration and GitHub context awareness.
37+
38+
### Setup
39+
40+
#### 1. Install via APM
41+
```bash
42+
apm runtime setup copilot
43+
```
44+
45+
This automatically:
46+
- Installs GitHub Copilot CLI from public npm registry
47+
- Requires Node.js v22+ and npm v10+
48+
- Creates MCP configuration directory at `~/.copilot/`
49+
- No authentication required for installation
50+
51+
### Usage
52+
53+
APM executes scripts defined in your `apm.yml`. When scripts reference `.prompt.md` files, APM compiles them with parameter substitution. See [Prompts Guide](prompts.md) for details.
54+
55+
```bash
56+
# Run scripts (from apm.yml) with parameters
57+
apm run start --param service_name=api-gateway
58+
apm run debug --param service_name=api-gateway
59+
```
60+
61+
**Script Configuration (apm.yml):**
62+
```yaml
63+
scripts:
64+
start: "copilot --full-auto -p analyze-logs.prompt.md"
65+
debug: "copilot --full-auto -p analyze-logs.prompt.md --log-level debug"
66+
```
67+
68+
## OpenAI Codex Runtime
3669
3770
APM automatically downloads, installs, and configures the Codex CLI with GitHub Models for free usage.
3871
@@ -57,8 +90,6 @@ export GITHUB_TOKEN=your_github_token
5790

5891
### Usage
5992

60-
APM executes scripts defined in your `apm.yml`. When scripts reference `.prompt.md` files, APM compiles them with parameter substitution. See [Prompts Guide](prompts.md) for details.
61-
6293
```bash
6394
# Run scripts (from apm.yml) with parameters
6495
apm run start --param service_name=api-gateway
@@ -122,15 +153,23 @@ scripts:
122153
```bash
123154
# Run scripts defined in apm.yml
124155
apm run start --param service_name=api-gateway
125-
apm run llm --param service_name=api-gateway
156+
apm run copilot-analysis --param service_name=api-gateway
126157
apm run debug --param service_name=api-gateway
127158
```
128159

129-
### Code Analysis
160+
### Code Analysis with Copilot CLI
130161
```bash
131-
# Scripts that use Codex for code understanding
162+
# Scripts that use Copilot CLI for advanced code understanding
132163
apm run code-review --param pull_request=123
133164
apm run analyze-code --param file_path="src/main.py"
165+
apm run refactor --param component="UserService"
166+
```
167+
168+
### Code Analysis with Codex
169+
```bash
170+
# Scripts that use Codex for code understanding
171+
apm run codex-review --param pull_request=123
172+
apm run codex-analyze --param file_path="src/main.py"
134173
```
135174

136175
### Documentation Tasks
@@ -145,17 +184,22 @@ apm run summarize --param report_type="weekly"
145184
**"Runtime not found"**
146185
```bash
147186
# Install missing runtime
187+
apm runtime setup copilot # Recommended
148188
apm runtime setup codex
149189
apm runtime setup llm
150190

151191
# Check installed runtimes
152192
apm runtime list
153193
```
154194

155-
**"No GitHub token"**
195+
**"Command not found: copilot"**
156196
```bash
157-
# Set GitHub token for free models
158-
export GITHUB_TOKEN=your_github_token
197+
# Ensure Node.js v22+ and npm v10+ are installed
198+
node --version # Should be v22+
199+
npm --version # Should be v10+
200+
201+
# Reinstall Copilot CLI
202+
apm runtime setup copilot
159203
```
160204

161205
**"Command not found: codex"**

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "apm-cli"
7-
version = "0.4.1"
7+
version = "0.4.2"
88
description = "MCP configuration tool"
99
readme = "README.md"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)