Skip to content

Commit 28dabd2

Browse files
committed
docs: Improve README with command line options and source instructions
1 parent 34dcb18 commit 28dabd2

2 files changed

Lines changed: 16 additions & 39 deletions

File tree

README.md

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,34 @@ With options:
3838
npx copilot-api --port 8080
3939
```
4040

41-
## Running from Source
42-
43-
The project can be run from source in several ways:
44-
45-
### Development Mode
46-
47-
```sh
48-
bun run dev
49-
```
50-
51-
Starts the server with hot reloading enabled, which automatically restarts the server when code changes are detected. This is ideal for development.
52-
53-
### Production Mode
54-
55-
```sh
56-
bun run start
57-
```
41+
## Command Line Options
5842

59-
Runs the server in production mode with hot reloading disabled. Use this for deployment or production environments.
60-
61-
### Command Line Options
62-
63-
The server accepts several command line options:
43+
The command accepts several command line options:
6444

6545
| Option | Description | Default |
6646
| ------------- | ------------------------------------ | ------- |
6747
| --port, -p | Port to listen on | 4141 |
6848
| --verbose, -v | Enable verbose logging | false |
6949
| --log-file | File to log request/response details | - |
7050

71-
Note: The `--help, -h` option is automatically available through the underlying command-line framework.
72-
7351
Example with options:
7452

7553
```sh
76-
bun run start --port 8080 --verbose
54+
npx copilot-api@latest --port 8080 --verbose --log-file copilot-api.txt
7755
```
7856

79-
In all cases, the server will start and listen for API requests on the specified port.
57+
## Running from Source
8058

81-
## Tested Tools Compatibility
59+
The project can be run from source in several ways:
8260

83-
| Tool | Status | Notes |
84-
| ---------------------------------------------------------------- | ------ | --------------------------------------------------------------------- |
85-
| [Aider](https://github.com/Aider-AI/aider) | Full | Fully compatible |
86-
| [bolt.diy](https://github.com/stackblitz-labs/bolt.diy) | Full | Fully compatible; use any random API key in UI if models fail to load |
87-
| [Page Assist](https://github.com/n4ze3m/page-assist) | Full | Fully compatible |
88-
| [Kobold AI Lite](https://github.com/LostRuins/lite.koboldai.net) | Full | Fully compatible |
61+
### Development Mode
8962

90-
**Note:** In general, any application that uses the standard OpenAI-compatible `/chat/completions` and `/models` endpoints should work with this API.
63+
```sh
64+
bun run dev
65+
```
66+
67+
### Production Mode
68+
69+
```sh
70+
bun run start
71+
```

src/services/api-instance.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ export const copilot = ofetch.create({
2222

2323
onRequestError({ error, options }) {
2424
if (error instanceof FetchError) {
25-
consola.error(
26-
// eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/restrict-template-expressions
27-
`Request failed: ${options.body} \n ${error}`,
28-
)
25+
consola.error(`Request failed: ${options.body} \n ${error}`)
2926
}
3027
},
3128

3229
onResponse({ response }) {
3330
if (response.url.endsWith("/models") && response._data) {
34-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
3531
modelsCache.setModels(response._data)
3632
}
3733
},

0 commit comments

Comments
 (0)