Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Where things live

Path in lua/uji/What it does
boot.luaStarts uji. It reads the command line, opens the session and starts the screen.
cli.luaThe command line and uji --help.
paths.luaWhere the config, the data and the session database are.
config.luaLoads your config and plugins, and runs /reload.
packs.luauji.pack, and finding modules in your config and packs.
api/The uji.* functions in the API reference.
agent/, loop.luaRuns a turn, which sends the conversation, runs tools, compacts and picks a title.
prompt.luaThe system prompt.
model.lua, catalog.lua, providers/Providers, models and choosing between them.
wires/The request format of each provider API.
tools/read_file, edit_file, write_file and run_command.
tool.lua, system/Registering tools, the tool policy, file access and processes.
commands/The built-in slash commands, one file each.
store/Sessions and messages in the database.
auth/API keys, auth.toml, the optional keychain and subscription sign-in.
ui/Draws the screen, with its layout, windows, input line, markdown, keys and theme.
ui/views/The transcript, the input line, pickers, prompts and the approval question.
images.luaAttaching images from files, pasted paths and the clipboard.
defaults.luaThe default screen and bindings that require("uji.defaults") loads.
event.lua, task.lua, plugin.lua, registry.lua, class.luaEvents, tasks, plugin ownership and the building blocks the rest is made of.
sys/require("uji.sys"), a table with a field for each Runtime module, such as fs or json. A field loads its module, uji.sys.fs or uji.sys.json, the first time it is read. uji.* falls back to the same fields for anything api/ does not define.

The Runtime modules are built into the uji program, and a module with the same name replaces any of them, as Native modules describes. Everything built on them, sys/ included, can be replaced too.