@lioneltay/claude-pilot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # Claude Pilot
2
+
3
+ Run [Claude Code](https://docs.anthropic.com/en/docs/claude-code) through GitHub Copilot's API.
4
+
5
+ ## Prerequisites
6
+
7
+ ### 1. GitHub Copilot Subscription
8
+
9
+ You need an active GitHub Copilot subscription (Individual, Business, or Enterprise).
10
+
11
+ ### 2. Copilot CLI
12
+
13
+ Install the GitHub Copilot CLI:
14
+
15
+ ```bash
16
+ npm install -g @github/copilot
17
+
18
+ # Verify installation
19
+ copilot --version
20
+ ```
21
+
22
+ ### 3. Claude Code
23
+
24
+ Install the Claude Code CLI:
25
+
26
+ ```bash
27
+ curl -fsSL https://claude.ai/install.sh | bash
28
+
29
+ # Verify installation
30
+ claude --version
31
+ ```
32
+
33
+ See [Claude Code setup docs](https://code.claude.com/docs/en/setup) for more details.
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm install -g @lioneltay/claude-pilot
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ```bash
44
+ # 1. Authenticate with GitHub Copilot
45
+ claude-pilot login
46
+
47
+ # 2. Run Claude Code (proxy starts automatically)
48
+ claude-pilot
49
+ ```
50
+
51
+ ## Features
52
+
53
+ - **Web Search** - Works via Copilot CLI at no extra cost
54
+ - **Cost Optimization** - Tool continuations are free, only new user messages are charged (~$0.04)
55
+ - **Free Suggestions** - Autocomplete requests routed to GPT-4.1 (free model)
56
+ - **Auto Token Refresh** - Copilot tokens refresh automatically before expiry
57
+ - **Dashboard** - Web-based log viewer at `http://localhost:51080/`
58
+ - **Zero Config** - Proxy auto-starts and finds an available port
59
+
60
+ ## Commands
61
+
62
+ ### `claude-pilot`
63
+
64
+ Run Claude Code with the proxy. If no arguments are provided, launches Claude Code interactively. Any arguments are passed through to Claude.
65
+
66
+ ```bash
67
+ # Interactive mode
68
+ claude-pilot
69
+
70
+ # Pass arguments to claude
71
+ claude-pilot --help
72
+ claude-pilot "explain this codebase"
73
+ ```
74
+
75
+ The proxy starts automatically if not already running.
76
+
77
+ ### `claude-pilot login`
78
+
79
+ Authenticate with GitHub Copilot using the device flow.
80
+
81
+ ```bash
82
+ claude-pilot login
83
+ ```
84
+
85
+ This will:
86
+
87
+ 1. Display a code and URL
88
+ 2. Open GitHub in your browser
89
+ 3. Enter the code to authorize
90
+ 4. Save credentials to `~/.config/claude-pilot/auth.json`
91
+
92
+ ### `claude-pilot logout`
93
+
94
+ Clear credentials and stop the proxy.
95
+
96
+ ```bash
97
+ claude-pilot logout
98
+ ```
99
+
100
+ ### `claude-pilot start`
101
+
102
+ Start the proxy server in the background.
103
+
104
+ ```bash
105
+ claude-pilot start
106
+ claude-pilot start -p 8080 # Custom port
107
+ ```
108
+
109
+ ### `claude-pilot stop`
110
+
111
+ Stop the running proxy server.
112
+
113
+ ```bash
114
+ claude-pilot stop
115
+ ```
116
+
117
+ ### `claude-pilot status`
118
+
119
+ Show proxy status and authentication state.
120
+
121
+ ```bash
122
+ claude-pilot status
123
+ ```
124
+
125
+ ### `claude-pilot dashboard`
126
+
127
+ Open the log viewer dashboard in your browser.
128
+
129
+ ```bash
130
+ claude-pilot dashboard
131
+ ```
132
+
133
+ ## Configuration
134
+
135
+ All configuration is stored in `~/.config/claude-pilot/`:
136
+
137
+ | File | Description |
138
+ | ---------------- | ------------------------------- |
139
+ | `auth.json` | GitHub and Copilot tokens |
140
+ | `daemon.json` | Running proxy state (PID, port) |
141
+ | `server.log` | Proxy server logs |
142
+ | `requests.jsonl` | Request/response logs |
143
+
144
+ ## How It Works
145
+
146
+ Claude Pilot runs a local proxy that:
147
+
148
+ 1. Receives requests from Claude Code in Anthropic's Messages API format
149
+ 2. Transforms them to OpenAI's Chat Completions format
150
+ 3. Forwards to GitHub Copilot's API
151
+ 4. Transforms responses back to Anthropic format
152
+
153
+ This allows Claude Code to work with your existing GitHub Copilot subscription.
154
+
155
+ ## Troubleshooting
156
+
157
+ ### "Copilot CLI not found"
158
+
159
+ Make sure the Copilot CLI is installed and in your PATH:
160
+
161
+ ```bash
162
+ copilot --version
163
+ ```
164
+
165
+ If not installed, see [Prerequisites](#2-copilot-cli).
166
+
167
+ ### "Claude CLI not found"
168
+
169
+ Make sure Claude Code is installed:
170
+
171
+ ```bash
172
+ claude --version
173
+ ```
174
+
175
+ If not installed, see [Prerequisites](#3-claude-code).
176
+
177
+ ### "Token expired"
178
+
179
+ Re-authenticate:
180
+
181
+ ```bash
182
+ claude-pilot login
183
+ ```
184
+
185
+ ### Check logs
186
+
187
+ ```bash
188
+ # Server logs
189
+ cat ~/.config/claude-pilot/server.log
190
+
191
+ # Request logs
192
+ cat ~/.config/claude-pilot/requests.jsonl | jq .
193
+ ```
194
+
195
+ ## License
196
+
197
+ MIT