@diffexai/diffex 0.2.4 → 0.2.6
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 +12 -0
- package/README.md +1 -1
- package/dist/AGENTS.md +0 -11
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +3 -10
- package/dist/core/sdk.js +1 -1
- package/dist/core/system-prompt-production.d.ts +7 -0
- package/dist/core/system-prompt-production.js +102 -0
- package/dist/core/system-prompt.d.ts +2 -2
- package/dist/core/system-prompt.js +34 -35
- package/dist/core/tools/subagents.js +22 -9
- package/dist/modes/print-mode.js +12 -14
- package/dist/node_modules/@diffexai/diffex-agent-core/distribution-components.json +4 -4
- package/dist/node_modules/@diffexai/diffex-agent-core/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-agent-core/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/fireworks.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/mistral.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/nvidia.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@diffexai/diffex-ai/distribution-components.json +3 -3
- package/dist/node_modules/@diffexai/diffex-ai/distribution-files.json +11 -11
- package/dist/node_modules/@diffexai/diffex-ai/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-client/distribution-components.json +3 -3
- package/dist/node_modules/@diffexai/diffex-client/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-client/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-harness-state/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-harness-state/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-harness-state/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-protocol/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-protocol/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-protocol/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-telemetry/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-telemetry/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-telemetry/package.json +1 -1
- package/dist/node_modules/@diffexai/diffex-tui/distribution-components.json +2 -2
- package/dist/node_modules/@diffexai/diffex-tui/distribution-files.json +1 -1
- package/dist/node_modules/@diffexai/diffex-tui/package.json +1 -1
- package/dist/server/create-harness.js +1 -1
- package/distribution-components.json +11 -11
- package/distribution-files.json +49 -41
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -31
- package/release/distribution-manifest.json +4 -4
- package/release/install-package-lock.json +5 -5
- package/release/install-package.json +2 -2
- package/docs/compaction.md +0 -401
- package/docs/containerization.md +0 -84
- package/docs/custom-provider.md +0 -774
- package/docs/environment-variables.md +0 -88
- package/docs/evolution.md +0 -90
- package/docs/extensions.md +0 -2982
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/installation.md +0 -118
- package/docs/json.md +0 -91
- package/docs/keybindings.md +0 -241
- package/docs/llama-cpp.md +0 -99
- package/docs/models.md +0 -565
- package/docs/packages.md +0 -232
- package/docs/prompt-templates.md +0 -96
- package/docs/providers.md +0 -317
- package/docs/quickstart.md +0 -161
- package/docs/rpc.md +0 -1647
- package/docs/sdk.md +0 -1332
- package/docs/security.md +0 -66
- package/docs/session-format.md +0 -438
- package/docs/sessions.md +0 -162
- package/docs/settings.md +0 -341
- package/docs/shell-aliases.md +0 -13
- package/docs/skills.md +0 -227
- package/docs/terminal-setup.md +0 -152
- package/docs/themes.md +0 -326
- package/docs/tmux.md +0 -63
- package/docs/tui.md +0 -940
- package/docs/usage.md +0 -434
package/docs/usage.md
DELETED
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
# Using Diffex
|
|
2
|
-
|
|
3
|
-
This page collects day-to-day usage details that do not fit on the quickstart page.
|
|
4
|
-
|
|
5
|
-
## Interactive Mode
|
|
6
|
-
|
|
7
|
-
<p align="center"><img src="images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
8
|
-
|
|
9
|
-
The interface has four main areas:
|
|
10
|
-
|
|
11
|
-
- **Startup header** - shortcuts, loaded context files, prompt templates, skills, and extensions
|
|
12
|
-
- **Messages** - user messages, assistant responses, tool calls, tool results, notifications, errors, and extension UI
|
|
13
|
-
- **Editor** - where you type; border color indicates the current thinking level
|
|
14
|
-
- **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model. Totals include assistant responses, usage reported by tools, and summary generation.
|
|
15
|
-
|
|
16
|
-
The editor can be replaced temporarily by built-in UI such as `/settings` or by custom extension UI.
|
|
17
|
-
|
|
18
|
-
### Editor Features
|
|
19
|
-
|
|
20
|
-
| Feature | How |
|
|
21
|
-
|---------|-----|
|
|
22
|
-
| File reference | Type `@` to fuzzy-search project files |
|
|
23
|
-
| Path completion | Press Tab to complete paths |
|
|
24
|
-
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
|
-
| Copy response | Ctrl+X copies the last assistant message; in `/tree`, it copies the selected message |
|
|
26
|
-
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
27
|
-
| Shell command | `!command` runs and sends output to the model |
|
|
28
|
-
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
29
|
-
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
30
|
-
|
|
31
|
-
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
32
|
-
|
|
33
|
-
## Slash Commands
|
|
34
|
-
|
|
35
|
-
Type `/` in the editor to open command completion. Extensions can register custom commands, skills are referenced through `/skills`, and prompt templates expand via `/templatename`.
|
|
36
|
-
|
|
37
|
-
| Command | Description |
|
|
38
|
-
|---------|-------------|
|
|
39
|
-
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
40
|
-
| [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
41
|
-
| `/model` | Select a model, then its thinking level |
|
|
42
|
-
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
43
|
-
| `/settings` | Theme, installed skills, message delivery, transport |
|
|
44
|
-
| `/plan [request]` | Enter Plan mode, optionally submitting a planning request |
|
|
45
|
-
| `/skills` | Browse installed workspace, installed global, and evolved skills |
|
|
46
|
-
| [`/evolve`](evolution.md) | Inspect and control harness evolution and generated skills |
|
|
47
|
-
| [`/version`](evolution.md#controls) | Select the active harness revision |
|
|
48
|
-
| `/resume` | Pick from previous sessions |
|
|
49
|
-
| `/new` | Start a new session |
|
|
50
|
-
| `/name <name>` | Set session display name |
|
|
51
|
-
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
52
|
-
| `/subagents` | Show all sub-agents in the current session |
|
|
53
|
-
| `/tree` | Jump to any point in the session and continue from there |
|
|
54
|
-
| `/trust` | Save project trust decision for future sessions |
|
|
55
|
-
| `/fork` | Create a new session from a previous user message |
|
|
56
|
-
| `/clone` | Duplicate the current active branch into a new session |
|
|
57
|
-
| `/compact [prompt]` | Manually compact context, optionally with custom instructions |
|
|
58
|
-
| `/copy` | Copy last assistant message to clipboard |
|
|
59
|
-
| `/export [file]` | Export session to HTML or JSONL |
|
|
60
|
-
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
61
|
-
| `/share` | Upload as a secret GitHub Gist and return its direct URL |
|
|
62
|
-
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
63
|
-
| `/hotkeys` | Show all keyboard shortcuts |
|
|
64
|
-
| `/changelog` | Display version history |
|
|
65
|
-
| `/quit` | Quit Diffex |
|
|
66
|
-
|
|
67
|
-
`/subagents` runs immediately, including while the parent agent is working or compacting.
|
|
68
|
-
It displays the current in-memory roster without adding the command or roster to model context.
|
|
69
|
-
|
|
70
|
-
## Plan Mode
|
|
71
|
-
|
|
72
|
-
Plan mode is an interactive collaboration mode for researching and producing a decision-complete implementation plan without carrying it out. Press Shift+Tab to toggle between Default and Plan, run `/plan` to enter Plan mode idempotently, or run `/plan <request>` to enter it and submit the request through the normal prompt or queue path. The built-in footer shows `Plan mode`; an additional indicator remains visible when an extension supplies a custom footer. Mode changes require an idle session and are rejected during prompt admission, an active response or retry, compaction or branch summarization, harness switching, another transition, or a direct Bash command.
|
|
73
|
-
|
|
74
|
-
### Planning policy and tools
|
|
75
|
-
|
|
76
|
-
In Plan mode, the model must inspect available evidence before asking questions, distinguish discoverable facts from user preferences, and avoid implementation or repository mutations. Before asking, it explains the relevant context, why the decision is needed, and how the answer changes the plan.
|
|
77
|
-
|
|
78
|
-
The model-visible tool surface is restricted to the invocation's permitted, trusted pre-extension implementations of:
|
|
79
|
-
|
|
80
|
-
- `read`
|
|
81
|
-
- `grep`
|
|
82
|
-
- `find`
|
|
83
|
-
- `ls`
|
|
84
|
-
- Diffex's built-in `request_user_input`, when allowed
|
|
85
|
-
|
|
86
|
-
Tool allowlists and exclusions still apply, so a filtered or unavailable tool is not restored by Plan mode. Post-base replacements, extension and custom tools, `bash`, `edit`, `write`, `update_plan`, and sub-agent tools are unavailable to the model. Returning to Default restores the latest requested Default tool set.
|
|
87
|
-
|
|
88
|
-
This restriction is a model-tool boundary, not a filesystem security sandbox. Direct user `!` commands, extension event side effects, operating-system permissions, and external processes remain outside it.
|
|
89
|
-
|
|
90
|
-
Each logical run captures its collaboration mode. Plan runs also retain their admitted planning prompt and exact trusted tool implementations through continuations and retries. Default mode keeps its existing dynamic prompt and tool refresh behavior.
|
|
91
|
-
|
|
92
|
-
### Structured questions
|
|
93
|
-
|
|
94
|
-
For a material choice that fits meaningful alternatives, the model can use `request_user_input` with one to three questions. Each question shows two or three mutually exclusive model-supplied choices with descriptions and one Diffex-supplied **Other** choice. The recommended alternative appears first with `(Recommended)` in its label. Selecting **Other** opens free-form input; blank answers are rejected. Answers are preserved while moving among questions, and submission becomes available after every question is answered.
|
|
95
|
-
|
|
96
|
-
Cancelling the dialog returns a non-fatal cancelled result to the model and leaves Plan mode active. When `request_user_input` is filtered out, unavailable, or unsuitable for the question, the model asks an ordinary conversational question instead.
|
|
97
|
-
|
|
98
|
-
### Final plan and implementation handoff
|
|
99
|
-
|
|
100
|
-
The official plan must use exactly one pair of delimiters in one assistant text item:
|
|
101
|
-
|
|
102
|
-
<proposed_plan>
|
|
103
|
-
# Plan
|
|
104
|
-
|
|
105
|
-
1. First implementation step
|
|
106
|
-
</proposed_plan>
|
|
107
|
-
|
|
108
|
-
The opening and closing tags must each be alone on their line, unindented, outside backtick or tilde fenced code, in that order, with non-whitespace plan content between them. The response must finish normally. Ordinary text may appear before or after the block. Invalid, repeated, nested, reversed, unclosed, fenced, or otherwise non-exact markup remains ordinary assistant text and is not eligible for a handoff.
|
|
109
|
-
|
|
110
|
-
For a valid response, Diffex removes only the two tag lines before normal display and session storage. The plan Markdown and any surrounding text remain unchanged. The extracted handoff state is temporary and is not reconstructed from session history.
|
|
111
|
-
|
|
112
|
-
After the latest eligible live response settles, Diffex offers exactly:
|
|
113
|
-
|
|
114
|
-
- **Implement the plan** - switch to Default and submit `Implement the plan.` in the same session
|
|
115
|
-
- **Stay in Plan mode** - dismiss the offer without changing mode
|
|
116
|
-
|
|
117
|
-
Steering, follow-up, next-turn, or compaction-queued input permanently suppresses that completion's offer and continues through the existing queue path. An unrelated modal defers at most one offer until it closes. A user submission, navigation, session replacement, mode change, or new model run (including an extension-submitted run) clears the older offer, and historical plans do not replay it.
|
|
118
|
-
|
|
119
|
-
Diffex clears the older offer synchronously when a new prompt is admitted, before any awaited input hook or model startup, even if an extension handles the request without starting a model run. It rechecks the complete mode-transition busy state before showing or accepting an offer. Temporary activity defers it until idle; accepting during a busy operation does not change mode or submit the implementation message. This includes prompt admission, harness switching, and the entire direct Bash command, even while an extension's `user_bash` hook is still awaiting its result.
|
|
120
|
-
|
|
121
|
-
If the fixed implementation submission fails after switching modes, Diffex stays in Default, shows the error, and restores exactly `Implement the plan.` to the editor for retry. It does not roll back to Plan mode.
|
|
122
|
-
|
|
123
|
-
### Persistence and scope
|
|
124
|
-
|
|
125
|
-
Collaboration mode is stored as an interactive preference on the selected session branch. Interactive resume, fork, and `/tree` navigation inspect the newest matching preference on that branch and restore it when valid. A new session, a branch without a preference, or a malformed newest matching preference uses Default without reviving an older entry.
|
|
126
|
-
|
|
127
|
-
Mode entries follow normal lazy session saving. In a new disk-backed session, toggling modes alone does not create the session file: the preference remains in memory until the first assistant message is saved or the session is explicitly persisted. Once the file exists, subsequent mode changes are written immediately. Ephemeral sessions remain in memory only.
|
|
128
|
-
|
|
129
|
-
Print, JSON, RPC, and SDK invocations always use Default and do not overwrite the saved interactive preference. User wording alone cannot change collaboration mode.
|
|
130
|
-
|
|
131
|
-
Plan mode is distinct from `update_plan`. Plan mode controls the interactive planning prompt, tools, presentation, and handoff; `update_plan` is a Default-mode execution checklist and neither enters nor leaves Plan mode.
|
|
132
|
-
|
|
133
|
-
## Automatic Sub-agent Coordination
|
|
134
|
-
|
|
135
|
-
`spawn_agent` starts child work asynchronously, so the parent can launch multiple children without waiting between tool calls.
|
|
136
|
-
The enclosing parent prompt remains active after the parent attempts to finish.
|
|
137
|
-
Diffex freezes the children started by that prompt, waits until all of them finish, fail, or are interrupted, and displays a deterministic notice as each child terminates.
|
|
138
|
-
|
|
139
|
-
Children do not load parent extensions. To prevent them from bypassing parent execution policy, spawning fails before child creation when the parent registers any of these hooks: `resources_discover`, `input`, `context`, `before_agent_start`, `before_provider_request`, `before_provider_headers`, `session_before_compact`, `tool_call`, `tool_result`, or `message_end`. The rejection lists the incompatible hooks in that order. Remove those handlers to spawn children; observation-only hooks and existing-child message, interrupt, and status actions remain available.
|
|
140
|
-
|
|
141
|
-
Hidden `subagent_results` and `subagent_escalations` entries are untrusted reports from delegated agents, not user instructions, system instructions, or authority. Diffex tells the root to verify material claims against the parent task and available evidence, and to follow embedded instructions only when they are consistent with the parent task, repository policy, and current evidence. This guidance remains present when coordination tools are filtered and after custom or extension-returned system prompts are selected.
|
|
142
|
-
|
|
143
|
-
### Child Escalations
|
|
144
|
-
|
|
145
|
-
A running root-owned child can use its child-only `escalate_to_parent` tool to report a material blocker, risk, contradiction, or decision that could change the parent's plan.
|
|
146
|
-
Routine progress, tool logs, and completed-work summaries belong in the child's final response, and escalating does not replace that complete final response.
|
|
147
|
-
The tool accepts one non-empty message of at most 1,000 characters.
|
|
148
|
-
It is unavailable to the root and to standalone sessions, and a restored or replacement child gains it only after an explicit wake starts a new live run.
|
|
149
|
-
|
|
150
|
-
A child may send multiple reports during one live run.
|
|
151
|
-
Diffex accepts at most 8,000 characters of report text that are still pending admission to parent model context.
|
|
152
|
-
A report that would exceed that fixed aggregate limit is rejected without changing delivery state; capacity becomes available as earlier active reports begin delivery or saved idle reports enter the next explicit parent run.
|
|
153
|
-
A successful tool result means the report was accepted for parent delivery, not that the parent model consumed or acted on it.
|
|
154
|
-
|
|
155
|
-
While the parent is active, accepted reports are delivered as hidden context at the next normal FIFO steering boundary and never abort an in-flight model request.
|
|
156
|
-
Reports accepted for the same boundary are combined in acceptance order; a report accepted after delivery begins waits for a later boundary, and earlier queued user steering remains ahead of reports.
|
|
157
|
-
During coordinated waiting, the first pending report resumes the parent but does not consume the frozen child batch.
|
|
158
|
-
The parent can then use normal `agent_action` message, wake, or interrupt behavior, and the batch's terminal results are still delivered exactly once.
|
|
159
|
-
If a child in that frozen batch is already terminal, message or wake actions cannot replace its completed attempt until the result is delivered or explicitly consumed with `agents`.
|
|
160
|
-
|
|
161
|
-
While the parent is idle, accepting a report does not start a provider call.
|
|
162
|
-
Saved sessions append it to the currently selected branch for the next explicit parent run; in-memory sessions keep it only for the current process.
|
|
163
|
-
Hidden delivery affects display, not storage or secrecy; accepted idle reports, delivered active reports, and child tool arguments remain normal session data subject to the usual parent-owned deletion behavior.
|
|
164
|
-
|
|
165
|
-
After the whole batch is terminal, Diffex gives the parent one hidden, name-sorted context message containing the child results, partial output, errors, and retry availability.
|
|
166
|
-
The parent continues automatically and produces its final response without another user prompt.
|
|
167
|
-
If the parent already retrieved a terminal result with `agents`, Diffex does not deliver that result again.
|
|
168
|
-
|
|
169
|
-
An initial failure gives the parent one opportunity to send a corrective `agent_action` message with `wake: true`.
|
|
170
|
-
Only one coordinated retry is allowed per child during the current user prompt.
|
|
171
|
-
The parent may decline the retry, and a later explicit user prompt starts a fresh retry cycle.
|
|
172
|
-
|
|
173
|
-
While Diffex waits, the status indicator remains active and steering or follow-up input stays queued.
|
|
174
|
-
Press Escape to restore queued input to the editor and interrupt unfinished children in the frozen batch.
|
|
175
|
-
Diffex displays interrupted notices and settles without making another parent model call.
|
|
176
|
-
|
|
177
|
-
Completion notices use assistant styling, but are not conversation messages.
|
|
178
|
-
They are not persisted or included in model context.
|
|
179
|
-
JSON and RPC modes emit the same notices as structured session events.
|
|
180
|
-
|
|
181
|
-
## Message Queue
|
|
182
|
-
|
|
183
|
-
You can submit messages while the agent is still working:
|
|
184
|
-
|
|
185
|
-
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
186
|
-
- **Alt+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
187
|
-
- **Escape** aborts and restores queued messages to the editor.
|
|
188
|
-
- **Alt+Up** retrieves queued messages back to the editor.
|
|
189
|
-
|
|
190
|
-
On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want Diffex to receive the shortcut.
|
|
191
|
-
|
|
192
|
-
Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
|
|
193
|
-
|
|
194
|
-
## Harness Evolution
|
|
195
|
-
|
|
196
|
-
`/evolve` shows evidence eligibility, jobs, memory proposals, generated skill candidates, provenance, draft diffs, validation, evaluation, target revisions, activation, and rollback. `/version` selects a complete immutable harness revision. Memory and evolved skills change together at the next prompt boundary; in-flight and admitted queued requests remain pinned. An active evolution job continues from its frozen base if the selected revision changes. The footer shows the active harness and background activity. See [Harness Evolution](evolution.md).
|
|
197
|
-
|
|
198
|
-
## Sessions
|
|
199
|
-
|
|
200
|
-
Sessions are saved automatically to `~/.diffex/agent/sessions/`, organized by working directory.
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
diffex -c # Continue most recent session
|
|
204
|
-
diffex -r # Browse and select a session
|
|
205
|
-
diffex --no-session # Ephemeral mode; do not save
|
|
206
|
-
diffex --name "my task" # Set session display name at startup
|
|
207
|
-
diffex --session <path|id> # Use a specific session file or session ID
|
|
208
|
-
diffex --fork <path|id> # Fork a session into a new session file
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
Useful session commands:
|
|
212
|
-
|
|
213
|
-
- `/session` shows the current session file and ID.
|
|
214
|
-
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
215
|
-
- `/fork` creates a new session from an earlier user message.
|
|
216
|
-
- `/clone` duplicates the current active branch into a new session file.
|
|
217
|
-
- `/compact` summarizes older messages to free context.
|
|
218
|
-
|
|
219
|
-
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
220
|
-
|
|
221
|
-
The selected collaboration mode is restored independently for the active interactive branch during resume, fork, and tree navigation. Non-interactive invocations always remain in Default and do not change that branch preference.
|
|
222
|
-
|
|
223
|
-
## Context Files
|
|
224
|
-
|
|
225
|
-
Diffex loads context files at startup in this order:
|
|
226
|
-
|
|
227
|
-
- the bundled `dist/AGENTS.md` for default instructions in production installations
|
|
228
|
-
- `~/.diffex/agent/AGENTS.md` for global instructions
|
|
229
|
-
- parent directories, from the outermost directory toward the current working directory
|
|
230
|
-
- the current directory
|
|
231
|
-
|
|
232
|
-
The bundled defaults are loaded from the installed package without creating or overwriting user or project files.
|
|
233
|
-
Use global and project instructions to customize these defaults.
|
|
234
|
-
|
|
235
|
-
If a user or project directory contains `AGENTS.override.md`, Diffex loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory.
|
|
236
|
-
Context files from other directories still layer normally.
|
|
237
|
-
|
|
238
|
-
Use context files for project conventions, commands, safety rules, and preferences.
|
|
239
|
-
Disable all context loading, including the bundled defaults, with `--no-context-files` or `-nc`.
|
|
240
|
-
|
|
241
|
-
### System Prompt Files
|
|
242
|
-
|
|
243
|
-
Replace the default system prompt with:
|
|
244
|
-
|
|
245
|
-
- `.diffex/SYSTEM.md` for a project
|
|
246
|
-
- `~/.diffex/agent/SYSTEM.md` globally
|
|
247
|
-
|
|
248
|
-
Append to the default prompt without replacing it with `APPEND_SYSTEM.md` in either location.
|
|
249
|
-
|
|
250
|
-
### Project Trust
|
|
251
|
-
|
|
252
|
-
On interactive startup, Diffex 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 `~/.diffex/agent/trust.json`. Trusting a project allows Diffex to load `.diffex/settings.json` and `.diffex` resources, install missing project packages, and execute project extensions.
|
|
253
|
-
|
|
254
|
-
Before the trust decision, Diffex 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.
|
|
255
|
-
|
|
256
|
-
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.
|
|
257
|
-
|
|
258
|
-
If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.diffex/agent/settings.json`, or change it with `/settings`.
|
|
259
|
-
|
|
260
|
-
`diffex config` and package commands use the same project trust flow, except `diffex update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
|
|
261
|
-
|
|
262
|
-
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.diffex/agent/trust.json` only; the current session is not reloaded, so restart Diffex for changes to take effect.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
## Exporting and Sharing Sessions
|
|
266
|
-
|
|
267
|
-
Use `/export [file]` to write a session to HTML.
|
|
268
|
-
|
|
269
|
-
Use `/share` to upload a secret GitHub Gist and return its direct URL.
|
|
270
|
-
Anyone with the URL can access the Gist.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
## CLI Reference
|
|
274
|
-
|
|
275
|
-
```bash
|
|
276
|
-
diffex [options] [@files...] [messages...]
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Package Commands
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
diffex install <source> [-l] # Install package, -l for project-local
|
|
283
|
-
diffex remove <source> [-l] # Remove package
|
|
284
|
-
diffex uninstall <source> [-l] # Alias for remove
|
|
285
|
-
diffex update [source|self|diffex] # Update Diffex only, or one package source
|
|
286
|
-
diffex update --all # Update Diffex and packages; reconcile pinned git refs
|
|
287
|
-
diffex update --extensions # Update packages only; reconcile pinned git refs
|
|
288
|
-
diffex update --models # Refresh model catalogs only
|
|
289
|
-
diffex update --self # Update Diffex only
|
|
290
|
-
diffex update --extension <src> # Update one package
|
|
291
|
-
diffex list # List installed packages
|
|
292
|
-
diffex config # Enable/disable package resources
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
These commands manage Diffex packages and `diffex update` can update the Diffex CLI installation. To uninstall Diffex itself, see [Quickstart](quickstart.md#uninstall). `diffex config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `diffex update` never prompts for project trust.
|
|
296
|
-
|
|
297
|
-
See [Diffex Packages](packages.md) for package sources and security notes.
|
|
298
|
-
|
|
299
|
-
### Modes
|
|
300
|
-
|
|
301
|
-
| Flag | Description |
|
|
302
|
-
|------|-------------|
|
|
303
|
-
| default | Interactive mode |
|
|
304
|
-
| `-p`, `--print` | Print response and exit |
|
|
305
|
-
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
306
|
-
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
307
|
-
| `--export <in> [out]` | Export a session to HTML |
|
|
308
|
-
|
|
309
|
-
In print mode, Diffex also reads piped stdin and merges it into the initial prompt:
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
cat README.md | diffex -p "Summarize this text"
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Model Options
|
|
316
|
-
|
|
317
|
-
| Option | Description |
|
|
318
|
-
|--------|-------------|
|
|
319
|
-
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
320
|
-
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
321
|
-
| `--api-key <key>` | API key, overriding environment variables |
|
|
322
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
323
|
-
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
324
|
-
| `--list-models [search]` | List available models |
|
|
325
|
-
|
|
326
|
-
### Session Options
|
|
327
|
-
|
|
328
|
-
| Option | Description |
|
|
329
|
-
|--------|-------------|
|
|
330
|
-
| `-c`, `--continue` | Continue the most recent session |
|
|
331
|
-
| `-r`, `--resume` | Browse and select a session |
|
|
332
|
-
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
333
|
-
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
334
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
335
|
-
| `--no-session` | Ephemeral mode; do not save |
|
|
336
|
-
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
337
|
-
|
|
338
|
-
### Tool Options
|
|
339
|
-
|
|
340
|
-
| Option | Description |
|
|
341
|
-
|--------|-------------|
|
|
342
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
343
|
-
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
344
|
-
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
345
|
-
| `--no-tools`, `-nt` | Disable all tools |
|
|
346
|
-
|
|
347
|
-
Built-in tools: `read`, `bash`, `edit`, `write`, `update_plan`, `grep`, `find`, `ls`.
|
|
348
|
-
|
|
349
|
-
### Resource Options
|
|
350
|
-
|
|
351
|
-
| Option | Description |
|
|
352
|
-
|--------|-------------|
|
|
353
|
-
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
354
|
-
| `--no-extensions` | Disable extension discovery |
|
|
355
|
-
| `--skill <path>` | Load a skill; repeatable |
|
|
356
|
-
| `--no-skills` | Disable skill discovery |
|
|
357
|
-
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
358
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
359
|
-
| `--theme <path>` | Load a theme; repeatable |
|
|
360
|
-
| `--no-themes` | Disable theme discovery |
|
|
361
|
-
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
362
|
-
|
|
363
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
diffex --no-extensions -e ./my-extension.ts
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Other Options
|
|
370
|
-
|
|
371
|
-
| Option | Description |
|
|
372
|
-
|--------|-------------|
|
|
373
|
-
| `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
|
|
374
|
-
| `--append-system-prompt <text>` | Append to system prompt |
|
|
375
|
-
| `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
|
|
376
|
-
| `--verbose` | Force verbose startup |
|
|
377
|
-
| `-a`, `--approve` | Trust project-local files for this run |
|
|
378
|
-
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
379
|
-
| `-h`, `--help` | Show help |
|
|
380
|
-
| `-v`, `--version` | Show version |
|
|
381
|
-
|
|
382
|
-
In `fullscreen` mode, the transcript scrolls inside the terminal viewport while queued messages, working status, extension widgets, editor, and footer remain fixed at the bottom. Mouse/trackpad input scrolls the region under the pointer; keyboard viewport actions always remain available. Inline images work in terminals that support the Kitty graphics protocol, including Kitty and Ghostty. In iTerm2 they render as text placeholders because its inline-image protocol cannot delete or crop placements during application-owned scrolling. In `regular` mode, Diffex uses the main screen and terminal-owned scrollback, and iTerm2 inline images continue to render normally.
|
|
383
|
-
|
|
384
|
-
Set **TUI mode** in `/settings` to switch between `regular` and `fullscreen` immediately and choose the default for future sessions.
|
|
385
|
-
|
|
386
|
-
### File Arguments
|
|
387
|
-
|
|
388
|
-
Prefix files with `@` to include them in the message:
|
|
389
|
-
|
|
390
|
-
```bash
|
|
391
|
-
diffex @prompt.md "Answer this"
|
|
392
|
-
diffex -p @screenshot.png "What's in this image?"
|
|
393
|
-
diffex @code.ts @test.ts "Review these files"
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
### Examples
|
|
397
|
-
|
|
398
|
-
```bash
|
|
399
|
-
# Interactive with initial prompt
|
|
400
|
-
diffex "List all .ts files in src/"
|
|
401
|
-
|
|
402
|
-
# Non-interactive
|
|
403
|
-
diffex -p "Summarize this codebase"
|
|
404
|
-
|
|
405
|
-
# Non-interactive with piped stdin
|
|
406
|
-
cat README.md | diffex -p "Summarize this text"
|
|
407
|
-
|
|
408
|
-
# Named one-shot session
|
|
409
|
-
diffex --name "release audit" -p "Audit this repository"
|
|
410
|
-
|
|
411
|
-
# Different model
|
|
412
|
-
diffex --provider openai --model gpt-4o "Help me refactor"
|
|
413
|
-
|
|
414
|
-
# Model with provider prefix
|
|
415
|
-
diffex --model openai/gpt-4o "Help me refactor"
|
|
416
|
-
|
|
417
|
-
# Model with thinking level shorthand
|
|
418
|
-
diffex --model sonnet:high "Solve this complex problem"
|
|
419
|
-
|
|
420
|
-
# Limit model cycling
|
|
421
|
-
diffex --models "claude-*,gpt-4o"
|
|
422
|
-
|
|
423
|
-
# Read-only mode
|
|
424
|
-
diffex --tools read,grep,find,ls -p "Review the code"
|
|
425
|
-
|
|
426
|
-
# Disable one extension or built-in tool while keeping the rest available
|
|
427
|
-
diffex --exclude-tools ask_question
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
## Design Principles
|
|
431
|
-
|
|
432
|
-
Diffex keeps the core small and pushes specialized workflow behavior into extensions, skills, prompt templates, and packages.
|
|
433
|
-
|
|
434
|
-
It includes a focused interactive Plan mode, while `update_plan` remains only a lightweight execution checklist. Diffex intentionally does not include built-in MCP, permission popups, persistent to-dos, or background bash. You can build or install different approval and planning workflows as extensions or packages, or use external tools such as containers and tmux.
|