Configuration file for dev-bot agent projects. JSONC format — supports // comments and trailing commas.
Two files exist at different scopes, both optional:
Locations
File
Scope
Purpose
Created by
<project>/.devbot.project.jsonc
Per-project
Project-specific settings
devbot init
<devbot-root>/.devbot.global.jsonc
Global
Shared defaults across all projects
make install
Resolution
Scalar settings resolve project-over-global, falling back to a built-in default when neither is set (devbot_dir, harness). Map settings (modules, memory_collections) merge per key, the project value winning; list settings (devbot:guards) are concatenated and evaluated first-match-wins (project rules first, then global). If a file is missing, its settings are skipped.
Auto-reinit on config change
Both config files are the source of truth for wiring — changing one (e.g. a modules flip, a provider key, gpu_enabled) only takes effect after a reinit. Rather than requiring a manual devbot reinit, the next bare devbot start detects the change and reinits the current project automatically, beforeup.sh runs, so the whole start sequence runs on freshly wired state.
Detection is a single per-project content hash over both configs, stored at <project>/.devbot.project.sha (the project config path with its .jsonc extension replaced — never committed). init/reinit clear the baseline before touching the wiring and restore it at the end of a successful run, so an unchanged wiring starts without re-running reinit, while an interrupted reinit leaves the baseline missing and the next start repairs the tree. A project with no .sha yet (freshly added, or upgraded from before this feature) triggers one reinit to establish it.
Because the baseline is per project, a global change (including the version bump devbot update writes) makes every project reinit on its own next start — there is no global baseline file.
If reinit succeeds, the start proceeds normally.
If reinit fails, dev-bot reports the error and aborts the start (non-zero exit) — the harness never launches on half-built wiring. Fix the cause and run devbot reinit. (There is no “continue anyway” override.)
Editing opencode.jsonc/.mcp.json directly does not trigger this — those are outputs of init, not inputs.
make up / devbot up alone do not trigger it — only a bare devbot start (harness launch). up.sh refreshes the baseline only when it was already clean, so a standalone devbot up can never consume a pending change.
Auto-update on start
A bare devbot start runs devbot update first (quietly), so the install is brought to the newest release before wiring. update is a clean no-op when already on the newest tag. Set the global auto_update to false to opt out.
When update moves to a new release it writes the tag into the global config’s version. That changes each project’s wiring hash, so every project reinits on its own next start — see Auto-reinit on config change. If the update fails (offline, conflict), dev-bot warns and continues the start on the current version.
Properties
version
{"version":"1.4.0"}
Type:stringRequired: no
Default: absent (the dist config seeds "")
Scope: global
The installed dev-bot release tag. Written by devbot update when it moves onto a new release; not meant to be edited by hand. A change here changes each project’s combined wiring hash, so every project reinits on its next start.
auto_update
{"auto_update":true}
Type:booleanRequired: no
Default:trueScope: global
When not false, a bare devbot start runs devbot update --auto before wiring. The update is a no-op when already on the newest release; a failure warns and the start continues on the current version.
The same switch governs the external-module check: unless it is false, every start (devbot up as well as a bare devbot) compares each git-backed external module in vendor/ against its remote and updates the ones that moved. See External modules.
project_name
{"project_name":"my-project"}
Type:stringRequired: no
Default:"devbot" (fallback)
The project name. Used by search-memories and qmd to auto-detect the QMD collection name (falls back to "devbot" if absent).
harness
{"harness":"opencode"}
Type:string ("opencode" | "opencode-v2" | "claudecode")
Required: no
Default:"opencode"
Selects which harness DevBot configures. Project config takes precedence over global; invalid values fall back to "opencode".
"opencode" and "opencode-v2" are the same product on two incompatible plugin APIs: "opencode" targets the 1.x line and "opencode-v2" targets 2.x. Each refuses to launch against the other’s host.
Used by _devbot_get_harness to select the launch script (src/harnesses/<harness>/start.sh).
This key is also the only switch for harness enablement: exactly one harness module is wired — its init.sh/reset.sh, opencode.jsonc / .mcp.json registration, plugin and skill wiring and harness-scoped manifests run, and every other harness is treated as disabled. A harness name in the modules map is silently ignored.
Switching harness therefore leaves the previously selected one’s tree (.opencode/ or .claude/) in place — its reset is skipped while it is unselected, so dev-bot never deletes a harness setup it is not managing. Select that harness again and run devbot reinit to clean it, or remove everything with devbot uninstall.
devbot_dir
{"devbot_dir":".agents"}
Type:stringDefault:".agents"Required: no
Base directory for all devbot project state: memory vault, logs, thinking files. Set to override the default location (e.g. .my-custom-state). All devbot subdirectories (memory/, logs/, etc.) live under this path relative to the project root.
Used by memory init, qmd init, the auto-recover and remember-session plugins, harness delegation, module symlinking, and gitignore setup.
Type:objectDefault: the block in .devbot.global.jsonc — type: "repo", commit_memory: false,
workflow: "worktrees", allow_force_push: trueRequired: no
Holds the settings that describe how a workspace behaves. The global config carries the documented
defaults; a project config carries only the keys it overrides. Each key resolves project-first, then
global, then the default above.
Key
Type
Selects
type
repo | polyrepo
whether the project is an ordinary project or a container for siblings
commit_memory
boolean
whether the memory vault is published on the memory pull request
workflow
worktrees | branch-fallback-worktrees | trunk
how a task is carried end to end
allow_force_push
boolean
whether the agent may force-push through the git-force-push tool
workspace.type
polyrepo marks the project as a container: a session launched here orchestrates work across
the managed projects registered in the global config’s projects array, and its memory scope is
resolved from the files the session touches. Working on a file under project A, a search covers
A’s vault + the shared global store + this polyrepo’s own vault; a memory about A is stored in
A, cross-project knowledge in the polyrepo, and tech-generic knowledge in the global store (see
devbot:memory-management).
A polyrepo lives anywhere — physical nesting of the managed projects is irrelevant; the global
projects registry is the source of truth. Sessions launched inside a managed project are
unaffected: they keep searching their own vault + the global store, never the polyrepo’s.
repo (the default) is an ordinary project.
Used by search-memories and the memory skills, the worktree tool (enabled / create refuse a
polyrepo root), and project-for-path, which reports it as type.
workspace.commit_memory
When true, the memory vault is committed and published on the project’s standing memory pull
request (chore(agents): commit memories and lessons learned) instead of being gitignored. When
false, the memory/ directory is excluded via .git/info/exclude and the captured vault notes stay
local; global lessons still go to the dev-bot store’s repository.
Used by memory init, the devbot init gitignore step, and devbot:commit-memories.
workspace.workflow
Selects the workflow an agent follows for a task — the end-to-end way the work is carried through
the project. worktrees isolates each task’s commits in a linked git worktree under
<devbot_dir>/worktrees/, cut from the remote default branch, and carries it to an open pull
request. trunk works directly on the default branch with no pull request, and stops for the
user’s gate before pushing. The workflows themselves are defined in the Workflows section of the
software-development skill. An explicit user instruction overrides the setting for that run.
branch-fallback-worktrees keeps the branch and the pull request of worktrees, but a single
active task works in the main checkout: a linked worktree is created only when the main checkout
is busy and the user agrees. Use it when one task at a time is the norm and a worktree per task
costs too much — disk, a compose stack and a hosts entry per worktree, and file watchers that scan
all of them.
The worktree tool decides whether the main checkout is busy (worktree.sh checkout-state), not
the agent. It is busy when any of these holds:
there are uncommitted changes or untracked files;
there are commits that are not pushed — on the current branch, or on the local default branch
while a feature branch is checked out;
the current branch has no upstream (the default branch counts as tracking origin/<default>),
or its upstream is gone and no merged pull request has its HEAD — a merged branch whose remote
ref was deleted is free;
it is a feature branch without a pull request in any state;
HEAD is detached, or the check itself fails — git fetch or gh cannot run (no network, an
expired token).
Busy — the agent asks: “The main checkout has unfinished work on <branch>. Should I open a new
worktree for this task?” Yes creates a worktree; no stops and waits. Free — `worktree.sh start
` switches the main checkout to the default branch, pulls it with `--ff-only` (when it cannot
fast-forward it stops and asks instead of merging) and creates the task branch there from
`origin/`. `worktree.sh push ` publishes it from the main checkout. To pick up an
existing task branch — review feedback after another task took the main checkout — `worktree.sh
resume ` runs the same check and switches to it, and `create --existing` opens a
worktree on it when the checkout is busy. A task that
spans several repositories checks each one, and asks if any is busy. Because a pushed branch with a
pull request counts as free, a session checks that `HEAD` is still its task branch before every edit
and commit, and stops and asks when it is not. `worktree.sh enabled` prints `fallback` (exit `0`)
for this workflow.
Used by the `worktree` tool (`enabled` / `create` / `checkout-state` / `start`), `project-for-path`,
and the `git-worktrees` skill.
#### `workspace.allow_force_push`
On by default in the shipped global config. A project sets it to `false` to withdraw the route.
While it is `false`, the `git-force-push` tool refuses and the guards block the
force-push forms they recognise (`--force`, `-f`, `--force-with-lease`, `--mirror`, a `+:`
refspec, and those wrapped in a command runner or an inline push-redirecting config), so the agent
has no sanctioned route to one. Set it to `true` in the project config to unlock **exactly one**
route — the `git-force-push` tool of the `git` module — for the pre-merge squash of a pull-request
branch.
The unlock is narrow by design:
- **The shell guard stays.** A hand-typed force-push is blocked whatever this key says, so the agent
cannot step around the tool's checks; the tool is the only route, and it carries its own gates.
The guard recognises the force-push forms it knows (`--force`, `-f`, `--force-with-lease`,
`--mirror`, `+:`, and those behind a command runner or an inline `alias.`/`remote.`/
`push.` config) — it is a guardrail, not a sandbox, so the tool's own checks are what makes the
rewrite safe.
- **The default branch stays protected.** The tool refuses `main` and `master` by name, asks the
push destination for any other default (refusing a remote that pushes to several), and refuses the
push when it cannot determine one. This holds whatever the key says.
- **The push is always leased.** `--expect ` is required — a commit id, never a ref name — and
pins `--force-with-lease=:` to the head captured before the rewrite; a bare `--force`
is never run, and neither is a lease measured against the local remote-tracking ref.
The key belongs to the **owning project**, resolved the way `project-for-path` resolves it: the
longest registered project in `.devbot.global.jsonc` that contains the path being pushed — an inner
registered project, not the repository root, and not necessarily the nearest `.devbot.project.jsonc`.
A repository nested inside a permissive project therefore inherits that project's value; register the
repository (or its subdirectory) itself when it must have its own.
This is a guardrail, not a sandbox: the agent can read and write the project's own config, so the key
governs what the agent may do, not what it could remove.
Used by the `git-force-push` tool, which reads it project-first then global, and by
`project-for-path` (`--key allow-force-push`).
#### Migrating a flat config
The three keys used to sit at the root of the config, next to a boolean `monorepo` (and, before
that, a boolean `worktrees`). `devbot init` rewrites such a config into this block — in the project
config and in the global one: `monorepo: true` becomes `type: "polyrepo"`, `monorepo: false`
becomes `type: "repo"`, `worktrees` maps to `workspace.workflow`, and an explicit `commit_memory`
or `workflow` is carried across as an override. A config that never runs `init` must be rewritten by
hand, because no reader falls back to the flat keys.
Every other project-scoped module follows the same owning-project rule — resolve it with
`devbot tool project-for-path `. See [Polyrepo sessions](/polyrepo-sessions) for the
per-module contract.
---
### `modules`
```jsonc
{ "modules": { "signoz": false, "litellm": false } }
```
**Type:** `object` (map of module name → `boolean`)
**Default:** `{}` (every module enabled)
**Required:** no
**Scope:** project overrides global **per key**
Per-module enablement. A module set to `false` is skipped during **init** — its symlink wiring and declared MCP servers are not installed into the project. A module absent from both files is enabled. The global and project maps merge per key, with the project value winning, so a project can re-enable a globally disabled module, or vice versa.
Disabling also **takes back** what a previous init installed: an agent, command, skill or tool link the module owns is removed from `/{agents,commands,skills,tools}`, so a disabled module stops loading its skills and stops exposing its MCP tools. A link that resolves outside the module — another module's, or your own — is left in place. Disabled modules are unlinked before enabled ones are linked, so a name two modules share goes to the enabled owner rather than disappearing.
Harness modules are **not** toggled here. Which harness is wired comes from the root [`harness`](#harness) key alone, so `"opencode"` / `"claudecode"` entries in this map are silently ignored — setting `"opencode": false` on the selected harness does not disable it, and setting `"claudecode": true` on the unselected one does not enable it.
`devbot update` merges the dist schema into an existing global config additively: a module key the runtime does not have picks up the dist default (so a newly shipped module arrives disabled or enabled exactly as declared), while a key the runtime already sets keeps the machine's value. Set a module to `true` explicitly to keep it enabled; do not rely on deleting its key, which the merge re-adds from the dist default.
The machine-wide commands ignore this map: `install`, `update`, `uninstall` and prereq checks run **every** module's scripts, disabled ones included — their assets are machine-wide, and a module disabled in one project may be enabled in another (the same rule `down` follows). Enablement is otherwise honoured by the per-project lifecycle (`init`, `up`) and by `devbot list`, which hides disabled modules' artifacts unless `--all` is given.
Disabling a module also removes its MCP servers from the selected harness's config — this is the lever for dropping a heavy server's tool-schema and process cost (see [MCP configuration](/mcp-config#reducing-the-footprint)).
---
### `codebase_index_provider`
```jsonc
{ "codebase_index_provider": "opencodebase-index" }
```
**Type:** `string` (`"opencodebase-index"` \| `"codebase-memory"`)
**Default:** `"codebase-memory"`
**Required:** no
**Scope:** global only
Selects which codebase-understanding engine is active. The two engines are
interchangeable — the same slot in the agent toolkit, swapped by flipping this
one key (then running `devbot reinit`):
| Value | Engine | Integration |
| ---------------------- | ----------------------------------------------------------------------- | --------------------- |
| `"opencodebase-index"` | `opencode-codebase-index` (Ollama `nomic-embed-text` embeddings) | opencode plugin + MCP |
| `"codebase-memory"` | `codebase-memory-mcp` (DeusData — bundled native embeddings, no Ollama) | MCP server |
The two modules are **mutually exclusive**: `_devbot_get_disabled_modules`
auto-appends the non-selected engine to the disabled set, so exactly one is
ever wired. An explicit `modules`-map `false` on the _selected_ engine still
hard-disables it (no codebase engine); enabling the _non-selected_ one via
`modules` is ignored.
**Nobody names the engine.** The `codebase-index` module is a facade over
whichever engine this key selects: `search-codebase`, `trace-codebase-calls`,
`reindex-codebase` and the rest of its verbs answer on either one, and answer a
structured `unsupported` envelope for a capability the selected engine lacks
(`query-codebase-graph` and `summarize-codebase-architecture` exist only under
`codebase-memory`). Instructions written against the facade survive a flip.
**Rename (1.26.0):** the Ollama engine module is now `opencodebase-index`; it
was `codebase-index`, which is now the facade's name. The `1.26.0` migration
rewrites a pinned `"codebase-index"` value, and the old spelling stays accepted
at runtime for one release.
The engine is **off unless this key selects it**, and that is the only switch:
no `modules` entry is needed, and none is shipped. An explicit
`"opencodebase-index": false` in the map would beat this key — the module gate
treats an explicit value as authoritative — leaving a machine that selected the
engine with no engine at all.
**Upgrade note:** existing installs that do not set this key get the
`codebase-memory` default and will stop registering `opencodebase-index` on the
next reinit. Pin `"codebase_index_provider": "opencodebase-index"` _before_
updating dev-bot to keep the previous engine.
**Behaviour on disable (read before flipping):** disabling a module — via this
key or the `modules` map — **unregisters** the opencode plugin/MCP entries
**dev-bot wrote** at the next `devbot reinit`, not merely stops future
registration. This is required for the engine swap: a flipped-off engine must
shed its registrations. What dev-bot wrote is recorded in
`.opencode/.devbot-managed-mcps` (one `:` per line) at the moment it
registers the entry; an entry the record does not name is left in place with a
notice, so a server or plugin you added yourself under a module's name — even at
the module's own URL — survives every reinit. An install that predates the
record carries none, so its entries also survive, until a reinit records them.
`devbot init`/`reinit` rewrite `opencode.jsonc`, `.mcp.json` and the per-project
config from module manifests — existing configs are **not backed up**; the old
file is replaced. Skills, agents, commands, and tool symlinks are removed
outright and regenerated from source.
Reset also retires MCP keys dev-bot no longer declares, so a renamed or dropped
server does not linger: an exact-key list, plus a **prefix** list for families it
cannot enumerate (`datasources-` was the datasources server key before it
was shortened to `ds-`). Both follow the ownership record — a key
`.opencode/.devbot-managed-mcps` names is removed, and one it does not name is
left in place with a notice, so a server you wrote yourself survives whatever it
is called.
---
### `codebase_memory_root`
```jsonc
{ "codebase_memory_root": "/home/user/projects" }
```
**Type:** `string` (absolute path)
**Default:** derived — the common ancestor of `$HOME` and every existing
registered project (`projects`), never narrower than `$HOME` and never `/`.
**Required:** no
**Scope:** global only
The repository root the shared `codebase-memory` gateway bind-mounts read-only
at the same absolute path. A project outside this root is invisible to the
gateway — its index silently stays empty — so set this when a project lives in
a tree disjoint from `$HOME` (the common ancestor would resolve to `/` and fall
back to `$HOME`).
Precedence: an explicit `CODEBASE_MEMORY_ROOT` environment variable wins, then
this key, then the derived ancestor. On `devbot up`, an explicit value (process
environment or the repo `.env`) is **persisted** into this key so an env-less
later invocation — the harness-launch `devbot` — resolves the same mount instead
of reverting to the derived default. Derived values are never persisted, so
adding a project outside `$HOME` still widens the root automatically. A `/` or
relative value is rejected. The persisted root applies to every project on the
machine; to clear it, delete this key and re-run `devbot up`.
---
### `memory_search_provider`
```jsonc
{ "memory_search_provider": "qmd" }
```
**Type:** `string` (`"qmd"` \| `"mdctx"`)
**Default:** `"mdctx"`
**Required:** no
**Scope:** global only
Selects which memory-search engine is active. The two engines are
interchangeable — the agent-facing entry point (`search-memories`) stays the
same and dispatches to whichever engine this key selects (both search the
project memory vault and the shared global store); the engine's own MCP server
and skill are registered for the selected engine only. Swap by flipping this
one key, then running `devbot reinit`:
| Value | Engine | Integration |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| `"qmd"` | `@tobilu/qmd` (BM25 keyword search over per-project collections — no models, no embeddings) | CLI (guard-blocked for agents) |
| `"mdctx"` | `mdctx` (zachkepe/mdctx — zero-ML-dependency RAKE + BM25 keyword index over a flat, git-diffable JSON file; no embeddings, no GPU) | MCP server + CLI |
The two modules are **mutually exclusive**: `_devbot_get_disabled_modules`
auto-appends the non-selected engine to the disabled set, so exactly one is
ever wired. An explicit `modules`-map `false` on the _selected_ engine still
hard-disables it (no memory-search engine); enabling the _non-selected_ one via
`modules` is ignored. The qmd/mdctx pair is independent of the
`codebase_index_provider` pair — both auto-exclusions apply.
**Both engines are keyword-only:** `mdctx` is keyword-only by design (RAKE +
BM25, no embeddings); `qmd` is used BM25-only through the memory module — no
model download, no embeddings (ADR `20260913072905-qmd-bm25-only-no-model-
downloads`). Memory search is deterministic BM25 against descriptive
titles/keywords under either engine.
**Upgrade note:** existing installs that do not set this key get the `mdctx`
default and will stop registering `qmd` on the next reinit. Pin
`"memory_search_provider": "qmd"` _before_ updating dev-bot to keep the
BM25 engine and its existing collections.
**Flip:** after changing the key, run `devbot reinit` so the newly selected
engine's MCP/skill is registered, the losing engine's entries are pruned, and
its index is built (`mdctx build` of the project vault + global store, or qmd
collection registration).
**Behaviour on disable** matches `codebase_index_provider` above: disabling a
module unregisters the plugin/MCP entries dev-bot recorded writing, at the next
`devbot reinit`; an entry it did not record is left alone.
---
### `memory_collections`
```json
{
"memory_collections": {
"project": {
"path": "{project}/{devbot_dir}/memory/latent",
"semantic": false
},
"notes": { "path": "~/notes", "semantic": true }
}
}
```
**Type:** `object` (name → `{ path, semantic }`)
**Default:** the built-in `project` + `global` pair
**Required:** no
**Scope:** project and global, merged
Lists the document collections `search-memories` and `reindex-memories` search.
The object key is the collection name; each value carries a `path` and a
`semantic` flag (default `false`).
The two built-ins are reserved:
| Key | Where it may be set | Default path |
| --------- | ------------------- | ----------------------------------------- |
| `project` | project config only | `{project}/{devbot_dir}/memory/latent` |
| `global` | global config only | `${DEV_BOT_ROOT}/storage/global-memories` |
Custom keys may be set in either file. The two maps merge (global first, then
project); when both define the same custom key, the project entry **replaces**
the global one wholesale. A custom collection's identity is derived from its
normalized path: its qmd collection is `dev-bot-custom-` and its
mdctx index is `collections/.json`, where `` is the first
12 hex characters of SHA-256. Keys and projects that name the same path share
one registration and index; different paths never collide. The logical key is
what `--collection` selects. A custom collection cannot alias another
registered project's vault; that project's own sessions own it. If the built-in
`global` path is overridden, it gets its own mdctx index under `collections/`;
the mdctx gateway continues to serve the shipped store, so the two cannot
overwrite each other.
Placeholders: `{project}` (the project root), `{devbot_dir}` (the resolved
`devbot_dir`), `${DEV_BOT_ROOT}` (the dev-bot install root), and `~` (home).
Relative paths resolve against the project root.
`semantic` is reserved: a `true` value is accepted and stored but is inert
today — both engines are keyword-only (BM25; see `memory_search_provider`), so
a search emits a `NOTICE` and runs BM25. It will select qmd's model path when
that path is restored.
In a polyrepo project, the `project` collections follow the `--focus` read
set, while the `global` and custom collections are always searched. Custom
collections resolve from the session project's config plus the global config;
a focused child's own project-level custom collections are not pulled into the
polyrepo's search (a session started inside that child searches them).
---
### `devbot:guards`
```jsonc
{
"guards": [
{ "regex": "rm -rf", "message": "rm -rf is blocked" },
{ "regex": "sudo .*", "message": "sudo is blocked" },
{ "regex": "git push --force", "message": "force push is prohibited" },
],
}
```
**Type:** `array` of guard objects
**Required:** no
Each guard rule has:
| Field | Type | Description |
| --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `regex` | `string` | Regex pattern matched against the shell command (case-sensitive) — the bash tool, or a PTY invocation normalised to `command args` |
| `message` | `string` | Block reason shown to the user when the rule matches |
Used by the **guards** module (`on-tool_execute_before-guards.ts` opencode hook, `on_tool_execute_before-guards.sh` claudecode hook). Guards from the global config and the project config are concatenated; the first matching rule wins (project rules are evaluated before global rules).
---
### `auto_recover.max_attempts`
```jsonc
{
"auto_recover": {
"max_attempts": 5,
},
}
```
**Type:** `number` (inside `auto_recover` object)
**Default:** `5`
**Required:** no
Maximum number of automatic recovery attempts per session after a transient provider error (API timeout, 5xx, overloaded). Prevents infinite retry loops — when the ceiling is hit, the error surfaces to the user.
Used by the **auto-recover** plugin (`on-session_error-auto-recover.ts`).
---
### `gpu_enabled`
```jsonc
{ "gpu_enabled": false }
```
**Type:** `boolean`
**Default:** `false`
**Required:** no
**Scope:** global only
Enables GPU acceleration for local inference (QMD/Ollama). Set automatically by `devbot install` / `devbot update` (devbot-level detection, not the ollama module install); never by a bare start.
A module that needs GPU passthrough ships a `docker-compose.gpu.yml` beside its compose (ollama's is `src/tools/ollama/docker-compose.gpu.yml`; opencodebase-index ships one that `include:`s it). It is appended only when this is `true` **and** a live container-passthrough probe (`_has_docker_gpu`) succeeds — on Docker Desktop (macOS/Windows) passthrough is unavailable, so a stray `true` cannot break `devbot up`. Because the overlay follows the compose it overrides, it can never be applied without the service it targets. qmd's own GPU selection is independent of this flag: it probes the host directly.
---
### `ollama_local_api`
```jsonc
{ "ollama_local_api": "http://localhost:18434" }
```
**Type:** `string`
**Default:** `"http://localhost:18434"`
**Required:** no
**Scope:** global only
Local Ollama API endpoint, read by the ollama model-pull helper (`_ensure_ollama_models_detached` in `src/_shared/functions.sh`) when it fetches missing models; the `OLLAMA_API_URL` environment variable overrides it for a single run. It is dormant unless the opencodebase-index engine is enabled.
---
### `projects`
```jsonc
{ "projects": ["/path/to/project-a", "/path/to/project-b"] }
```
**Type:** `array` of `string`
**Default:** `[]`
**Required:** no
**Scope:** global only
Absolute paths of projects registered with DevBot. Managed by the project-registration helper (`add_project.py`).
---
### `datasources`
```jsonc
// .devbot.global.jsonc — the catalogue, declared once
"datasources": {
"hotels-dev": {
"type": "mysql",
"mcp_timeout_ms": 300000,
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "${HOTELS_DEV_DB_PASSWORD}"
}
}
}
```
```jsonc
// .devbot.project.jsonc — opt in, by name
"datasources": ["hotels-dev"]
```
**Type:** `object` (global) / `array` of names (project)
**Default:** `{}` / `[]`
**Required:** no
**Scope:** the catalogue is global-only; the selection is per project
Database access for agents, through one shared MCP Toolbox gateway on
`127.0.0.1:18510`. The catalogue is declared once; each project opts in by name.
A datasource a project does not name is never registered with its harness, so it
costs nothing — not even context.
The `env` map names the engine's own variables (`MYSQL_HOST`, `MONGODB_URI`,
`MONGODB_DATABASE`, …). Each **value** is either a literal or a `${VAR}`
reference to an environment variable:
| Value | Meaning |
| ----------------------------- | --------------------------------------------------------- |
| `"localhost"` | A literal, written into the rendered config |
| `"${HOTELS_DEV_DB_PASSWORD}"` | Resolved from the environment — the value reaches no file |
A reference must be the **whole** value: `pre-${VAR}` is a literal, so a password
containing `${` is never mistaken for one. Non-secret values read best inline,
and anything secret belongs behind a reference. The environment is the repo
`.env` (which `devbot up` loads) or your shell.
Precedence, because the shipped `.env.dist` lists every optional credential as
`NAME=` (empty): a **blank** entry in `.env` means "not configured here" and
never erases a value exported in your shell, while a **filled-in** entry wins
over the shell. So exporting `MYSQL_PASSWORD` in `.bashrc` works even if `.env`
still carries the template's empty `MYSQL_PASSWORD=` line. A filled entry
winning is deliberate: it is the precedence a plain `source` always had, so an
existing `.env` keeps meaning exactly what it meant before — to change a value
the file sets, edit the file.
Fields left out fall back to the engine's defaults, so declare only what
differs: `MYSQL_PORT` defaults to 3306, and an omitted `MYSQL_DATABASE` leaves
the source with **no default schema** — one datasource then covers every database
on the instance, reachable by qualifying names
(`SELECT ... FROM otherdb.sometable`). MongoDB is the exception: its aggregate
tool requires a database, so one mongo datasource covers one database. A
`mongodb+srv://` URI is resolved by the toolbox itself — dev-bot never parses
the URI, so SRV records need no port assumption.
A field you **declare** as a `${VAR}` reference makes that variable the source of
truth: if it is unset or empty and the field has a non-empty default (a host, a
port), the datasource is excluded rather than falling back. The default applies
only to an **omitted** field. That distinction matters for hosts —
`MYSQL_HOST` / `POSTGRES_HOST` default to `localhost` only when left out, so a
variable meant to point at a production replica but empty drops the datasource
instead of silently retargeting it at your local database. A field whose default
is deliberately empty (`MYSQL_DATABASE`) keeps the datasource with no default
schema, because an empty value there means "no schema", not "fall back".
`type` is `mysql` (MariaDB included), `postgres`, `sqlite`, `mongodb` or
`redis` — or a **sidecar** type (`opensearch`, `s3`), served by its own container
instead of by the shared gateway (see [Sidecar datasources](#sidecar-datasources)).
`mcp_timeout_ms` raises the MCP client's request timeout for that source —
connect, tool listing and tool calls — in milliseconds, default `60000`. opencode
honours it; Claude Code takes its equivalent from `MCP_TIMEOUT` and ignores the
key. A change takes effect on `devbot reinit`, like the rest of the wiring.
**Redis** fits the same one-free-form-tool shape, by a different route. Its
toolbox tool runs a _fixed_ command list — but an array argument is flattened
into the command, so a single array parameter templating the whole command makes
the command **name** a runtime value too: the agent supplies
`["GET", "some-key"]`, exactly as it supplies a SQL statement elsewhere. One
endpoint per datasource (`address` is a sequence upstream, even for a single
host), and `username` / `password` are omitted unless declared — an empty AUTH
string is not the same as no AUTH.
Two behaviours are worth knowing before relying on it:
- **Only the databases reachable at startup are loaded.** dev-bot opens no
database connections of its own: it runs the real toolbox (the only DB client)
against the declared sources and loads only the ones it accepts — so a down
database, a missing credential or a blocked host is excluded rather than
taking the whole gateway down with it. The set is decided **once**, when
`devbot up` runs: a database that comes up later is not picked up until the
next `devbot up`. Reasons are printed on `devbot up`.
- **A connection that hangs is bounded.** mysql and postgres carry a 2s connect
timeout, so a firewalled host fails fast instead of stalling the gateway's
startup. MongoDB gets the same bound in its URI (`connectTimeoutMS` /
`serverSelectionTimeoutMS`) — set one yourself in the URI, or in the variable
behind it, to override it for a cluster that honestly needs longer. The redis
source exposes no dial timeout at all in toolbox 1.11.0, so a blackholed redis
host is still excluded, but only after the canary's full 5s deadline.
- **Nothing blocks writes.** A datasource is exactly as writable as the database
user it is given — which is how one config serves a writable dev database and
a read-only production one. Point production at a read-only user.
### Sidecar datasources
Some data sources have no toolbox source at all, so their `type` names a
**sidecar**: a small MCP server in its own container, on its own port, rather
than a toolset on the shared gateway. The declaration is unchanged — a `type`
and an `env` map — so a project opts in exactly as it does for a database.
```jsonc
"datasources": {
"prod-search": {
"type": "opensearch",
"env": {
"OPENSEARCH_URL": "https://search.example.com",
"AWS_REGION": "eu-central-1",
"AWS_ACCESS_KEY_ID": "${OPENSEARCH_KEY_ID}",
"AWS_SECRET_ACCESS_KEY": "${OPENSEARCH_SECRET}"
}
},
"artifacts": {
"type": "s3",
"env": {
"AWS_REGION": "eu-central-1",
"AWS_ACCESS_KEY_ID": "${ARTIFACTS_KEY_ID}",
"AWS_SECRET_ACCESS_KEY": "${ARTIFACTS_SECRET}"
}
}
}
```
| Type | Server |
| ------------ | ----------------------------------------------------------------------------------------------- |
| `opensearch` | the OpenSearch project's `opensearch-mcp-server-py`, streamable-http |
| `s3` | dev-bot's own read-only S3 server — `list_buckets`, `list_objects`, `head_object`, `get_object` |
Ports come from the same block as the gateway (`18500–18599`, after 18510),
allocated by **sorted datasource name**, so a reinit renders the same ports
whatever order the catalogue is in.
**Credentials are environment variables**, like every other datasource: the
variable _names_ are declared and compose interpolates the values from the
environment `devbot up` builds — no credential value is written to a config or to
a rendered file. Nothing mounts `~/.aws` into a sidecar, so a sidecar that talks
to AWS takes `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`
(plus `AWS_REGION`) rather than a profile.
An unset `${VAR}` a sidecar declares is reported as a `WARN` during the render —
not refused, because a sidecar with unset credentials still starts and fails only
when first called. Engines, by contrast, are excluded outright when their env is
incomplete.
**A sidecar is not probed at startup.** The availability canary exists because
toolbox treats one unreachable source as fatal — a single down database would
take every datasource with it. A sidecar is its own container and cannot do that,
so one that fails to start fails only its own manifest, which surfaces when the
agent first calls it.
### `kubectl`
Cluster access for agents, rendered by `src/agentic/k8s/init.sh` on every init.
The global node is a **catalogue**; each project opts in by naming clusters, the
way it does for `datasources` and `aws_connections`. The script then writes that
project's own `~/.kube/devbot/.yaml` and
`~/.kube/devbot/.env`, plus one shared exec credential wrapper
`~/.kube/devbot/exec-credential.sh`, and regenerates them from scratch — so a
cluster dropped from the selection disappears from that project's kubeconfig on
the next init.
The project slug is `project_name` (or the directory name when the config has
none), folded to `[A-Za-z0-9._-]`, plus the first eight hex characters of the
absolute path's SHA-256. The hash is what makes it unique: two checkouts both
named `demo` get different files, so initialising one can neither widen nor
overwrite another. Moving a project changes its slug and leaves the old file
behind.
Every cluster that renders also becomes its own MCP server, named after the
catalogue key — `kctl-` — with a single tool:
| Server | Tool | Input |
| ------------ | --------- | ---------------------------------------------------------------------------------------------------------- |
| `kctl-` | `kubectl` | `args`: kubectl's argv as a string array (`["get","pods","-n","core"]`); optional `stdin` for `apply -f -` |
The server is the scoping: the cluster is fixed when it launches, so the tool
has no target argument and cannot reach another cluster's context. It refuses
`--context`, `--kubeconfig`, `--server`, `--cluster`, `--user`, `--token`,
`--as`, `--as-group`, `--as-uid`, `--username`, `--password`, `--proxy-url`,
`--tls-server-name`, `--client-certificate`, `--client-key`,
`--certificate-authority` and `--insecure-skip-tls-verify`, plus a leading
`kubectl`/`k` and the `kubectl config` write subcommands (the kubeconfig is
generated by `devbot reinit`). Each call runs through
`devbot kctl exec `, the same code path as the CLI, so the two cannot
disagree about which cluster a command reached.
Servers are published from the **rendered** set — a cluster the render dropped
has no context in the file, so it gets no server — and they are declared
enabled, because they are the only permitted way to reach a cluster. Their
launcher needs `bun`, which `devbot install` provides.
Because a shell `kubectl` would bypass all of it, the k8s module also ships two
enforcement layers:
- `/memory/active/modules/k8s.md` — written whenever the module is
enabled, stating the prohibition and the MCP usage;
- guard rules (in both dist configs) blocking the direct forms: `kubectl`,
`VAR=x kubectl …`, `kubectl` inside a command runner, and
`devbot kctl run|exec`. A migration seeds them into an existing install,
because a dist config only reaches a machine that has none.
The guard is a backstop, not the whole rule: a hook sees a shell command, not
what a script or a Makefile recipe does. `devbot kctl env|contexts` stays
allowed for diagnostics; `run` and `exec` run kubectl, so they are blocked like
kubectl itself.
```jsonc
// .devbot.global.jsonc — the catalogue every project may select from
"kubectl": {
"profile": "devbot-agent", // AWS profile the exec plugin runs `aws eks get-token` under
"credential_env": {
// Destination name → ${VAR} reference, exactly as in a datasource.
"AWS_ACCESS_KEY_ID": "${AWS_KEY}",
"AWS_SECRET_ACCESS_KEY": "${AWS_SECRET}"
},
// Keyed by the name the cluster goes by here — it becomes the `kctl-`
// server. `name` is the AWS EKS cluster, which is what `aws eks
// describe-cluster --name` receives; both are required.
"clusters": {
"k8s-prod": { "name": "k8s-prod", "context": "k8s-prod-ro", "region": "eu-central-1" },
"k8s-stg": { "name": "k8s-stg", "context": "k8s-stg-rw", "region": "eu-central-1" },
"get-e-prd": { "name": "gete-prd", "context": "gete-prod-ro", "region": "eu-central-1" }
}
}
// .devbot.project.jsonc — opt in by catalogue key; nothing is rendered without it
"kubectl": ["k8s-prod", "k8s-stg", "get-e-prd"]
```
**Key or AWS name.** The key is what this config and everything generated from it
calls the cluster: the `kctl-` MCP server, the kubeconfig cluster object,
the `devbot-` user, the context fallback, and the entry the project
selection lists. The `name` field is the **AWS EKS cluster name** — the string
`aws eks describe-cluster --name` and `aws eks get-token --cluster-name`
receive. Both are required: the key names the tool, `name` names the cluster at
AWS, and a config may rename either without touching the other — `"get-e-prd":
{ "name": "gete-prd" }` publishes `kctl-get-e-prd` for the `gete-prd` cluster.
The pre-1.20.0 array form is rejected by name — `devbot update` migrates it,
where its single `name` becomes both the key and `name`, so no `kctl-*` server
changes its name across the upgrade.
The selection's order does not decide the default: `current-context` is the
cluster the **project's own name** names, so a project declared as
`acme-k8s-stg` opens on `k8s-stg` even when its array lists `k8s-prod` first.
A catalogue key matches when the project name equals it or ends with
`-