@valni/cli-darwin-x64 0.0.0-stage → 0.1.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/LICENSE +53 -0
- package/package.json +18 -5
- package/runtime/LICENSE +53 -0
- package/runtime/README.md +674 -0
- package/runtime/assets/clankolas.png +0 -0
- package/runtime/docs/extensions.md +2910 -0
- package/runtime/docs/json.md +82 -0
- package/runtime/docs/models.md +540 -0
- package/runtime/docs/packages.md +228 -0
- package/runtime/docs/rpc.md +1480 -0
- package/runtime/docs/sdk.md +1183 -0
- package/runtime/docs/session-format.md +422 -0
- package/runtime/docs/settings.md +315 -0
- package/runtime/docs/shell-aliases.md +13 -0
- package/runtime/docs/terminal-setup.md +142 -0
- package/runtime/docs/termux.md +127 -0
- package/runtime/docs/tmux.md +63 -0
- package/runtime/docs/tui.md +927 -0
- package/runtime/docs/windows.md +17 -0
- package/runtime/examples/README.md +25 -0
- package/runtime/examples/extensions/README.md +212 -0
- package/runtime/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/runtime/examples/extensions/bash-spawn-hook.ts +30 -0
- package/runtime/examples/extensions/bookmark.ts +50 -0
- package/runtime/examples/extensions/border-status-editor.ts +145 -0
- package/runtime/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/runtime/examples/extensions/claude-rules.ts +86 -0
- package/runtime/examples/extensions/commands.ts +72 -0
- package/runtime/examples/extensions/confirm-destructive.ts +59 -0
- package/runtime/examples/extensions/custom-footer.ts +64 -0
- package/runtime/examples/extensions/custom-header.ts +73 -0
- package/runtime/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/runtime/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/runtime/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/runtime/examples/extensions/dirty-repo-guard.ts +56 -0
- package/runtime/examples/extensions/doom-overlay/README.md +46 -0
- package/runtime/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/runtime/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/runtime/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/runtime/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/runtime/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/runtime/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/runtime/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/runtime/examples/extensions/doom-overlay/index.ts +74 -0
- package/runtime/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/runtime/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/runtime/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/runtime/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/runtime/examples/extensions/dynamic-resources/index.ts +15 -0
- package/runtime/examples/extensions/dynamic-tools.ts +74 -0
- package/runtime/examples/extensions/entry-renderer.ts +41 -0
- package/runtime/examples/extensions/event-bus.ts +43 -0
- package/runtime/examples/extensions/file-trigger.ts +41 -0
- package/runtime/examples/extensions/git-checkpoint.ts +53 -0
- package/runtime/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/runtime/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/runtime/examples/extensions/gondolin/index.ts +531 -0
- package/runtime/examples/extensions/gondolin/package-lock.json +185 -0
- package/runtime/examples/extensions/gondolin/package.json +19 -0
- package/runtime/examples/extensions/hello.ts +26 -0
- package/runtime/examples/extensions/hidden-thinking-label.ts +53 -0
- package/runtime/examples/extensions/inline-bash.ts +94 -0
- package/runtime/examples/extensions/input-transform-streaming.ts +39 -0
- package/runtime/examples/extensions/input-transform.ts +43 -0
- package/runtime/examples/extensions/interactive-shell.ts +196 -0
- package/runtime/examples/extensions/mac-system-theme.ts +47 -0
- package/runtime/examples/extensions/message-renderer.ts +59 -0
- package/runtime/examples/extensions/minimal-mode.ts +426 -0
- package/runtime/examples/extensions/modal-editor.ts +85 -0
- package/runtime/examples/extensions/model-status.ts +31 -0
- package/runtime/examples/extensions/notify.ts +55 -0
- package/runtime/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/runtime/examples/extensions/overlay-test.ts +153 -0
- package/runtime/examples/extensions/permission-gate.ts +34 -0
- package/runtime/examples/extensions/pirate.ts +47 -0
- package/runtime/examples/extensions/plan-mode/README.md +66 -0
- package/runtime/examples/extensions/plan-mode/index.ts +390 -0
- package/runtime/examples/extensions/plan-mode/utils.ts +168 -0
- package/runtime/examples/extensions/preset.ts +436 -0
- package/runtime/examples/extensions/project-trust.ts +64 -0
- package/runtime/examples/extensions/prompt-customizer.ts +97 -0
- package/runtime/examples/extensions/protected-paths.ts +30 -0
- package/runtime/examples/extensions/provider-payload.ts +18 -0
- package/runtime/examples/extensions/question.ts +278 -0
- package/runtime/examples/extensions/questionnaire.ts +440 -0
- package/runtime/examples/extensions/rainbow-editor.ts +88 -0
- package/runtime/examples/extensions/reload-runtime.ts +37 -0
- package/runtime/examples/extensions/rpc-demo.ts +118 -0
- package/runtime/examples/extensions/sandbox/index.ts +321 -0
- package/runtime/examples/extensions/sandbox/package-lock.json +92 -0
- package/runtime/examples/extensions/sandbox/package.json +19 -0
- package/runtime/examples/extensions/send-user-message.ts +97 -0
- package/runtime/examples/extensions/session-name.ts +27 -0
- package/runtime/examples/extensions/shutdown-command.ts +63 -0
- package/runtime/examples/extensions/snake.ts +343 -0
- package/runtime/examples/extensions/space-invaders.ts +560 -0
- package/runtime/examples/extensions/ssh.ts +220 -0
- package/runtime/examples/extensions/status-line.ts +32 -0
- package/runtime/examples/extensions/structured-output.ts +65 -0
- package/runtime/examples/extensions/subagent/README.md +175 -0
- package/runtime/examples/extensions/subagent/agents/planner.md +37 -0
- package/runtime/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/runtime/examples/extensions/subagent/agents/scout.md +50 -0
- package/runtime/examples/extensions/subagent/agents/worker.md +24 -0
- package/runtime/examples/extensions/subagent/agents.ts +126 -0
- package/runtime/examples/extensions/subagent/index.ts +1009 -0
- package/runtime/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/runtime/examples/extensions/subagent/prompts/implement.md +10 -0
- package/runtime/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/runtime/examples/extensions/system-prompt-header.ts +17 -0
- package/runtime/examples/extensions/tic-tac-toe.ts +1008 -0
- package/runtime/examples/extensions/timed-confirm.ts +70 -0
- package/runtime/examples/extensions/titlebar-spinner.ts +58 -0
- package/runtime/examples/extensions/todo.ts +297 -0
- package/runtime/examples/extensions/tool-override.ts +144 -0
- package/runtime/examples/extensions/tools.ts +146 -0
- package/runtime/examples/extensions/trigger-compact.ts +50 -0
- package/runtime/examples/extensions/truncated-tool.ts +195 -0
- package/runtime/examples/extensions/widget-placement.ts +9 -0
- package/runtime/examples/extensions/with-deps/index.ts +32 -0
- package/runtime/examples/extensions/with-deps/package-lock.json +31 -0
- package/runtime/examples/extensions/with-deps/package.json +22 -0
- package/runtime/examples/extensions/working-indicator.ts +123 -0
- package/runtime/examples/extensions/working-message-test.ts +25 -0
- package/runtime/examples/rpc-extension-ui.ts +632 -0
- package/runtime/examples/sdk/01-minimal.ts +26 -0
- package/runtime/examples/sdk/02-custom-model.ts +43 -0
- package/runtime/examples/sdk/03-custom-prompt.ts +70 -0
- package/runtime/examples/sdk/04-skills.ts +55 -0
- package/runtime/examples/sdk/05-tools.ts +48 -0
- package/runtime/examples/sdk/06-extensions.ts +94 -0
- package/runtime/examples/sdk/07-context-files.ts +42 -0
- package/runtime/examples/sdk/08-prompt-templates.ts +51 -0
- package/runtime/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/runtime/examples/sdk/10-settings.ts +53 -0
- package/runtime/examples/sdk/11-sessions.ts +52 -0
- package/runtime/examples/sdk/12-full-control.ts +71 -0
- package/runtime/examples/sdk/13-session-runtime.ts +67 -0
- package/runtime/examples/sdk/README.md +140 -0
- package/runtime/export-html/ansi-to-html.js +249 -0
- package/runtime/export-html/index.js +226 -0
- package/runtime/export-html/template.css +1066 -0
- package/runtime/export-html/template.html +55 -0
- package/runtime/export-html/template.js +1864 -0
- package/runtime/export-html/tool-renderer.js +108 -0
- package/runtime/export-html/vendor/highlight.min.js +1213 -0
- package/runtime/export-html/vendor/marked.min.js +78 -0
- package/runtime/extensions/pi-switchboard/.github/workflows/ci.yml +51 -0
- package/runtime/extensions/pi-switchboard/LICENSE +22 -0
- package/runtime/extensions/pi-switchboard/README.md +85 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/catalog.ts +183 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/config.ts +97 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/connections.ts +386 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/constants.ts +12 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/device-auth.ts +127 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/envelope.ts +199 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/errors.ts +180 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/index.ts +125 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/participant.ts +17 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/sessionStream.ts +131 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/toolProxy.ts +136 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/tools.ts +16 -0
- package/runtime/extensions/pi-switchboard/extensions/switchboard/types.ts +37 -0
- package/runtime/extensions/pi-switchboard/package.json +30 -0
- package/runtime/extensions/pi-switchboard/tsconfig.json +13 -0
- package/runtime/extensions/switchboard-local/.github/workflows/ci.yml +80 -0
- package/runtime/extensions/switchboard-local/.github/workflows/release.yml +46 -0
- package/runtime/extensions/switchboard-local/README.md +98 -0
- package/runtime/extensions/switchboard-local/extensions/local/engine.ts +28 -0
- package/runtime/extensions/switchboard-local/extensions/local/engines/gguf.ts +324 -0
- package/runtime/extensions/switchboard-local/extensions/local/engines/llamaBuild.ts +62 -0
- package/runtime/extensions/switchboard-local/extensions/local/engines/mlx.ts +245 -0
- package/runtime/extensions/switchboard-local/extensions/local/engines/select.ts +38 -0
- package/runtime/extensions/switchboard-local/extensions/local/engines/support.ts +151 -0
- package/runtime/extensions/switchboard-local/extensions/local/hf.ts +106 -0
- package/runtime/extensions/switchboard-local/extensions/local/index.ts +67 -0
- package/runtime/extensions/switchboard-local/extensions/local/nativeStream.ts +602 -0
- package/runtime/extensions/switchboard-local/extensions/local/paths.ts +44 -0
- package/runtime/extensions/switchboard-local/extensions/local/provider.ts +57 -0
- package/runtime/extensions/switchboard-local/extensions/local/store.ts +82 -0
- package/runtime/extensions/switchboard-local/extensions/local/ui.ts +60 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/apiTypes.js +74 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/client.js +292 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/deviceAuth.js +155 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/errors.js +95 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/index.js +8 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/messages.js +253 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/models.js +19 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/native.js +886 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/dist/wire.js +85 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard/package.json +39 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/package.json +29 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/anthropic.ts +127 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/google.ts +111 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/index.ts +8 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/modelRecord.test.ts +25 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/modelRecord.ts +57 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/openaiGeneric.ts +103 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/openaiPro.ts +89 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/profile.ts +120 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/routing.test.ts +82 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/routing.ts +74 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/validateConfig.google.test.ts +137 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/validateConfig.openai.test.ts +241 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/validateConfig.test.ts +174 -0
- package/runtime/extensions/switchboard-local/node_modules/@valni/switchboard-native/src/validateConfig.ts +438 -0
- package/runtime/extensions/switchboard-local/package.json +34 -0
- package/runtime/extensions/switchboard-local/tsconfig.json +13 -0
- package/runtime/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/runtime/node_modules/@mariozechner/clipboard/.yarnrc.yml +1 -0
- package/runtime/node_modules/@mariozechner/clipboard/Cargo.toml +45 -0
- package/runtime/node_modules/@mariozechner/clipboard/README.md +60 -0
- package/runtime/node_modules/@mariozechner/clipboard/build.rs +5 -0
- package/runtime/node_modules/@mariozechner/clipboard/clipboard.darwin-x64.node +0 -0
- package/runtime/node_modules/@mariozechner/clipboard/exp.ts +12 -0
- package/runtime/node_modules/@mariozechner/clipboard/index.js +606 -0
- package/runtime/node_modules/@mariozechner/clipboard/package.json +56 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +307 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +93 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +313 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +471 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +252 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +431 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +712 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +916 -0
- package/runtime/node_modules/@mariozechner/clipboard/src/lib.rs +194 -0
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/README.md +3 -0
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/clipboard.darwin-x64.node +0 -0
- package/runtime/node_modules/@mariozechner/clipboard-darwin-x64/package.json +22 -0
- package/runtime/package.json +104 -0
- package/runtime/photon_rs_bg.wasm +0 -0
- package/runtime/theme/dark.json +87 -0
- package/runtime/theme/light.json +86 -0
- package/runtime/theme/theme-schema.json +340 -0
- package/runtime/valni +4 -0
- package/README.md +0 -3
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://pi.dev">
|
|
3
|
+
<img alt="valni logo" src="https://pi.dev/logo-auto.svg" width="128">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@valni/cli"><img alt="npm" src="https://img.shields.io/npm/v/@valni/cli?style=flat-square" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
> New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See [CONTRIBUTING.md](../../CONTRIBUTING.md).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Pi is a minimal terminal coding harness. Adapt valni to your workflows, not the other way around, without having to fork and modify valni internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Pi Packages](#pi-packages) and share them with others via npm or git.
|
|
16
|
+
|
|
17
|
+
Pi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask valni to build what you want or install a third party valni package that matches your workflow.
|
|
18
|
+
|
|
19
|
+
Pi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [openclaw/openclaw](https://github.com/openclaw/openclaw) for a real-world SDK integration.
|
|
20
|
+
|
|
21
|
+
## Share your OSS coding agent sessions
|
|
22
|
+
|
|
23
|
+
If you use valni for open source work, please share your coding agent sessions.
|
|
24
|
+
|
|
25
|
+
Public OSS session data helps improve models, prompts, tools, and evaluations using real development workflows.
|
|
26
|
+
|
|
27
|
+
For the full explanation, see [this post on X](https://x.com/badlogicgames/status/2037811643774652911).
|
|
28
|
+
|
|
29
|
+
To publish sessions, use [`badlogic/pi-share-hf`](https://github.com/badlogic/pi-share-hf). Read its README.md for setup instructions. All you need is a Hugging Face account, the Hugging Face CLI, and `pi-share-hf`.
|
|
30
|
+
|
|
31
|
+
You can also watch [this video](https://x.com/badlogicgames/status/2041151967695634619), where I show how I publish my `pi-mono` sessions.
|
|
32
|
+
|
|
33
|
+
I regularly publish my own `pi-mono` work sessions here:
|
|
34
|
+
|
|
35
|
+
- [badlogicgames/pi-mono on Hugging Face](https://huggingface.co/datasets/badlogicgames/pi-mono)
|
|
36
|
+
|
|
37
|
+
## Table of Contents
|
|
38
|
+
|
|
39
|
+
- [Quick Start](#quick-start)
|
|
40
|
+
- [Providers & Models](#providers--models)
|
|
41
|
+
- [Interactive Mode](#interactive-mode)
|
|
42
|
+
- [Editor](#editor)
|
|
43
|
+
- [Commands](#commands)
|
|
44
|
+
- [Keyboard Shortcuts](#keyboard-shortcuts)
|
|
45
|
+
- [Message Queue](#message-queue)
|
|
46
|
+
- [Sessions](#sessions)
|
|
47
|
+
- [Branching](#branching)
|
|
48
|
+
- [Compaction](#compaction)
|
|
49
|
+
- [Settings](#settings)
|
|
50
|
+
- [Context Files](#context-files)
|
|
51
|
+
- [Customization](#customization)
|
|
52
|
+
- [Prompt Templates](#prompt-templates)
|
|
53
|
+
- [Skills](#skills)
|
|
54
|
+
- [Extensions](#extensions)
|
|
55
|
+
- [Themes](#themes)
|
|
56
|
+
- [Pi Packages](#pi-packages)
|
|
57
|
+
- [Programmatic Usage](#programmatic-usage)
|
|
58
|
+
- [Philosophy](#philosophy)
|
|
59
|
+
- [CLI Reference](#cli-reference)
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm install -g --ignore-scripts @valni/cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`--ignore-scripts` disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
|
|
70
|
+
|
|
71
|
+
Installer alternative:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
curl -fsSL https://pi.dev/install.sh | sh
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Authenticate with an API key:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
81
|
+
valni
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or use your existing subscription:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
valni
|
|
88
|
+
/login # Then select provider
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then just talk to pi. By default, valni gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [valni packages](#pi-packages).
|
|
92
|
+
|
|
93
|
+
**Platform notes:** [Windows](docs/windows.md) | [Termux (Android)](docs/termux.md) | [tmux](docs/tmux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Providers & Models
|
|
98
|
+
|
|
99
|
+
For each built-in provider, valni maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `valni update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
100
|
+
|
|
101
|
+
**Subscriptions:**
|
|
102
|
+
- Anthropic Claude Pro/Max
|
|
103
|
+
- OpenAI ChatGPT Plus/Pro (Codex)
|
|
104
|
+
- GitHub Copilot
|
|
105
|
+
|
|
106
|
+
**API keys:**
|
|
107
|
+
- Anthropic
|
|
108
|
+
- Ant Ling
|
|
109
|
+
- OpenAI
|
|
110
|
+
- Azure OpenAI
|
|
111
|
+
- DeepSeek
|
|
112
|
+
- NVIDIA NIM
|
|
113
|
+
- Google Gemini
|
|
114
|
+
- Google Vertex
|
|
115
|
+
- Amazon Bedrock
|
|
116
|
+
- Mistral
|
|
117
|
+
- Groq
|
|
118
|
+
- Cerebras
|
|
119
|
+
- Cloudflare AI Gateway
|
|
120
|
+
- Cloudflare Workers AI
|
|
121
|
+
- xAI
|
|
122
|
+
- OpenRouter
|
|
123
|
+
- Vercel AI Gateway
|
|
124
|
+
- ZAI Coding Plan (Global)
|
|
125
|
+
- ZAI Coding Plan (China)
|
|
126
|
+
- OpenCode Zen
|
|
127
|
+
- OpenCode Go
|
|
128
|
+
- Hugging Face
|
|
129
|
+
- Fireworks
|
|
130
|
+
- Together AI
|
|
131
|
+
- Kimi For Coding
|
|
132
|
+
- MiniMax
|
|
133
|
+
- Xiaomi MiMo
|
|
134
|
+
- Xiaomi MiMo Token Plan (China)
|
|
135
|
+
- Xiaomi MiMo Token Plan (Amsterdam)
|
|
136
|
+
- Xiaomi MiMo Token Plan (Singapore)
|
|
137
|
+
|
|
138
|
+
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
|
|
139
|
+
|
|
140
|
+
**Custom providers & models:** Add providers via `~/.valni/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Interactive Mode
|
|
145
|
+
|
|
146
|
+
<p align="center"><img src="docs/images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
147
|
+
|
|
148
|
+
The interface from top to bottom:
|
|
149
|
+
|
|
150
|
+
- **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
|
|
151
|
+
- **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
|
|
152
|
+
- **Editor** - Where you type; border color indicates thinking level
|
|
153
|
+
- **Footer** - Working directory, session name, total token/cache usage (`↑` input, `↓` output, `R` cache read, `W` cache write, `CH` latest cache hit rate), cost, context usage, current model
|
|
154
|
+
|
|
155
|
+
The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
|
|
156
|
+
|
|
157
|
+
### Editor
|
|
158
|
+
|
|
159
|
+
| Feature | How |
|
|
160
|
+
|---------|-----|
|
|
161
|
+
| File reference | Type `@` to fuzzy-search project files |
|
|
162
|
+
| Path completion | Tab to complete paths |
|
|
163
|
+
| Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
|
|
164
|
+
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
165
|
+
| Clipboard | Ctrl+V to paste an image or text (Alt+V on Windows), or drag images onto terminal |
|
|
166
|
+
| Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
|
|
167
|
+
|
|
168
|
+
Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
|
|
169
|
+
|
|
170
|
+
### Commands
|
|
171
|
+
|
|
172
|
+
Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
|
|
173
|
+
|
|
174
|
+
| Command | Description |
|
|
175
|
+
|---------|-------------|
|
|
176
|
+
| `/login`, `/logout` | OAuth authentication |
|
|
177
|
+
| `/model` | Switch models |
|
|
178
|
+
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
179
|
+
| `/settings` | Thinking level, theme, message delivery, transport |
|
|
180
|
+
| `/resume` | Pick from previous sessions |
|
|
181
|
+
| `/new` | Start a new session |
|
|
182
|
+
| `/name <name>` | Set session display name |
|
|
183
|
+
| `/session` | Show session info (file, ID, messages, tokens, cost) |
|
|
184
|
+
| `/tree` | Jump to any point in the session and continue from there |
|
|
185
|
+
| `/trust` | Save project trust decision for future sessions (restart required) |
|
|
186
|
+
| `/fork` | Create a new session from a previous user message |
|
|
187
|
+
| `/clone` | Duplicate the current active branch into a new session |
|
|
188
|
+
| `/compact [prompt]` | Manually compact context, optional custom instructions |
|
|
189
|
+
| `/copy` | Copy last assistant message to clipboard |
|
|
190
|
+
| `/export [file]` | Export session to HTML or JSONL file |
|
|
191
|
+
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
192
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
193
|
+
| `/hotkeys` | Show all keyboard shortcuts |
|
|
194
|
+
| `/quit` | Quit valni |
|
|
195
|
+
|
|
196
|
+
### Keyboard Shortcuts
|
|
197
|
+
|
|
198
|
+
See `/hotkeys` for the full list. Customize via `~/.valni/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
|
|
199
|
+
|
|
200
|
+
**Commonly used:**
|
|
201
|
+
|
|
202
|
+
| Key | Action |
|
|
203
|
+
|-----|--------|
|
|
204
|
+
| Ctrl+C | Clear editor |
|
|
205
|
+
| Ctrl+C twice | Quit |
|
|
206
|
+
| Escape | Cancel/abort |
|
|
207
|
+
| Escape twice | Open `/tree` |
|
|
208
|
+
| Ctrl+L | Open model selector |
|
|
209
|
+
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
|
|
210
|
+
| Shift+Tab | Cycle thinking level |
|
|
211
|
+
| Ctrl+O | Collapse/expand tool output |
|
|
212
|
+
| Ctrl+T | Collapse/expand thinking blocks |
|
|
213
|
+
| Ctrl+X | Copy the last assistant message |
|
|
214
|
+
|
|
215
|
+
### Message Queue
|
|
216
|
+
|
|
217
|
+
Submit messages while the agent is working:
|
|
218
|
+
|
|
219
|
+
- **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
|
|
220
|
+
- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
|
|
221
|
+
- **Escape** aborts and restores queued messages to editor
|
|
222
|
+
- **Alt+Up** retrieves queued messages back to editor
|
|
223
|
+
|
|
224
|
+
On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so valni can receive the follow-up shortcut.
|
|
225
|
+
|
|
226
|
+
Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Sessions
|
|
231
|
+
|
|
232
|
+
Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session-format.md](docs/session-format.md) for file format.
|
|
233
|
+
|
|
234
|
+
### Management
|
|
235
|
+
|
|
236
|
+
Sessions auto-save to `~/.valni/agent/sessions/` organized by working directory.
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
valni -c # Continue most recent session
|
|
240
|
+
valni -r # Browse and select from past sessions
|
|
241
|
+
valni --no-session # Ephemeral mode (don't save)
|
|
242
|
+
valni --name "my task" # Set session display name at startup
|
|
243
|
+
valni --session <path|id> # Use specific session file or ID
|
|
244
|
+
valni --fork <path|id> # Fork specific session file or ID into a new session
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Use `/session` in interactive mode to see the current session ID before reusing it with `--session <id>` or `--fork <id>`.
|
|
248
|
+
|
|
249
|
+
### Branching
|
|
250
|
+
|
|
251
|
+
**`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.
|
|
252
|
+
|
|
253
|
+
<p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
|
|
254
|
+
|
|
255
|
+
- Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
|
|
256
|
+
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
|
|
257
|
+
- Press Ctrl+X to copy the selected message
|
|
258
|
+
- Press Shift+L to label entries as bookmarks and Shift+T to toggle label timestamps
|
|
259
|
+
|
|
260
|
+
**`/fork`** - Create a new session file from a previous user message on the active branch. Opens a selector, copies the active path up to that point, and places the selected prompt in the editor for modification.
|
|
261
|
+
|
|
262
|
+
**`/clone`** - Duplicate the current active branch into a new session file at the current position. The new session keeps the full active-path history and opens with an empty editor.
|
|
263
|
+
|
|
264
|
+
**`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
|
|
265
|
+
|
|
266
|
+
### Compaction
|
|
267
|
+
|
|
268
|
+
Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
|
|
269
|
+
|
|
270
|
+
**Manual:** `/compact` or `/compact <custom instructions>`
|
|
271
|
+
|
|
272
|
+
**Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
|
|
273
|
+
|
|
274
|
+
Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Settings
|
|
279
|
+
|
|
280
|
+
Use `/settings` to modify common options, or edit JSON files directly:
|
|
281
|
+
|
|
282
|
+
| Location | Scope |
|
|
283
|
+
|----------|-------|
|
|
284
|
+
| `~/.valni/agent/settings.json` | Global (all projects) |
|
|
285
|
+
| `.valni/settings.json` | Project (overrides global) |
|
|
286
|
+
|
|
287
|
+
See [docs/settings.md](docs/settings.md) for all options.
|
|
288
|
+
|
|
289
|
+
### Project Trust
|
|
290
|
+
|
|
291
|
+
On interactive startup, valni asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.valni/agent/trust.json`. Trusting a project allows valni to load `.valni/settings.json` and `.valni` resources, install missing project packages, and execute project extensions.
|
|
292
|
+
|
|
293
|
+
Before the trust decision, valni loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
|
|
294
|
+
|
|
295
|
+
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
296
|
+
|
|
297
|
+
If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.valni/agent/settings.json`, or change it with `/settings`.
|
|
298
|
+
|
|
299
|
+
`valni config` and package commands use the same project trust flow, except `valni update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
|
|
300
|
+
|
|
301
|
+
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.valni/agent/trust.json` only; the current session is not reloaded, so restart valni for changes to take effect.
|
|
302
|
+
|
|
303
|
+
### Update checks
|
|
304
|
+
|
|
305
|
+
Use `--offline` or `VALNI_OFFLINE=1` to disable startup network operations, including package update checks.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Context Files
|
|
310
|
+
|
|
311
|
+
Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
|
|
312
|
+
- `~/.valni/agent/AGENTS.md` (global)
|
|
313
|
+
- Parent directories (walking up from cwd)
|
|
314
|
+
- Current directory
|
|
315
|
+
|
|
316
|
+
Use for project instructions (`AGENTS.md`/`CLAUDE.md`), conventions, common commands. All matching files are concatenated.
|
|
317
|
+
|
|
318
|
+
Disable context file loading with `--no-context-files` (or `-nc`).
|
|
319
|
+
|
|
320
|
+
### System Prompt
|
|
321
|
+
|
|
322
|
+
Replace the default system prompt with `.valni/SYSTEM.md` (project) or `~/.valni/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Customization
|
|
327
|
+
|
|
328
|
+
### Prompt Templates
|
|
329
|
+
|
|
330
|
+
Reusable prompts as Markdown files. Type `/name` to expand.
|
|
331
|
+
|
|
332
|
+
```markdown
|
|
333
|
+
<!-- ~/.valni/agent/prompts/review.md -->
|
|
334
|
+
Review this code for bugs, security issues, and performance problems.
|
|
335
|
+
Focus on: {{focus}}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Place in `~/.valni/agent/prompts/`, `.valni/prompts/`, or a [valni package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
|
|
339
|
+
|
|
340
|
+
### Skills
|
|
341
|
+
|
|
342
|
+
On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
|
|
343
|
+
|
|
344
|
+
```markdown
|
|
345
|
+
<!-- ~/.valni/agent/skills/my-skill/SKILL.md -->
|
|
346
|
+
# My Skill
|
|
347
|
+
Use this skill when the user asks about X.
|
|
348
|
+
|
|
349
|
+
## Steps
|
|
350
|
+
1. Do this
|
|
351
|
+
2. Then that
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Place in `~/.valni/agent/skills/`, `~/.agents/skills/`, `.valni/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [valni package](#pi-packages) to share with others. See [docs/skills.md](docs/skills.md).
|
|
355
|
+
|
|
356
|
+
### Extensions
|
|
357
|
+
|
|
358
|
+
<p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
|
|
359
|
+
|
|
360
|
+
TypeScript modules that extend valni with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
export default function (valni: ExtensionAPI) {
|
|
364
|
+
pi.registerTool({ name: "deploy", ... });
|
|
365
|
+
pi.registerCommand("stats", { ... });
|
|
366
|
+
pi.on("tool_call", async (event, ctx) => { ... });
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
The default export can also be `async`. valni waits for async extension factories before startup continues, which is useful for one-time initialization such as fetching remote model lists before calling `pi.registerProvider()`.
|
|
371
|
+
|
|
372
|
+
**What's possible:**
|
|
373
|
+
- Custom tools (or replace built-in tools entirely)
|
|
374
|
+
- Sub-agents and plan mode
|
|
375
|
+
- Custom compaction and summarization
|
|
376
|
+
- Permission gates and path protection
|
|
377
|
+
- Custom editors and UI components
|
|
378
|
+
- Status lines, headers, footers
|
|
379
|
+
- Git checkpointing and auto-commit
|
|
380
|
+
- SSH and sandbox execution
|
|
381
|
+
- MCP server integration
|
|
382
|
+
- Make valni look like Claude Code
|
|
383
|
+
- Games while waiting (yes, Doom runs)
|
|
384
|
+
- ...anything you can dream up
|
|
385
|
+
|
|
386
|
+
Place in `~/.valni/agent/extensions/`, `.valni/extensions/`, or a [valni package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
|
|
387
|
+
|
|
388
|
+
### Themes
|
|
389
|
+
|
|
390
|
+
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and valni immediately applies changes.
|
|
391
|
+
|
|
392
|
+
Place in `~/.valni/agent/themes/`, `.valni/themes/`, or a [valni package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
|
|
393
|
+
|
|
394
|
+
### Pi Packages
|
|
395
|
+
|
|
396
|
+
Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Api-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
|
|
397
|
+
|
|
398
|
+
> **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
valni install npm:@foo/pi-tools
|
|
402
|
+
valni install npm:@foo/pi-tools@1.2.3 # pinned version
|
|
403
|
+
valni install git:github.com/user/repo
|
|
404
|
+
valni install git:github.com/user/repo@v1 # tag or commit
|
|
405
|
+
valni install git:git@github.com:user/repo
|
|
406
|
+
valni install git:git@github.com:user/repo@v1 # tag or commit
|
|
407
|
+
valni install https://github.com/user/repo
|
|
408
|
+
valni install https://github.com/user/repo@v1 # tag or commit
|
|
409
|
+
valni install ssh://git@github.com/user/repo
|
|
410
|
+
valni install ssh://git@github.com/user/repo@v1 # tag or commit
|
|
411
|
+
valni remove npm:@foo/pi-tools
|
|
412
|
+
valni uninstall npm:@foo/pi-tools # alias for remove
|
|
413
|
+
valni list
|
|
414
|
+
valni update # update all packages
|
|
415
|
+
valni update --extensions # update all packages
|
|
416
|
+
valni update npm:@foo/pi-tools # update one package
|
|
417
|
+
valni config # enable/disable extensions, skills, prompts, themes
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Packages install to `~/.valni/agent/git/` (git) or `~/.valni/agent/npm/` (npm). Use `-l` for project-local installs (`.valni/git/`, `.valni/npm/`). Git `@ref` values are pinned tags or commits; pinned packages are skipped by `valni update --extensions` and `valni update --all`, so use `valni install git:host/user/repo@new-ref` to move an existing package to a new ref. Git packages install dependencies with `npm install --omit=dev` by default, so runtime deps must be listed under `dependencies`; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers. If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
|
|
421
|
+
|
|
422
|
+
Create a package by adding a `valni` key to `package.json`:
|
|
423
|
+
|
|
424
|
+
```json
|
|
425
|
+
{
|
|
426
|
+
"name": "my-pi-package",
|
|
427
|
+
"keywords": ["pi-package"],
|
|
428
|
+
"valni": {
|
|
429
|
+
"extensions": ["./extensions"],
|
|
430
|
+
"skills": ["./skills"],
|
|
431
|
+
"prompts": ["./prompts"],
|
|
432
|
+
"themes": ["./themes"]
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Without a `valni` manifest, valni auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
|
|
438
|
+
|
|
439
|
+
See [docs/packages.md](docs/packages.md).
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Programmatic Usage
|
|
444
|
+
|
|
445
|
+
### SDK
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
import { createAgentSession, ModelRuntime, SessionManager } from "@valni/cli";
|
|
449
|
+
|
|
450
|
+
const modelRuntime = await ModelRuntime.create();
|
|
451
|
+
const { session } = await createAgentSession({
|
|
452
|
+
sessionManager: SessionManager.inMemory(),
|
|
453
|
+
modelRuntime,
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
await session.prompt("What files are in the current directory?");
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
For advanced multi-session runtime replacement, use `createAgentSessionRuntime()` and `AgentSessionRuntime`.
|
|
460
|
+
|
|
461
|
+
See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
|
|
462
|
+
|
|
463
|
+
### RPC Mode
|
|
464
|
+
|
|
465
|
+
For non-Node.js integrations, use RPC mode over stdin/stdout:
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
valni --mode rpc
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
RPC mode uses strict LF-delimited JSONL framing. Clients must split records on `\n` only. Do not use generic line readers like Node `readline`, which also split on Unicode separators inside JSON payloads.
|
|
472
|
+
|
|
473
|
+
See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## Philosophy
|
|
478
|
+
|
|
479
|
+
Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [valni packages](#pi-packages). This keeps the core minimal while letting you shape valni to fit how you work.
|
|
480
|
+
|
|
481
|
+
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
|
|
482
|
+
|
|
483
|
+
**No sub-agents.** There's many ways to do this. Spawn valni instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
484
|
+
|
|
485
|
+
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
486
|
+
|
|
487
|
+
**No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
|
|
488
|
+
|
|
489
|
+
**No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
|
|
490
|
+
|
|
491
|
+
**No background bash.** Use tmux. Full observability, direct interaction.
|
|
492
|
+
|
|
493
|
+
Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## CLI Reference
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
valni [options] [@files...] [messages...]
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Package Commands
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
valni install <source> [-l] # Install package, -l for project-local
|
|
507
|
+
valni remove <source> [-l] # Remove package
|
|
508
|
+
valni uninstall <source> [-l] # Alias for remove
|
|
509
|
+
valni update [source] # Update all packages, or one package source
|
|
510
|
+
valni update --extensions # Update all packages
|
|
511
|
+
valni update --extension <src> # Update one package
|
|
512
|
+
valni list # List installed packages
|
|
513
|
+
valni config # Enable/disable package resources
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
`valni config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `valni update` never prompts for project trust.
|
|
517
|
+
|
|
518
|
+
### Modes
|
|
519
|
+
|
|
520
|
+
| Flag | Description |
|
|
521
|
+
|------|-------------|
|
|
522
|
+
| (default) | Interactive mode |
|
|
523
|
+
| `-p`, `--print` | Print response and exit |
|
|
524
|
+
| `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
|
|
525
|
+
| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
|
|
526
|
+
| `--export <in> [out]` | Export session to HTML |
|
|
527
|
+
|
|
528
|
+
In print mode, valni also reads piped stdin and merges it into the initial prompt:
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
cat README.md | valni -p "Summarize this text"
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### Model Options
|
|
535
|
+
|
|
536
|
+
| Option | Description |
|
|
537
|
+
|--------|-------------|
|
|
538
|
+
| `--provider <name>` | Provider (anthropic, openai, google, etc.) |
|
|
539
|
+
| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
|
|
540
|
+
| `--api-key <key>` | API key (overrides env vars) |
|
|
541
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
542
|
+
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
543
|
+
| `--list-models [search]` | List available models |
|
|
544
|
+
|
|
545
|
+
### Session Options
|
|
546
|
+
|
|
547
|
+
| Option | Description |
|
|
548
|
+
|--------|-------------|
|
|
549
|
+
| `-c`, `--continue` | Continue most recent session |
|
|
550
|
+
| `-r`, `--resume` | Browse and select session |
|
|
551
|
+
| `--session <path\|id>` | Use specific session file or partial UUID |
|
|
552
|
+
| `--fork <path\|id>` | Fork specific session file or partial UUID into a new session |
|
|
553
|
+
| `--session-dir <dir>` | Custom session storage directory |
|
|
554
|
+
| `--no-session` | Ephemeral mode (don't save) |
|
|
555
|
+
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
556
|
+
|
|
557
|
+
### Tool Options
|
|
558
|
+
|
|
559
|
+
| Option | Description |
|
|
560
|
+
|--------|-------------|
|
|
561
|
+
| `--tools <list>`, `-t <list>` | Allowlist specific tool names across built-in, extension, and custom tools |
|
|
562
|
+
| `--exclude-tools <list>`, `-xt <list>` | Disable specific tool names across built-in, extension, and custom tools |
|
|
563
|
+
| `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
|
|
564
|
+
| `--no-tools`, `-nt` | Disable all tools by default |
|
|
565
|
+
|
|
566
|
+
Available built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
|
|
567
|
+
|
|
568
|
+
### Resource Options
|
|
569
|
+
|
|
570
|
+
| Option | Description |
|
|
571
|
+
|--------|-------------|
|
|
572
|
+
| `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
|
|
573
|
+
| `--no-extensions` | Disable extension discovery |
|
|
574
|
+
| `--skill <path>` | Load skill (repeatable) |
|
|
575
|
+
| `--no-skills` | Disable skill discovery |
|
|
576
|
+
| `--prompt-template <path>` | Load prompt template (repeatable) |
|
|
577
|
+
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
578
|
+
| `--theme <path>` | Load theme (repeatable) |
|
|
579
|
+
| `--no-themes` | Disable theme discovery |
|
|
580
|
+
| `--no-context-files`, `-nc` | Disable AGENTS.md and CLAUDE.md context file discovery |
|
|
581
|
+
|
|
582
|
+
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
|
|
583
|
+
|
|
584
|
+
### Other Options
|
|
585
|
+
|
|
586
|
+
| Option | Description |
|
|
587
|
+
|--------|-------------|
|
|
588
|
+
| `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
|
|
589
|
+
| `--append-system-prompt <text>` | Append to system prompt |
|
|
590
|
+
| `--verbose` | Force verbose startup |
|
|
591
|
+
| `-a`, `--approve` | Trust project-local files for this run |
|
|
592
|
+
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
593
|
+
| `-h`, `--help` | Show help |
|
|
594
|
+
| `-v`, `--version` | Show version |
|
|
595
|
+
|
|
596
|
+
### File Arguments
|
|
597
|
+
|
|
598
|
+
Prefix files with `@` to include in the message:
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
valni @prompt.md "Answer this"
|
|
602
|
+
valni -p @screenshot.png "What's in this image?"
|
|
603
|
+
valni @code.ts @test.ts "Review these files"
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### Examples
|
|
607
|
+
|
|
608
|
+
```bash
|
|
609
|
+
# Interactive with initial prompt
|
|
610
|
+
valni "List all .ts files in src/"
|
|
611
|
+
|
|
612
|
+
# Non-interactive
|
|
613
|
+
valni -p "Summarize this codebase"
|
|
614
|
+
|
|
615
|
+
# Non-interactive with piped stdin
|
|
616
|
+
cat README.md | valni -p "Summarize this text"
|
|
617
|
+
|
|
618
|
+
# Named one-shot session
|
|
619
|
+
valni --name "release audit" -p "Audit this repository"
|
|
620
|
+
|
|
621
|
+
# Different model
|
|
622
|
+
valni --provider openai --model gpt-4o "Help me refactor"
|
|
623
|
+
|
|
624
|
+
# Model with provider prefix (no --provider needed)
|
|
625
|
+
valni --model openai/gpt-4o "Help me refactor"
|
|
626
|
+
|
|
627
|
+
# Model with thinking level shorthand
|
|
628
|
+
valni --model sonnet:high "Solve this complex problem"
|
|
629
|
+
|
|
630
|
+
# Limit model cycling
|
|
631
|
+
valni --models "claude-*,gpt-4o"
|
|
632
|
+
|
|
633
|
+
# Read-only mode
|
|
634
|
+
valni --tools read,grep,find,ls -p "Review the code"
|
|
635
|
+
|
|
636
|
+
# Disable one extension or built-in tool while keeping the rest available
|
|
637
|
+
valni --exclude-tools ask_question
|
|
638
|
+
|
|
639
|
+
# High thinking level
|
|
640
|
+
valni --thinking high "Solve this complex problem"
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
### Environment Variables
|
|
644
|
+
|
|
645
|
+
| Variable | Description |
|
|
646
|
+
|----------|-------------|
|
|
647
|
+
| `VALNI_CODING_AGENT_DIR` | Override config directory (default: `~/.valni/agent`) |
|
|
648
|
+
| `VALNI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
|
|
649
|
+
| `VALNI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
|
|
650
|
+
| `VALNI_OFFLINE` | Disable startup network operations, including package update checks |
|
|
651
|
+
| `VALNI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
|
|
652
|
+
| `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
|
|
653
|
+
|
|
654
|
+
---
|
|
655
|
+
|
|
656
|
+
## Contributing & Development
|
|
657
|
+
|
|
658
|
+
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
|
|
659
|
+
|
|
660
|
+
## License
|
|
661
|
+
|
|
662
|
+
MIT
|
|
663
|
+
|
|
664
|
+
## See Also
|
|
665
|
+
|
|
666
|
+
- [@valni/ai](https://www.npmjs.com/package/@valni/ai): Core LLM toolkit
|
|
667
|
+
- [@valni/agent-core](https://www.npmjs.com/package/@valni/agent-core): Agent framework
|
|
668
|
+
- [@valni/tui](https://www.npmjs.com/package/@valni/tui): Terminal UI components
|
|
669
|
+
|
|
670
|
+
<p align="center">
|
|
671
|
+
<a href="https://pi.dev">pi.dev</a> domain graciously donated by
|
|
672
|
+
<br /><br />
|
|
673
|
+
<a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
|
|
674
|
+
</p>
|
|
Binary file
|