v0.3.41 9fa3d04

README.md RawHistoryFolder

clock — example zot extension (Node, no dependencies)

A minimal TypeScript-style extension showing the wire protocol from the Node side without any SDK. Pure stdlib (readline, process).

Requirements

Node 18 or newer (uses ESM). No npm install step.

Install

From this directory:

zot ext install .

This copies the manifest + script into $ZOT_HOME/extensions/clock/. zot picks it up the next time you launch the TUI.

Use

In zot:

  • /now — extension pushes a styled note showing local and ISO time (no model call)
  • /uptime — extension asks the agent to comment on how long the clock extension has been running
  • /uptime caching — same, but the agent's comment is steered by the trailing args

Why JavaScript and not TypeScript

The file uses JSDoc types (@typedef, @param) so it type-checks under tsc --checkJs without a build step. Authentic TypeScript authoring works too — rename index.js → index.ts, install tsx, and update extension.json:

{
  "exec": "npx",
  "args": ["-y", "tsx", "./index.ts"]
}

zot doesn't care which one you use; it just spawns whatever exec points at and reads/writes JSON lines on its stdio.

See also

  • examples/extensions/hello — Go version using the packages/agent/ext SDK
  • docs/extensions.md — full protocol reference
source
1# clock — example zot extension (Node, no dependencies)
2
3A minimal TypeScript-style extension showing the wire protocol from
4the Node side without any SDK. Pure stdlib (`readline`, `process`).
5
6## Requirements
7
8Node 18 or newer (uses ESM). No `npm install` step.
9
10## Install
11
12From this directory:
13
14```bash
15zot ext install .
16```
17
18This copies the manifest + script into `$ZOT_HOME/extensions/clock/`.
19zot picks it up the next time you launch the TUI.
20
21## Use
22
23In zot:
24
25- `/now`              — extension pushes a styled note showing local
26                        and ISO time (no model call)
27- `/uptime`           — extension asks the agent to comment on how
28                        long the clock extension has been running
29- `/uptime caching`   — same, but the agent's comment is steered by
30                        the trailing args
31
32## Why JavaScript and not TypeScript
33
34The file uses JSDoc types (`@typedef`, `@param`) so it type-checks
35under `tsc --checkJs` without a build step. Authentic TypeScript
36authoring works too — rename `index.js` → `index.ts`, install
37[`tsx`](https://www.npmjs.com/package/tsx), and update
38`extension.json`:
39
40```json
41{
42  "exec": "npx",
43  "args": ["-y", "tsx", "./index.ts"]
44}
45```
46
47zot doesn't care which one you use; it just spawns whatever `exec`
48points at and reads/writes JSON lines on its stdio.
49
50## See also
51
52- `examples/extensions/hello` — Go version using the `packages/agent/ext` SDK
53- `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