@knightcodeai/cli-linux-x64 0.9.1 → 0.9.2
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/bin/CHANGELOG.md +50 -0
- package/bin/README.md +52 -19
- package/bin/docs/cli-integration.md +106 -0
- package/bin/docs/cli.md +270 -0
- package/bin/docs/compaction.md +56 -37
- package/bin/docs/configuration.md +46 -0
- package/bin/docs/containerization.md +86 -54
- package/bin/docs/custom-provider.md +132 -785
- package/bin/docs/docs.json +143 -103
- package/bin/docs/environment-variables.md +5 -4
- package/bin/docs/extensions.md +134 -2956
- package/bin/docs/how-knightcode-works.md +49 -0
- package/bin/docs/index.md +24 -69
- package/bin/docs/json.md +193 -65
- package/bin/docs/keybindings.md +56 -101
- package/bin/docs/llama-cpp.md +3 -3
- package/bin/docs/message-types.md +261 -0
- package/bin/docs/models.md +64 -547
- package/bin/docs/packages.md +66 -167
- package/bin/docs/prompt-templates.md +31 -68
- package/bin/docs/providers.md +103 -241
- package/bin/docs/quickstart.md +61 -106
- package/bin/docs/rpc-commands.md +854 -0
- package/bin/docs/rpc-extension-ui.md +200 -0
- package/bin/docs/rpc.md +129 -1556
- package/bin/docs/sdk.md +76 -1160
- package/bin/docs/security.md +70 -32
- package/bin/docs/session-format.md +25 -216
- package/bin/docs/sessions.md +38 -143
- package/bin/docs/settings.md +111 -389
- package/bin/docs/shell-aliases.md +85 -5
- package/bin/docs/skills.md +51 -189
- package/bin/docs/slash-commands.md +63 -0
- package/bin/docs/terminal-setup.md +107 -79
- package/bin/docs/termux.md +74 -83
- package/bin/docs/themes.md +68 -280
- package/bin/docs/tmux.md +31 -39
- package/bin/docs/tui.md +69 -923
- package/bin/docs/usage.md +79 -286
- package/bin/docs/windows.md +43 -17
- package/bin/export-html/template.js +6 -1
- package/bin/knightcode +2 -2
- package/bin/package.json +6 -6
- package/package.json +1 -1
- package/bin/docs/development.md +0 -71
package/bin/docs/quickstart.md
CHANGED
|
@@ -1,167 +1,122 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
KnightCode runs in your terminal and works with files on your machine. To use it, you need access to a model through a supported provider. This can be a subscription, an API key, or a local model.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
For native Windows setup, read [Windows Setup](windows.md). For Android, read [Termux Setup](termux.md).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 1. Install KnightCode
|
|
8
|
+
|
|
9
|
+
On macOS or Linux, you can use the installer:
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
|
|
12
|
+
curl -fsSL https://knightcode.dev/install.sh | sh
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Uninstall
|
|
16
|
-
|
|
17
|
-
Use the package manager that installed knightcode. The curl installer uses npm globally, so curl and npm installs are removed with npm:
|
|
15
|
+
Alternatively, install KnightCode from npm. This requires Node.js 22 or newer:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
npm install -g --ignore-scripts @knightcodeai/cli
|
|
19
|
+
```
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
pnpm remove -g @knightcodeai/cli
|
|
21
|
+
KnightCode does not require dependency lifecycle scripts for a normal npm installation.
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
yarn global remove @knightcodeai/cli
|
|
23
|
+
Verify the installation:
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
```bash
|
|
26
|
+
knightcode --version
|
|
31
27
|
```
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
## 2. Start KnightCode
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
Change to the folder you want KnightCode to work with, then start it:
|
|
36
32
|
|
|
37
33
|
```bash
|
|
38
|
-
cd /path/to/
|
|
34
|
+
cd /path/to/folder
|
|
39
35
|
knightcode
|
|
40
36
|
```
|
|
41
37
|
|
|
42
|
-
|
|
38
|
+
The working folder helps KnightCode discover relevant files, instructions, and configuration. KnightCode also uses it to group saved sessions.
|
|
39
|
+
|
|
40
|
+
<p align="center"><img src="images/interactive-mode.png" alt="KnightCode running in a terminal with a conversation, input editor, and status footer" width="750"></p>
|
|
41
|
+
|
|
42
|
+
The interface shows your conversation, an editor for prompts and commands, and a footer with the current folder, model, and session status. See [Use KnightCode in the terminal](usage.md) to learn how to add files, run commands, direct ongoing work, and manage results.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
## 3. Choose a model
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
A **model** generates KnightCode's responses. A **provider** is the service or account KnightCode uses to access that model.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
In KnightCode, run:
|
|
49
49
|
|
|
50
50
|
```text
|
|
51
51
|
/login
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Choose a provider, then follow the prompts to use a subscription or store an API key. Run `/model` afterward if you want to select a different available model.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
## 4. Give KnightCode a task
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
62
|
-
knightcode
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
You can also run `/login` and select an API-key provider to store the key in `~/.knightcode/agent/auth.json`.
|
|
66
|
-
|
|
67
|
-
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
60
|
+
KnightCode shows each file read, search, command, and edit it performs. It does not ask before every tool call.
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Once knightcode starts, type a request and press Enter:
|
|
62
|
+
Enter a task that matches your work, for example:
|
|
72
63
|
|
|
73
64
|
```text
|
|
74
|
-
Summarize
|
|
65
|
+
Summarize @meeting-notes.md and save the action items to action-items.md.
|
|
75
66
|
```
|
|
76
67
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- `read` - read files
|
|
80
|
-
- `write` - create or overwrite files
|
|
81
|
-
- `edit` - patch files
|
|
82
|
-
- `bash` - run shell commands
|
|
83
|
-
|
|
84
|
-
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options. KnightCode runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
|
|
85
|
-
|
|
86
|
-
## Give knightcode project instructions
|
|
87
|
-
|
|
88
|
-
KnightCode loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
89
|
-
|
|
90
|
-
```markdown
|
|
91
|
-
# Project Instructions
|
|
92
|
-
|
|
93
|
-
- Run `npm run check` after code changes.
|
|
94
|
-
- Do not run production migrations locally.
|
|
95
|
-
- Keep responses concise.
|
|
68
|
+
```text
|
|
69
|
+
Explain how this repository is structured and how to run its checks.
|
|
96
70
|
```
|
|
97
71
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
102
|
-
|
|
103
|
-
If a directory contains `AGENTS.override.md`, KnightCode loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory.
|
|
104
|
-
|
|
105
|
-
Restart knightcode, or run `/reload`, after changing context files.
|
|
72
|
+
```text
|
|
73
|
+
Compare @previous.csv with @current.csv and summarize the important changes.
|
|
74
|
+
```
|
|
106
75
|
|
|
107
|
-
|
|
76
|
+
Type `@` in the editor to search for a file instead of entering its full path. When KnightCode finishes, review its response and any changed files. Use version control or backups for important work. For untrusted or unattended work, use a container or another sandbox. See [Security](security.md).
|
|
108
77
|
|
|
109
|
-
|
|
78
|
+
## Continue later
|
|
110
79
|
|
|
111
|
-
|
|
80
|
+
KnightCode saves sessions automatically. Exit KnightCode, then resume the most recent session for the same working folder with:
|
|
112
81
|
|
|
113
82
|
```bash
|
|
114
|
-
knightcode
|
|
115
|
-
knightcode @src/app.ts @src/app.test.ts "Review these together"
|
|
83
|
+
knightcode --continue
|
|
116
84
|
```
|
|
117
85
|
|
|
118
|
-
|
|
86
|
+
Use `/resume` to choose another saved session. See [Continue or branch a session](sessions.md) for session naming, branching, compaction, export, and sharing.
|
|
119
87
|
|
|
120
|
-
|
|
88
|
+
## Next steps
|
|
121
89
|
|
|
122
|
-
|
|
90
|
+
- [Use KnightCode interactively](usage.md) to learn input, commands, shortcuts, and queued messages.
|
|
91
|
+
- [Add instructions](configuration.md#context-files) that KnightCode should follow whenever it works in a folder.
|
|
92
|
+
- [Choose a model and provider](models.md).
|
|
123
93
|
|
|
124
|
-
|
|
125
|
-
!npm run lint
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
The command output is sent to the model. Use `!!command` to run a command without adding its output to the model context.
|
|
94
|
+
### Choose how to customize KnightCode
|
|
129
95
|
|
|
130
|
-
|
|
96
|
+
Start with the least powerful mechanism that meets your need:
|
|
131
97
|
|
|
132
|
-
|
|
98
|
+
| Need | Start with |
|
|
99
|
+
|---|---|
|
|
100
|
+
| Give KnightCode persistent instructions for a folder | [`AGENTS.md`](configuration.md#context-files) |
|
|
101
|
+
| Reuse a prompt from the `/` menu | [Prompt template](prompt-templates.md) |
|
|
102
|
+
| Add task-specific instructions and supporting files | [Skill](skills.md) |
|
|
103
|
+
| Add executable tools, commands, or event handlers | [Extension](extensions.md) |
|
|
104
|
+
| Build a custom terminal component | [Terminal UI](tui.md) |
|
|
105
|
+
| Connect an unsupported model service | [Custom provider](custom-provider.md) |
|
|
106
|
+
| Install or distribute several resources | [KnightCode package](packages.md) |
|
|
133
107
|
|
|
134
|
-
|
|
108
|
+
## Uninstall KnightCode
|
|
135
109
|
|
|
136
|
-
|
|
110
|
+
If you installed KnightCode with npm, run:
|
|
137
111
|
|
|
138
112
|
```bash
|
|
139
|
-
|
|
140
|
-
knightcode -r # Browse previous sessions
|
|
141
|
-
knightcode --name "my task" # Set session display name at startup
|
|
142
|
-
knightcode --session <path|id> # Open a specific session
|
|
113
|
+
npm uninstall -g @knightcodeai/cli
|
|
143
114
|
```
|
|
144
115
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
### Non-interactive mode
|
|
148
|
-
|
|
149
|
-
For one-shot prompts:
|
|
116
|
+
If you used the installer, run it again and choose **Uninstall KnightCode**:
|
|
150
117
|
|
|
151
118
|
```bash
|
|
152
|
-
|
|
153
|
-
cat README.md | knightcode -p "Summarize this text"
|
|
154
|
-
knightcode -p @screenshot.png "What's in this image?"
|
|
119
|
+
curl -fsSL https://knightcode.dev/install.sh | sh
|
|
155
120
|
```
|
|
156
121
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
## Next steps
|
|
160
|
-
|
|
161
|
-
- [Using KnightCode](usage.md) - interactive mode, slash commands, sessions, context files, and CLI reference.
|
|
162
|
-
- [Providers](providers.md) - authentication and model setup.
|
|
163
|
-
- [Settings](settings.md) - global and project configuration.
|
|
164
|
-
- [Keybindings](keybindings.md) - shortcuts and customization.
|
|
165
|
-
- [KnightCode Packages](packages.md) - install shared extensions, skills, prompts, and themes.
|
|
166
|
-
|
|
167
|
-
Platform notes: [Windows](windows.md), [Termux](termux.md), [tmux](tmux.md), [Terminal setup](terminal-setup.md), [Shell aliases](shell-aliases.md).
|
|
122
|
+
Neither method removes configuration, credentials, sessions, or installed KnightCode packages from `~/.knightcode/agent/`.
|