kovence-cli 0.0.0-stage → 1.0.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +101 -2
- package/SECURITY.md +13 -0
- package/nd.js +700 -0
- package/package.json +55 -5
- package/providers.js +530 -0
- package/src/agent/history.js +157 -0
- package/src/agent/project_context.js +136 -0
- package/src/agent/resilience.js +100 -0
- package/src/agent/turn.js +782 -0
- package/src/cli/args.js +171 -0
- package/src/cli/sinks.js +326 -0
- package/src/commands/handlers.js +1280 -0
- package/src/config/memory.js +175 -0
- package/src/config/model_registry.js +123 -0
- package/src/config/paths.js +268 -0
- package/src/config/providers.js +209 -0
- package/src/config/sessions.js +201 -0
- package/src/permissions/engine.js +846 -0
- package/src/permissions/store.js +113 -0
- package/src/settings/schema.js +340 -0
- package/src/settings/store.js +136 -0
- package/src/tools/checkpoints.js +108 -0
- package/src/tools/download.js +513 -0
- package/src/tools/exec.js +155 -0
- package/src/tools/fs_walk.js +165 -0
- package/src/tools/net.js +467 -0
- package/src/tools/patch_git.js +205 -0
- package/src/tools/sudo.js +212 -0
- package/src/tools/tasks.js +127 -0
- package/src/tui/settings_panel.js +223 -0
- package/src/tui/text_width.js +218 -0
- package/src/tui/themes.js +143 -0
- package/store.js +107 -0
- package/tools.js +1267 -0
- package/tui.js +1634 -0
- package/ui.js +394 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-11-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Zero-dependency multi-step AI coding-agent CLI (`kovence` / `kovence-cli`).
|
|
12
|
+
- Support for OpenAI-compatible and Anthropic API providers with retry/backoff, custom provider wizard (`/api add`), and `apiKeyEnv` isolation.
|
|
13
|
+
- Interactive full-screen TUI (`KovenceTUI`) with amber/dark/light/terminal themes, `@file` fuzzy picker, `@file:L10-50` line ranges, `!cmd` shell escape, and persistent input history.
|
|
14
|
+
- Permission engine with `default`, `accept-edits`, `plan`, and `auto` modes, plus interactive `Manage Permissions` panel inside `/settings`.
|
|
15
|
+
- Ephemeral `SUDO_ASKPASS` handling, resumable Range downloads with SHA-256 verification, file checkpoints with `/undo`, background tasks (`/tasks`), and `kovence doctor`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kovence
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Kovence CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zero-dependency multi-step AI coding-agent CLI for Node.js (`>= 20.12.0`).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g kovence-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run directly from the repository:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node nd.js --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
1. Launch interactive TUI:
|
|
20
|
+
```bash
|
|
21
|
+
kovence
|
|
22
|
+
```
|
|
23
|
+
2. Add your AI provider and models inside the CLI using `/api add` (or `/models` -> `+ Add Custom Provider`).
|
|
24
|
+
- Supports **OpenAI-compatible** and **Anthropic** endpoints.
|
|
25
|
+
- For better secret hygiene, use `apiKeyEnv` (e.g. `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`) so the raw key is resolved from your environment instead of written to `~/.config/kovence/providers.json`.
|
|
26
|
+
3. Run diagnostics anytime:
|
|
27
|
+
```bash
|
|
28
|
+
kovence doctor
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Permission Modes
|
|
32
|
+
|
|
33
|
+
Switch modes with `/mode` or `Shift+Tab`:
|
|
34
|
+
|
|
35
|
+
| Mode | Behavior |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `default` | Confirms file edits, downloads, and shell commands per policy |
|
|
38
|
+
| `accept-edits` | Auto-approves workspace file edits; confirms commands and downloads |
|
|
39
|
+
| `plan` | Read-only research & planning mode; all mutating tools and non-readonly commands blocked |
|
|
40
|
+
| `auto` | Autonomous execution without tool-approval prompts |
|
|
41
|
+
|
|
42
|
+
## CLI Flags
|
|
43
|
+
|
|
44
|
+
| Flag | Description |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `--provider <name>` | Use configured OpenAI/Anthropic provider |
|
|
47
|
+
| `-m, --model <name>` | Override active model |
|
|
48
|
+
| `-p, --prompt <text>` | Non-interactive headless prompt |
|
|
49
|
+
| `-s, --system <text>` | Override system prompt |
|
|
50
|
+
| `--mode <mode>` | Agent mode: `default \| accept-edits \| plan \| auto` |
|
|
51
|
+
| `-a, --auto` | Alias for `--mode auto` |
|
|
52
|
+
| `--add-dir <path>` | Grant workspace access to an extra directory (repeatable) |
|
|
53
|
+
| `--no-tools` | Disable tool calling (chat only) |
|
|
54
|
+
| `--no-summary` | Skip post-response session memory summarization |
|
|
55
|
+
| `--plain` | Use plain scrollback REPL instead of full-screen TUI |
|
|
56
|
+
| `--json` | Emit structured JSON result in `-p` headless mode |
|
|
57
|
+
| `--no-session` | Run without persisting session history to disk |
|
|
58
|
+
| `--debug` | Enable verbose debug tracing |
|
|
59
|
+
| `-t, --temp <num>` | Sampling temperature (`0.0` to `2.0`) |
|
|
60
|
+
| `--max-tokens <num>` | Max completion tokens |
|
|
61
|
+
| `--session <name>` | Resume/use a specific saved session |
|
|
62
|
+
| `-c, --continue` | Resume the most recent session |
|
|
63
|
+
| `--new-session <name>` | Start a fresh session with given name |
|
|
64
|
+
| `-v, --version` | Show version |
|
|
65
|
+
| `-h, --help` | Show help |
|
|
66
|
+
| `doctor` | Subcommand: check Node, tools, config, and provider reachability |
|
|
67
|
+
|
|
68
|
+
## Slash Commands
|
|
69
|
+
|
|
70
|
+
| Command | Description |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `/help` | Show all commands |
|
|
73
|
+
| `/mode` | Switch agent mode (`default\|accept-edits\|plan\|auto`) |
|
|
74
|
+
| `/settings` | Open interactive Settings panel (`Ctrl+,`) |
|
|
75
|
+
| `/set` | Update persisted setting (`/set <key> <val>`) |
|
|
76
|
+
| `/api` | Switch/add OpenAI or Anthropic custom APIs |
|
|
77
|
+
| `/model` | Pick or switch active model (`/model [name]`) |
|
|
78
|
+
| `/sessions` | Session picker / manage (`list\|new\|switch\|delete`) (`Ctrl+S`) |
|
|
79
|
+
| `/new` | Open a new isolated session (`Ctrl+N`) |
|
|
80
|
+
| `/retry` | Retry the last failed/aborted user turn |
|
|
81
|
+
| `/history` | Show session chat history |
|
|
82
|
+
| `/memory` | Show/manage session & global memory |
|
|
83
|
+
| `/todos` | Show current session multi-step todos |
|
|
84
|
+
| `/compact` | Compact history into session summary |
|
|
85
|
+
| `/stats` | Show full context size, speed & token stats |
|
|
86
|
+
| `/copy` | Copy last AI response to clipboard (`Ctrl+Y`) |
|
|
87
|
+
| `/select` | Toggle native terminal mouse select mode (`F2`) |
|
|
88
|
+
| `/save` | Rename/save current session |
|
|
89
|
+
| `/rename` | Rename current session |
|
|
90
|
+
| `/fork` | Fork current session into a new branch |
|
|
91
|
+
| `/export` | Export session transcript (`md\|json`) |
|
|
92
|
+
| `/edit-last` | Pop last turn and restore prompt for editing |
|
|
93
|
+
| `/undo` | Rollback the last file edit/write/delete checkpoint |
|
|
94
|
+
| `/init` | Scan project & generate `KOVENCE.md` instructions |
|
|
95
|
+
| `/tasks` | List, view logs, or stop background shell tasks |
|
|
96
|
+
| `/cost` | Show estimated session token cost in USD |
|
|
97
|
+
| `/clear` | Clear current session history & memory |
|
|
98
|
+
| `/exit` | Exit Kovence CLI |
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in `kovence-cli`, please do **not** open a public issue with exploit details. Instead, report it privately to the maintainers with reproduction steps, affected versions, and impact assessment.
|
|
6
|
+
|
|
7
|
+
## Security Model Notes
|
|
8
|
+
|
|
9
|
+
- **API Keys**: Prefer storing API keys via `apiKeyEnv` (environment variable name) rather than plaintext in `~/.config/kovence/providers.json`. Provider config files are written with `0600` permissions.
|
|
10
|
+
- **Permission Modes**:
|
|
11
|
+
- `default`, `accept-edits`, and `plan` enforce interactive confirmation and workspace boundaries for mutating actions.
|
|
12
|
+
- `auto` mode is designed for autonomous execution without tool-approval prompts.
|
|
13
|
+
- **Sudo Handling**: Interactive `sudo` prompts use an ephemeral `SUDO_ASKPASS` helper (`0700` dir / `0600` script) cleaned up on exit.
|