v0.1.18 9afd123

README.md RawHistoryFolder

scratchpad — example zot extension (TypeScript, source-run)

Real .ts (not .js), no build step, no SDK. Runs via npx -y tsx ./index.ts, which downloads tsx into npm's cache on first invocation and then reuses the cached copy on subsequent runs.

Demonstrates:

  • registering slash commands (/note, /notes, /clear-notes)
  • registering an LLM-callable tool (read_notes)
  • the wire protocol from a typed TypeScript perspective
  • running TypeScript via npx tsx from extension.json

Requirements

Node 18+ and npx (bundled with npm).

Install

From this directory:

zot ext install .

This copies the manifest + source into $ZOT_HOME/extensions/scratchpad/.

Use

In zot:

  • /note remind me to update the changelog — appends to the scratchpad
  • /notes — shows everything stored
  • /clear-notes — wipes the scratchpad

The model also has a read_notes tool. Ask it:

"What did I tell you to remember?"

…and it will call the tool and tell you.

Storage

Notes persist as JSONL at <cwd>/.zot/scratchpad-notes.jsonl. The file is created on first /note and survives zot restarts. Each line is one note: {"at":"2026-04-19T13:00:00.000Z","text":"..."}.

Scope is per-project: switching to a different cwd gives you a different scratchpad. Cross-project sharing isn't supported in this example (would just be a matter of changing the path constant).

Why TypeScript here

The extension protocol is small enough that you can hand-write it in any language. JS works fine; TS adds type safety on the frame shapes without any infrastructure beyond tsx. If you want richer ergonomics (decorators, schema-from-types), publish your own SDK on top.

See also

  • examples/extensions/clock — JavaScript sibling (no build step)
  • examples/extensions/hello — Go SDK slash commands
  • examples/extensions/weather — Go SDK tool example
  • examples/extensions/guard — Go SDK intercept example
  • examples/extensions/todo — interactive panel example
  • docs/extensions.md — full protocol reference
source
1# scratchpad — example zot extension (TypeScript, source-run)
2
3Real `.ts` (not `.js`), no build step, no SDK. Runs via `npx -y tsx
4./index.ts`, which downloads `tsx` into npm's cache on first
5invocation and then reuses the cached copy on subsequent runs.
6
7Demonstrates:
8
9- registering slash commands (`/note`, `/notes`, `/clear-notes`)
10- registering an LLM-callable tool (`read_notes`)
11- the wire protocol from a typed TypeScript perspective
12- running TypeScript via `npx tsx` from `extension.json`
13
14## Requirements
15
16Node 18+ and `npx` (bundled with npm).
17
18## Install
19
20From this directory:
21
22```bash
23zot ext install .
24```
25
26This copies the manifest + source into `$ZOT_HOME/extensions/scratchpad/`.
27
28## Use
29
30In zot:
31
32- `/note remind me to update the changelog`  — appends to the scratchpad
33- `/notes`                                    — shows everything stored
34- `/clear-notes`                              — wipes the scratchpad
35
36The model also has a `read_notes` tool. Ask it:
37
38> "What did I tell you to remember?"
39
40…and it will call the tool and tell you.
41
42## Storage
43
44Notes persist as JSONL at `<cwd>/.zot/scratchpad-notes.jsonl`. The
45file is created on first `/note` and survives zot restarts. Each line
46is one note: `{"at":"2026-04-19T13:00:00.000Z","text":"..."}`.
47
48Scope is per-project: switching to a different cwd gives you a
49different scratchpad. Cross-project sharing isn't supported in this
50example (would just be a matter of changing the path constant).
51
52## Why TypeScript here
53
54The extension protocol is small enough that you can hand-write it in
55any language. JS works fine; TS adds type safety on the frame shapes
56without any infrastructure beyond `tsx`. If you want richer ergonomics
57(decorators, schema-from-types), publish your own SDK on top.
58
59## See also
60
61- `examples/extensions/clock` — JavaScript sibling (no build step)
62- `examples/extensions/hello` — Go SDK slash commands
63- `examples/extensions/weather` — Go SDK tool example
64- `examples/extensions/guard` — Go SDK intercept example
65- `examples/extensions/todo` — interactive panel example
66- `docs/extensions.md` — full protocol reference

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close