oterm/docs/development/index.md
Yiorgis Gozadinos 97fd157160
Correct and restructure the docs
- rag_example: rewrite for current haiku.rag. The MCP server is
  `haiku-rag mcp` and opens the database read-only, so documents are
  added with the CLI; the page described `serve`, SQLite storage and
  add/delete tools that no longer exist.
- mcp: stdio servers accept cwd and inherit HOME, LOGNAME, PATH, SHELL,
  TERM and USER.
- app_config: each openaiCompatible endpoint is its own provider;
  XDG_DATA_HOME applies everywhere but Windows; list
  OTERM_OLLAMA_IMAGE_MODEL and everything under OTERM_DATA_DIR.
- commands: add Copy message, an Images section and the command-line
  options; clicking a code block copies the whole message.
- installation: document the speak extra and nix updates; drop the
  0.13.1 tap note.
- development: uv-based setup; docs are built with Zensical.
- One H1 per page; no em dashes.
- README points at the CHANGELOG; drop the stale announcement banner.
2026-09-26 16:42:42 +03:00

48 lines
1.1 KiB
Markdown

# Development & Debugging
## Inspecting logs
You can inspect basic logs from oterm by invoking the log viewer with <kbd>^ Ctrl</kbd>+<kbd>l</kbd> or by using the command palette. This is particularly useful if you want to debug tool calling.
![Log viewer](../img/log_viewer.svg)
oterm's internal log viewer showing the Brave Search MCP tool in action.
## Setup for development
```sh
git clone git@github.com:ggozad/oterm.git
cd oterm
uv sync
uv run oterm
```
Tests, linting and type checking:
```sh
uv run pytest
uv run ruff check
uv run ruff format
uv run ty check
```
### Debugging
To see oterm's log messages as they happen, start the Textual console in one terminal:
```sh
uv run textual console -x SYSTEM -x EVENT -x WORKER -x DEBUG
```
This hides most of Textual's own messages. Then start oterm in development mode in another:
```sh
uv run textual run -c --dev oterm
```
## Documentation
oterm uses [Zensical](https://zensical.org/) to generate the documentation, configured in `zensical.toml`. To serve it locally, run:
```sh
uv run zensical serve
```
and open the printed URL. `uv run zensical build` builds the static site.