@doyuli/cogagent 0.0.0-stage → 0.1.1
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 +45 -2
- package/bin/index.js +2 -0
- package/dist/index.mjs +1 -0
- package/package.json +74 -3
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CogAgent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A terminal AI agent built on the [Vercel AI SDK](https://ai-sdk.dev/).
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install dependencies
|
|
9
|
+
pnpm install
|
|
10
|
+
|
|
11
|
+
# Set up configuration
|
|
12
|
+
cp .env.example .env
|
|
13
|
+
# Edit .env and fill in provider credentials.
|
|
14
|
+
# The first run creates settings.json and models.json.
|
|
15
|
+
|
|
16
|
+
# Start the TUI
|
|
17
|
+
pnpm start
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Configuration
|
|
21
|
+
|
|
22
|
+
Runtime configuration lives under `~/.cogagent/v1/`:
|
|
23
|
+
|
|
24
|
+
- `settings.json` contains provider credentials, the optional default model, the default reasoning level, and search credentials.
|
|
25
|
+
- `models.json` contains provider endpoints, model context windows, and provider-specific reasoning mappings.
|
|
26
|
+
|
|
27
|
+
Credentials in `settings.json` can reference environment variables such as `DEEPSEEK_API_KEY`, `QWEN_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`, `XAI_API_KEY`, `ZAI_API_KEY`, `MOONSHOT_API_KEY`, `TAVILY_API_KEY`, and `SERPER_API_KEY`.
|
|
28
|
+
|
|
29
|
+
Model resolution: when `defaults.model` is set it wins (the model must exist in `models.json` and its provider needs an `apiKey`); otherwise the first model of the first provider that has an `apiKey` is used. If no provider has an `apiKey`, startup fails with an error.
|
|
30
|
+
|
|
31
|
+
To run without any credentials, start with the mock model:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm start --mock
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
| Command | Description |
|
|
40
|
+
| ---------------- | ------------------------------------------- |
|
|
41
|
+
| `pnpm dev` | Development build watcher (tsdown --watch) |
|
|
42
|
+
| `pnpm start` | Run the TUI (`-c` resumes the last session) |
|
|
43
|
+
| `pnpm build` | Build the project (tsdown) |
|
|
44
|
+
| `pnpm lint` | Lint |
|
|
45
|
+
| `pnpm lint:fix` | Lint and auto-fix |
|
|
46
|
+
| `pnpm typecheck` | Type check |
|
package/bin/index.js
ADDED