@knightcodeai/cli-linux-arm64 0.9.1 → 0.9.3

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.
Files changed (45) hide show
  1. package/bin/CHANGELOG.md +60 -0
  2. package/bin/README.md +52 -19
  3. package/bin/docs/cli-integration.md +106 -0
  4. package/bin/docs/cli.md +270 -0
  5. package/bin/docs/compaction.md +56 -37
  6. package/bin/docs/configuration.md +46 -0
  7. package/bin/docs/containerization.md +86 -54
  8. package/bin/docs/custom-provider.md +132 -785
  9. package/bin/docs/docs.json +143 -103
  10. package/bin/docs/environment-variables.md +5 -4
  11. package/bin/docs/extensions.md +134 -2956
  12. package/bin/docs/how-knightcode-works.md +49 -0
  13. package/bin/docs/index.md +24 -69
  14. package/bin/docs/json.md +193 -65
  15. package/bin/docs/keybindings.md +56 -101
  16. package/bin/docs/llama-cpp.md +3 -3
  17. package/bin/docs/message-types.md +261 -0
  18. package/bin/docs/models.md +64 -547
  19. package/bin/docs/packages.md +66 -167
  20. package/bin/docs/prompt-templates.md +31 -68
  21. package/bin/docs/providers.md +103 -241
  22. package/bin/docs/quickstart.md +61 -106
  23. package/bin/docs/rpc-commands.md +854 -0
  24. package/bin/docs/rpc-extension-ui.md +200 -0
  25. package/bin/docs/rpc.md +129 -1556
  26. package/bin/docs/sdk.md +76 -1160
  27. package/bin/docs/security.md +70 -32
  28. package/bin/docs/session-format.md +25 -216
  29. package/bin/docs/sessions.md +38 -143
  30. package/bin/docs/settings.md +111 -389
  31. package/bin/docs/shell-aliases.md +85 -5
  32. package/bin/docs/skills.md +51 -189
  33. package/bin/docs/slash-commands.md +63 -0
  34. package/bin/docs/terminal-setup.md +107 -79
  35. package/bin/docs/termux.md +74 -83
  36. package/bin/docs/themes.md +68 -280
  37. package/bin/docs/tmux.md +31 -39
  38. package/bin/docs/tui.md +69 -923
  39. package/bin/docs/usage.md +79 -286
  40. package/bin/docs/windows.md +43 -17
  41. package/bin/export-html/template.js +6 -1
  42. package/bin/knightcode +2 -2
  43. package/bin/package.json +6 -6
  44. package/package.json +1 -1
  45. package/bin/docs/development.md +0 -71
@@ -1,167 +1,122 @@
1
1
  # Quickstart
2
2
 
3
- This page gets you from install to a useful first knightcode session.
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
- ## Install
5
+ For native Windows setup, read [Windows Setup](windows.md). For Android, read [Termux Setup](termux.md).
6
6
 
7
- KnightCode is distributed as an npm package:
7
+ ## 1. Install KnightCode
8
+
9
+ On macOS or Linux, you can use the installer:
8
10
 
9
11
  ```bash
10
- npm install -g --ignore-scripts @knightcodeai/cli
12
+ curl -fsSL https://knightcode.dev/install.sh | sh
11
13
  ```
12
14
 
13
- `--ignore-scripts` disables dependency lifecycle scripts during install. KnightCode does not require install scripts for normal npm installs.
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
- # curl installer or npm install -g
21
- npm uninstall -g @knightcodeai/cli
18
+ npm install -g --ignore-scripts @knightcodeai/cli
19
+ ```
22
20
 
23
- # pnpm
24
- pnpm remove -g @knightcodeai/cli
21
+ KnightCode does not require dependency lifecycle scripts for a normal npm installation.
25
22
 
26
- # Yarn
27
- yarn global remove @knightcodeai/cli
23
+ Verify the installation:
28
24
 
29
- # Bun
30
- bun uninstall -g @knightcodeai/cli
25
+ ```bash
26
+ knightcode --version
31
27
  ```
32
28
 
33
- Uninstalling knightcode leaves settings, credentials, sessions, and installed knightcode packages in `~/.knightcode/agent/`.
29
+ ## 2. Start KnightCode
34
30
 
35
- Then start knightcode in the project directory you want it to work on:
31
+ Change to the folder you want KnightCode to work with, then start it:
36
32
 
37
33
  ```bash
38
- cd /path/to/project
34
+ cd /path/to/folder
39
35
  knightcode
40
36
  ```
41
37
 
42
- ## Authenticate
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
- KnightCode can use subscription providers through `/login`, or API-key providers through environment variables or the auth file.
44
+ ## 3. Choose a model
45
45
 
46
- ### Option 1: subscription login
46
+ A **model** generates KnightCode's responses. A **provider** is the service or account KnightCode uses to access that model.
47
47
 
48
- Start knightcode and run:
48
+ In KnightCode, run:
49
49
 
50
50
  ```text
51
51
  /login
52
52
  ```
53
53
 
54
- Then select a provider. Built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot.
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
- ### Option 2: API key
56
+ See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
57
57
 
58
- Set an API key before launching knightcode:
58
+ ## 4. Give KnightCode a task
59
59
 
60
- ```bash
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
- ## First session
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 this repository and tell me how to run its checks.
65
+ Summarize @meeting-notes.md and save the action items to action-items.md.
75
66
  ```
76
67
 
77
- By default, knightcode gives the model four tools:
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
- KnightCode loads:
99
-
100
- - `~/.knightcode/agent/AGENTS.md` for global instructions
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
- ## Common things to try
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
- ### Reference files
78
+ ## Continue later
110
79
 
111
- Type `@` in the editor to fuzzy-search files, or pass files on the command line:
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 @README.md "Summarize this"
115
- knightcode @src/app.ts @src/app.test.ts "Review these together"
83
+ knightcode --continue
116
84
  ```
117
85
 
118
- Images or text can be pasted with Ctrl+V (Alt+V on Windows); images can also be dragged into supported terminals.
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
- ### Run shell commands
88
+ ## Next steps
121
89
 
122
- In interactive mode:
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
- ```text
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
- ### Switch models
96
+ Start with the least powerful mechanism that meets your need:
131
97
 
132
- Use `/model` or Ctrl+L to choose a model for the current session. Press Ctrl+S (or Ctrl+D, if your terminal swallows Ctrl+S) in the model picker to save the highlighted model as the startup default. Use `/thinking` to choose a thinking level for the current session, or Ctrl+S / Ctrl+D in that picker to save the startup default thinking level. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
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
- ### Continue later
108
+ ## Uninstall KnightCode
135
109
 
136
- Sessions are saved automatically:
110
+ If you installed KnightCode with npm, run:
137
111
 
138
112
  ```bash
139
- knightcode -c # Continue most recent session
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
- Inside knightcode, use `/resume`, `/new`, `/undo`, `/tree`, `/fork`, and `/clone` to manage sessions.
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
- knightcode -p "Summarize this codebase"
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
- Use `--mode json` for JSON event output or `--mode rpc` for process integration.
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/`.