@knightcodeai/cli-linux-arm64 0.4.1 → 0.5.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.
Files changed (48) hide show
  1. package/bin/CHANGELOG.md +196 -0
  2. package/bin/README.md +36 -0
  3. package/bin/docs/compaction.md +416 -0
  4. package/bin/docs/containerization.md +111 -0
  5. package/bin/docs/custom-provider.md +777 -0
  6. package/bin/docs/development.md +71 -0
  7. package/bin/docs/docs.json +156 -0
  8. package/bin/docs/environment-variables.md +97 -0
  9. package/bin/docs/extensions.md +3020 -0
  10. package/bin/docs/images/doom-extension.png +0 -0
  11. package/bin/docs/images/interactive-mode.png +0 -0
  12. package/bin/docs/images/tree-view.png +0 -0
  13. package/bin/docs/index.md +84 -0
  14. package/bin/docs/json.md +98 -0
  15. package/bin/docs/keybindings.md +236 -0
  16. package/bin/docs/llama-cpp.md +101 -0
  17. package/bin/docs/models.md +571 -0
  18. package/bin/docs/packages.md +228 -0
  19. package/bin/docs/prompt-templates.md +96 -0
  20. package/bin/docs/providers.md +317 -0
  21. package/bin/docs/quickstart.md +167 -0
  22. package/bin/docs/rpc.md +1618 -0
  23. package/bin/docs/sdk.md +1219 -0
  24. package/bin/docs/security.md +59 -0
  25. package/bin/docs/session-format.md +438 -0
  26. package/bin/docs/sessions.md +145 -0
  27. package/bin/docs/settings.md +368 -0
  28. package/bin/docs/shell-aliases.md +13 -0
  29. package/bin/docs/skills.md +231 -0
  30. package/bin/docs/terminal-setup.md +177 -0
  31. package/bin/docs/termux.md +127 -0
  32. package/bin/docs/themes.md +320 -0
  33. package/bin/docs/tmux.md +63 -0
  34. package/bin/docs/tui.md +942 -0
  35. package/bin/docs/usage.md +307 -0
  36. package/bin/docs/windows.md +39 -0
  37. package/bin/export-html/template.css +1066 -0
  38. package/bin/export-html/template.html +55 -0
  39. package/bin/export-html/template.js +1864 -0
  40. package/bin/export-html/vendor/highlight.min.js +1213 -0
  41. package/bin/export-html/vendor/marked.min.js +78 -0
  42. package/bin/knightcode +0 -0
  43. package/bin/package.json +76 -0
  44. package/bin/photon_rs_bg.wasm +0 -0
  45. package/bin/theme/dark.json +90 -0
  46. package/bin/theme/light.json +89 -0
  47. package/bin/theme/theme-schema.json +352 -0
  48. package/package.json +7 -1
@@ -0,0 +1,111 @@
1
+ # Containerization
2
+
3
+ KnightCode runs with all permissions by default, but in some cases, you will want to have more control over what directories KnightCode can write to and which accesses it has.
4
+
5
+ There are two general options. You can either
6
+ 1. run the whole `knightcode` process inside an isolated environment, or
7
+ 2. run `knightcode` on the host and route tool execution into an isolated environment.
8
+
9
+ ## Choose a pattern
10
+
11
+ | Pattern | What is isolated | Best for | Notes |
12
+ | --- | --- | --- | --- |
13
+ | Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
14
+ | Plain Docker | Whole `knightcode` process in a local container | Simple local isolation | Provider API keys enter the container. |
15
+ | OpenShell | Whole `knightcode` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
16
+
17
+ Extensions run wherever the `knightcode` process runs. If you run host `knightcode` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
18
+
19
+ ## Gondolin
20
+
21
+ [Gondolin](https://github.com/KnightCodeAI/gondolin) is a local Linux micro-VM.
22
+ Use the [example extension](../examples/extensions/gondolin) when you want `knightcode` on the host but all built-in tools routed into the VM.
23
+
24
+ Setup:
25
+
26
+ ```bash
27
+ cp -R packages/coding-agent/examples/extensions/gondolin ~/.knightcode/agent/extensions/gondolin
28
+ cd ~/.knightcode/agent/extensions/gondolin
29
+ npm install --ignore-scripts
30
+ ```
31
+
32
+ Run from the project you want mounted:
33
+
34
+ ```bash
35
+ cd /path/to/project
36
+ knightcode -e ~/.knightcode/agent/extensions/gondolin
37
+ ```
38
+
39
+ The extension mounts the host cwd at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`.
40
+ User `!` commands are routed into the VM, as well.
41
+ File changes under `/workspace` write through to the host.
42
+
43
+ Requirements: Node.js >= 23.6.0 for `@KnightCodeAI/gondolin`, plus QEMU (requires installation through your package manager).
44
+
45
+ ## Plain Docker
46
+
47
+ Run the whole `knightcode` process in Docker when you want the simplest local container boundary.
48
+
49
+ `Dockerfile.knightcode`:
50
+
51
+ ```dockerfile
52
+ FROM node:24-bookworm-slim
53
+
54
+ RUN apt-get update \
55
+ && apt-get install -y --no-install-recommends bash ca-certificates git ripgrep \
56
+ && rm -rf /var/lib/apt/lists/*
57
+ RUN npm install -g --ignore-scripts @knightcodeai/cli
58
+
59
+ WORKDIR /workspace
60
+ ENTRYPOINT ["knightcode"]
61
+ ```
62
+
63
+ Build and run:
64
+
65
+ ```bash
66
+ docker build -t knightcode-sandbox -f Dockerfile.knightcode .
67
+
68
+ docker run --rm -it \
69
+ -e ANTHROPIC_API_KEY \
70
+ -v "$PWD:/workspace" \
71
+ -v knightcode-agent-home:/root/.knightcode/agent \
72
+ knightcode-sandbox
73
+ ```
74
+
75
+ The `-v "$PWD:/workspace"` mounts your current directory into the container at /workspace such that reads and writes in `/workspace` inside Docker directly affect your host files, like in the Gondolin example.
76
+
77
+ Use a named volume for `/root/.knightcode/agent` if you want container-local settings and sessions. Mounting your host `~/.knightcode/agent` exposes host auth and session files to the container.
78
+
79
+ ## OpenShell
80
+
81
+ Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) when you want a policy-controlled sandbox with filesystem, process, network, credential, and inference controls.
82
+ OpenShell can run sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
83
+
84
+ Every sandbox requires an active gateway.
85
+ Register and select one before creating a sandbox:
86
+
87
+ ```bash
88
+ openshell gateway add <gateway-url> --name <name>
89
+ openshell gateway select <name>
90
+ ```
91
+
92
+ Launch `knightcode` inside an OpenShell sandbox:
93
+
94
+ ```bash
95
+ openshell sandbox create --name knightcode-sandbox --from knightcode -- knightcode
96
+ ```
97
+
98
+ In this pattern, the whole `knightcode` process runs inside the sandbox.
99
+ Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
100
+
101
+ If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
102
+ Clone the repository inside the sandbox or use OpenShell file transfer commands:
103
+
104
+ ```bash
105
+ openshell sandbox upload knightcode-sandbox ./repo /workspace
106
+ openshell sandbox download knightcode-sandbox /workspace/repo ./repo-out
107
+ ```
108
+
109
+ OpenShell providers can keep raw model API keys outside the sandbox.
110
+ When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
111
+ Configure KnightCode to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.