Skip to content

Commit e935d0d

Browse files
committed
docs: Update CLI documentation for new streaming emulation option
1 parent 63040d6 commit e935d0d

File tree

2 files changed

+47
-25
lines changed

2 files changed

+47
-25
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@ Runs the server in production mode with optimizations enabled and hot reloading
4040

4141
The server accepts several command line options:
4242

43-
| Option | Description | Default |
44-
|-------------|-------------------------------------------------|---------|
45-
| --help, -h | Show help message | false |
46-
| --stream | Enable streaming response (default) | true |
47-
| --no-stream | Disable streaming response | |
48-
| --port, -p | Port to listen on | 4141 |
43+
| Option | Description | Default |
44+
|--------------------|-------------------------------------------------|---------|
45+
| --help, -h | Show help message | false |
46+
| --emulate-streaming| Enable streaming response emulation | false |
47+
| --port, -p | Port to listen on | 4141 |
4948

5049
Example with options:
5150
```sh
52-
bun run start --port 8080 --no-stream
51+
bun run start --port 8080 --emulate-streaming
5352
```
5453

5554
In all cases, the server will start and listen for API requests on the specified port.

docs/cli.md

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,63 @@
11
# Command Line Interface
22

3-
The Copilot API provides a command-line interface with various configuration options.
3+
The Copilot API provides a command-line interface powered by `citty`.
44

5-
## Usage
5+
## Name and Description
66

7-
```bash
8-
copilot-api [options]
7+
```
8+
Name: copilot-api
9+
Description: A wrapper around GitHub Copilot API to make it OpenAI compatible, making it usable for other tools.
910
```
1011

1112
## Options
1213

13-
| Option | Alias | Description | Default |
14-
|-------------|-------|-------------------------------------------------|---------|
15-
| --help | -h | Show help message | false |
16-
| --stream | -s | Enable streaming response for chat completions | true |
17-
| --no-stream | | Disable streaming response | |
18-
| --port | -p | Port to listen on | 4141 |
14+
| Option | Description | Type | Default |
15+
|--------------------|--------------------------------------------------|-----------|---------|
16+
| --help, -h | Display help information | boolean | false |
17+
| --emulate-streaming| Emulate streaming response for chat completions | boolean | false |
18+
| --port, -p | Port number to listen on | string | "4141" |
19+
20+
## Environment Variables
21+
22+
The following environment variables are required:
23+
24+
- `GITHUB_CLIENT_ID`: GitHub OAuth client ID
25+
- `GITHUB_OAUTH_SCOPES`: Required OAuth scopes for GitHub
26+
27+
Optional environment variables:
28+
- `EMULATE_STREAMING`: Alternative way to enable streaming emulation
1929

2030
## Examples
2131

22-
Start server on default port:
32+
Start server with default settings:
2333
```bash
24-
copilot-api
34+
bun run start
2535
```
2636

27-
Start server with streaming enabled:
37+
Start with streaming emulation:
2838
```bash
29-
copilot-api --stream
39+
bun run start --emulate-streaming
3040
```
3141

32-
Start server on custom port:
42+
Start on a custom port:
3343
```bash
34-
copilot-api --port 8080
44+
bun run start --port 8080
3545
```
3646

37-
Show help message:
47+
Display help:
3848
```bash
39-
copilot-api --help
49+
bun run start --help
4050
```
51+
52+
## Development Mode
53+
54+
Run in development mode with hot reloading:
55+
```bash
56+
bun run dev
57+
```
58+
59+
## Notes
60+
61+
- The server will print available models on startup
62+
- Authentication tokens are automatically refreshed (every 8 hours for GitHub token)
63+
- Streaming emulation can be enabled via CLI flag or environment variable

0 commit comments

Comments
 (0)