Skip to content

The Emacs model

omfp is configured the way Emacs is: by code that runs inside the live program, which you (or an agent) change and evaluate again without restarting anything.

flowchart LR
  user["~/.config/omfp/init.ts"] --> host
  ws[".omfp/init.ts"] --> host
  evals["omfp_eval (agents)"] --> host
  host["Workspace host<br/>cordis plugins"] -->|declarations| kernel["Kernel"]
  kernel --> windows["Windows: views, widgets, keys, settings"]
  reload[":reload-init"] -.->|undo, run again| host

An init file is a TypeScript module the workspace host runs as a cordis plugin. Yours, ~/.config/omfp/init.ts, loads first in every workspace; then the workspace’s .omfp/init.ts. They declare views, widgets, keys, jobs, methods for widgets, agent tools and what agents read:

// <workspace>/.omfp/init.ts
import type { Context } from "@omfp/daemon/workspace";
export default function apply(ctx: Context) {
ctx.widgets.define("tests", "./widgets/tests/index.tsx");
ctx.views.define("review", { title: "Review", layout: ["row", {}, ["tabs", { id: "main" }, "omfp:chat"], "tests"] });
ctx.keys.bind("spc g r", "view.switch", "review");
ctx.jobs.define("nightly", { schedule: "0 2 * * *", prompt: { text: "Summarize yesterday's commits." } });
}

Editing an init file does nothing by itself. :reload-init evaluates the current workspace’s init files again (:reload-init all: every workspace’s), undoing everything the previous run declared first, so reloading twice is the same as once. A failing file shows its error and declares nothing.

Agents try code in the same live host with omfp_eval: the code runs as a plugin with ctx in scope, and a later eval with the same name replaces it and undoes what it declared. Evals survive a reload of the init files, not a restart of the host; what should stay goes into init.ts.

There is no other config file: your init file (--config <dir> picks another folder, --user-init <file> another file) declares the settings with ctx.settings and the keys with ctx.keys.bind. The daemon also loads it once on its own (the user host), so daemon-wide settings apply before any workspace exists.

import type { Context } from "@omfp/daemon/workspace";
export default function apply(ctx: Context) {
ctx.settings({
ui: {
density: "normal", // compact | normal
fontSize: 17, // px, 10–28
motion: "full", // full | reduced | none
notifications: "background", // background | always | never
theme: "synth", // synth | catppuccin | gruvbox | tokyo-night | nord | solarized | rose-pine |
// graphite | paper | clay | primer | accent | matugen (the user theme below)
skin: "crush", // crush | boring: the calm, neutral look, with any theme
recentThreads: 20, // hidden threads a window keeps for instant switching, 0–100 or "all"
liveVoice: "sol", // the voice of live sessions, from the next session on
fonts: { prose: "Literata, serif" }, // prose, ui, code: CSS font families
},
// Delete threads archived this long ago (m, h, d, w), checked hourly; "never" keeps them.
daemon: { deleteArchivedAfter: "7d" },
// How deep subagents nest (1–8): 2 lets the thread's subagents start their own; read when a thread starts.
agents: { maxDepth: 2 },
});
ctx.keys.bind("Space t", "window.theme"); // normal mode; ctx.keys.bindIn("insert", …) for the other modes
ctx.keys.bind("g g", ""); // removes a default binding
}

Only your init file sets ui and daemon; a workspace’s .omfp/init.ts may set agents for that workspace. A wrong key or value fails the file and the window shows why. The full list of settings is in the agents’ reference; the daemon’s other options are command-line flags (omfp daemon --help).

Changes made from a window — :set font_size=15, :density compact, :theme, :voice, a widget added with :widget add, a tab closed, a panel an agent mounted — apply at once and last until the next :reload-init (settings also only until the daemon restarts). Nothing is written to your files: to keep one, put it in init.ts.

A user theme is the CSS file theme.css in the config folder, followed live (the matugen template in contrib/matugen makes one) and shown with :theme matugen, over Synth. omfp theme set <file> [--daemon <url>] [--token <t>] sends one to a running daemon, a remote one included, and omfp desktop --connect <url> --token <t> pushes this machine’s theme.css to the daemon it connects to.