field-types
Field Types Reference
This document covers all field types available in Pour's config.toml schema, their config keys, validation rules, default output targets, and TUI rendering behavior.
The creed: frontmatter habits vs. event notes
Pour has two capture shapes, and the line between them is a lasting rule:
- Frontmatter habit — transient, ambient, binary-or-cumulative state of a day: partaken or not, ounces so far. It has no story to tell beyond its value, so it lives as a property on a periodic note. The template owns the key and its default (
cannabis: false,water: null); pour only ever mutates it, viamode = "update"withtoggle/counterfields. - Event note — anything with novelty or nuance: a coffee has a bean, a ratio, a taste worth remembering. It gets its own note via
createmode.
Corollary: if a signal could be derived from event notes (coffee count from coffee notes), derive it — never mirror it into frontmatter. Two sources of truth drift by week one. A frontmatter habit is only for signals that have no event notes.
See pour-habit-capture for the full spec.
Module Config Keys
Every module defined in [modules.<name>] supports these keys:
| Key | Type | Required | Description |
|---|---|---|---|
mode |
string | yes | "create" (new file), "append" (add to existing file), or "update" (mutate frontmatter on an existing file) |
path |
string | yes | Vault-relative path template. Supports strftime tokens (%Y, %m, %d) and field placeholders ({{field_name}}). |
display_name |
string | no | Human-readable label shown on the dashboard. Defaults to the module key. |
append_under_header |
string | conditional | Required for append mode. Markdown heading to insert content under. |
append_template |
string | no | Template string for append-mode output. Supports {{field}}, {{date}}, {{time}}, {{callout}} placeholders. A multi-line value on a line that starts with > gets > on every continuation line, blank lines included, so it stays inside the blockquote or callout. See `textarea`. |
callout_type |
string | no | Default Obsidian callout type for {{callout}} in templates. |
icon |
string | no | Optional icon displayed on the TUI dashboard next to the module name (e.g. "☕"). For create-mode modules, also written to output frontmatter as icon: <value>, making it queryable by Dataview and compatible with Iconize/Supercharged Links. |
preset_axes |
string[] | no | Ordered list of field names used as drilldown axes in the preset picker. Empty/absent → no picker; the legacy ←→ cycler stays active. See pour-preset-hierarchy. |
priors |
table | no | Read-only "priors" review panel declaration. See pour-review-priors and the [priors] block below. |
[modules.<name>.priors] block
Declares a read-only review panel that shows your most similar prior captures beside the capture form, one column per prior, with each row on the same line as its form field (see pour-review-priors). All keys are optional. Omitting the whole block yields a zero-config default. The panel never writes, never blocks submit, and resolves only at form-open and when a match_on field or a gate field changes.
Before scoring, the panel applies a hard filter that needs no config. Any field that another field's show_when names is a gate. When the form has a value for a gate, priors with a different value, or no value, for it are dropped. On coffee that keeps espresso brews off a pour-over form. Values in fields that show_when currently hides are ignored, as they are at submit, so a stale brewer left over from Pour Over doesn't affect an Espresso form.
| Key | Type | Required | Description |
|---|---|---|---|
match_on |
array | no | Ordered list (most → least important) of fields that define "similar". Each prior scores one point per field that agrees with the form's current value. Fields left empty on the form don't count. Equal scores go to the prior that agrees on the earlier field. Each entry is a bare string (equality, or wikilink when the referenced field has wikilink = true) or an object { field, mode }. Only mode = "equality" / "wikilink" are accepted; "overlap" / "window" are reserved for L2 and rejected at config-load. |
rank_by |
string | no | Tie-breaker between equally similar priors: "<field> desc" / "<field> asc", "recent" (newest first), or "none" (scan order). A prior missing the rank_by field sorts after the ones that have it, and its column renders dimmed. The "<field> max" / "<field> min" forms are reserved and rejected. Absent → "recent". Recency always breaks the last tie, except under "none". |
show |
array | no | Which fields get a cell in each prior's column. Each entry is a bare string or an object { field, agg }. agg ∈ median (default), mean, max, min, latest, and only matters for the summary column. Absent → every field except textarea and composite_array. Rows for fields outside show stay blank. composite_array rows are always blank: presets are how you reuse recipe stages. |
limit |
integer | no | How many priors to show, one column each. Must be > 0. Defaults to 3. |
summary |
bool | no | true adds one column on the far right that aggregates each number row (per its agg, median by default) over the displayed priors. Other rows stay blank. The header names the aggregation, or reads summary when the rows use different ones. Defaults to false, because an average across brews reads like a recipe nobody brewed. |
All match_on / rank_by / show field names must reference fields that exist on the module.
Zero-config default (no [priors] block): match_on is every wikilink/select field in config field order; rank_by = "recent"; show = every field except textarea and composite_array; limit = 3; summary = false.
[modules.coffee.priors]
match_on = ["bean", "brewer", "grinder", "intent"] # similarity, most → least important
rank_by = "rating desc" # tie-breaker only
limit = 3 # one column per prior
summary = true # optional median column
# object forms: explicit wikilink mode and a mean-aggregated summary row
[modules.brew.priors]
match_on = [{ field = "roaster", mode = "wikilink" }]
show = ["dose_g", { field = "water_temp_c", agg = "mean" }]
TUI: the panel sits to the right of the form. Each cell holds one prior's value for the field on that line. · means the value equals what the form holds now, including a value filled from a field's default, and the marks follow your edits as you type. A differing value is highlighted. The header reads similar, or no close match when you've filled at least one match_on field and no shown prior agrees on any of them, plus the rank_by label when it names a field. Column headers show each prior's rank_by value and the footer row shows each prior's age (3d, 1w). The active field's row is highlighted across the panel. The form keeps at least 60 columns, so the panel drops columns as the terminal narrows: with limit = 3, 3 columns from 94 columns wide, 2 from 84, 1 from 74. The summary column is the first to go. Below 74 the panel becomes a one-line hint on the bottom row, and Ctrl+R collapses it to the same hint. When no prior survives the hard filter, that row shows a one-line empty state. The captures come from the folder part of the module's path (everything before the last /), read as written: a strftime or {{field}} token there, as in Coffee/%Y/%Y-%m-%d-{{bean}}.md, is not expanded, so that module finds no priors. Each resolve reads at most 500 notes. Cells come from each note's frontmatter, so a module whose fields all land in the body, such as an append module on daily notes, gets a column per note with blank rows and only the age footer.
Field Config Keys
Every field in a module's [[modules.<name>.fields]] array supports these keys:
| Key | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Field identifier, used as the YAML frontmatter key |
field_type |
string | yes | One of the eight types below |
prompt |
string | yes | Label shown in the TUI form |
required |
bool | no | If true, submit is blocked when the field is empty |
default |
string | no | Pre-filled value on form init |
options |
string[] | conditional | Required for static_select; ignored otherwise |
source |
string | conditional | Required for dynamic_select; vault-relative directory path |
target |
string | no | "frontmatter" or "body" — overrides the default routing |
sub_fields |
array | conditional | Required for composite_array; column definitions |
callout |
string | no | Obsidian callout type (e.g. "note", "tip"). When set on a textarea field targeting body, the output is wrapped in > [!type] blockquote syntax. |
callout_title |
string | no | Default title rendered on the callout line: > [!type] <callout_title>. Only used when callout is set. In the TUI, press t while focused on the textarea row (editor closed) to edit the title for the current entry — an empty title clears it. A t title hint appears in the footer bar when the hotkey is available. Bare t is used rather than Ctrl+T because some IDEs/terminals intercept Ctrl-letter chords before they reach the TUI. |
allow_create |
bool | no | Only valid on static_select and dynamic_select. When true, the user can type characters to filter options and enter a completely novel value if nothing matches. On static_select the new value is appended to the field's options in config.toml; on dynamic_select it creates a note in the source directory (see Auto-create Behavior). Defaults to false (closed list). |
wikilink |
bool | no | If true, wraps the output value in Obsidian wikilink syntax: [[value]]. Meant for text, static_select, and dynamic_select fields. Config load does not check the type, so it wraps any field it is set on. No-ops if the value is already wrapped. Defaults to false. |
create_template |
string | no | Only valid on dynamic_select fields with allow_create = true. References a template name from [templates.<name>]. When set, typing a novel value opens a sub-form overlay to fill in the template's fields before creating the note. Without this key, novel values create a bare stub note. |
post_create_command |
string | no | Obsidian command ID to execute after template-driven note creation (e.g. "templater:run"). Only valid when create_template is set. Fires via the REST API /commands/ endpoint; silently skipped on filesystem transport. |
show_when |
object | no | Conditional visibility rule. When present, the field is only rendered and navigable if the condition is satisfied. If the condition becomes false while the field is focused, focus moves to the nearest visible field. See Conditional Visibility below. |
icon |
string | no | Optional icon displayed next to the field prompt in the TUI form (e.g. "🫘"). Purely cosmetic — not written to output. |
preset_exclude |
bool | no | When true, this field is excluded from preset capture and application. Useful for notes/textarea fields whose values change every entry and shouldn't be part of a saved preset. Defaults to false. |
unit |
string | no | Only valid on counter. Display-only suffix (e.g. "oz") shown in the TUI and the one-shot echo. Never written to YAML. |
goal |
number | no | Only valid on counter. Reach-target rendered as 64/96. Config-only — pour never writes a goal into the vault. Obsidian-side progress rendering (Bases/Dataview) mirrors it in its own query. |
list |
bool | no | When true, values containing ", " are split on that delimiter and emitted as a YAML sequence in frontmatter (e.g. "a, b" → - a\n- b). When wikilink = true is also set, each split item is individually wrapped in [[...]]. Defaults to false — value is treated as a literal string and properly escaped. Valid on text, static_select, and dynamic_select. |
Output Target Defaults
| Field Type | Default Target |
|---|---|
text |
frontmatter |
number |
frontmatter |
static_select |
frontmatter |
dynamic_select |
frontmatter |
textarea |
body |
composite_array |
frontmatter |
toggle |
frontmatter |
counter |
frontmatter |
Any field can override its default via target = "frontmatter" or target = "body".
update-mode modules are the exception: they write frontmatter and nothing else, so a body-targeted field there is a config error rather than a silently dropped value.
Any field can be conditionally shown using a show_when block. Hidden fields are skipped during rendering and navigation.
[[modules.brew.fields]]
name = "pressure"
field_type = "number"
prompt = "Pressure"
[modules.brew.fields.show_when]
field = "method" # name of the controlling field
equals = "Espresso" # show only when method == "Espresso"
Or using one_of to match multiple values:
[modules.brew.fields.show_when]
field = "method"
one_of = ["Espresso", "Moka"]
Visibility rules:
equals: visible iffield_values[field] == equals(case-sensitive).one_of: visible iffield_values[field]matches any listed value (case-sensitive).- If the controlling field is absent or empty, the conditional field is hidden.
Submit behavior:
- Hidden fields are skipped during validation — a hidden
requiredfield does not block submit. - Hidden field values are cleared on submit, so no stale data appears in output.
- Hidden fields are excluded from frontmatter, body, and template placeholder resolution. Template placeholders for hidden fields resolve to empty string.
Navigation behavior:
- Tab/Shift-Tab/Up/Down bounds are computed from the visible field set, not total field count.
- If a field becomes hidden while focused (e.g. the user changes a controlling field), focus moves to the next visible field, then previous, then the submit button.
- New fields becoming visible do not steal focus.
Config validation rules:
- Exactly one of
equalsorone_ofmust be specified — not both, not neither. equalsmust not be an empty string.one_ofmust not be an empty array.show_when.fieldmust reference an existing field in the same module.- A field cannot reference itself.
- A field cannot reference a
composite_arrayfield as the controller. - Circular dependencies are rejected (A→B→A, or longer chains).
- Forward references (referencing a field defined later in the array) are allowed.
Limitations (v1):
show_whenis not supported oncomposite_arraysub-fields.- Only a single condition per field — no AND/OR combinators.
- No negation operators (
not_equals,none_of). - Matching is case-sensitive only.
text
Single-line free text input.
[[modules.coffee.fields]]
name = "origin"
field_type = "text"
prompt = "Bean origin"
TUI: Inline text input with cursor. Accepts any characters. A value wider than its row scrolls sideways within that row, keeping the cursor and the two characters after it on screen; ◂ and ▸ mark text hidden to the left and right. The cursor position counts display width per glyph as the terminal draws it, so CJK and emoji line up, including emoji built from several characters such as ❤️ and 👍🏽. number and counter inputs behave the same way.
Output: Value written to frontmatter (or body if overridden). In frontmatter it is double-quoted only when YAML would misread it bare: a value that parses as a number, a YAML word (true, false, null, yes, no, on, off, any case), a leading -, a line break, or a special character such as : # [ , ". If wikilink = true, the value is wrapped in [[...]] before output.
textarea
Multi-line text input with an editor overlay.
[[modules.me.fields]]
name = "body"
field_type = "textarea"
prompt = "What's on your mind?"
target = "body"
TUI: Opens a bordered overlay editor on Enter, directly below the field's row. While it is open the row shows only [^], after the [!type] header on a callout field, so the value is not drawn twice. Supports multi-line editing. The editor is 4 to 10 rows tall; near the bottom of the form it covers the footer. A value with more lines than the editor scrolls to keep the cursor's line on screen, with ▲ and ▼ on the border when lines are hidden above or below. Long lines scroll sideways, all lines by the same amount, with ◂ and ▸ marking hidden text. Escape closes the overlay.
Output: Defaults to Markdown body. Can be overridden to frontmatter.
Callout wrapping: When callout = "note" (or any Obsidian callout type) is set, the body output is automatically wrapped in blockquote callout syntax. This applies in both create mode (partition_fields) and append mode (template {{field}} substitution). Every line of the value gets > , and a blank line between paragraphs is written as > so the callout does not end at the gap. \r\n line endings are treated like \n, and a single trailing newline is dropped.
[[modules.me.fields]]
name = "notes"
field_type = "textarea"
prompt = "Notes"
callout = "tip"
Produces:
> [!tip]
> First paragraph, line one
> First paragraph, line two
>
> Second paragraph
Template-line bridging: A field without its own callout can still land in a callout through append_template, as the shipped me module does with "#### {{time}}\n> [!{{callout}}] {{title}}\n> {{body}}". When a multi-line value is substituted onto a template line that starts with >, every continuation line gets > and blank lines become > , the same lines the field-level wrapping above produces. A plain blockquote line such as > {{body}} bridges too, with or without a [!type] opener. The check runs per occurrence, so a placeholder used on a > line and again on an unprefixed line is bridged only on the > line. Lines that do not start with >, such as "- [ ] {{body}}", get the value verbatim, and a multi-line value there still spills past the first line.
Runtime cycling: When a textarea field has callout configured, Left/Right arrow keys cycle through callout types while the editor overlay is closed. The [!type] label is shown on the field row. The selected type overrides the config default for that entry only.
Available callout types: note, info, todo, tip, success, question, warning, failure, danger, bug, example, quote.
number
Numeric input. Restricts keyboard input to digits, ., and -.
[[modules.coffee.fields]]
name = "rating"
field_type = "number"
prompt = "Rating (1-5)"
default = "3"
TUI: Inline text input, filtered to numeric characters only.
Output: Depends on the write mode.
createmodules write the value as a quoted string:rating: "4",dose_g: "15". A number field goes through the same scalar quoting astext, and that quoting wraps anything that parses as a number so YAML keeps it a string. This holds for the TUI and forpour servecaptures alike, since both call the same create writer.updatemodules write a bare YAML number:rating: 4. Integral values drop the.0.appendmodules substitute the value into the template text exactly as typed.
Two related cases: number cells in a composite_array are written bare, and number fields in a [templates.<name>] sub-form are quoted like create-mode fields.
Validation: Non-numeric characters are rejected as you type. On submit, a non-empty value must also parse as a number (1-2 or . fails), in the TUI and over pour serve (invalid_number).
static_select
Dropdown with hardcoded options defined in config.
[[modules.coffee.fields]]
name = "brew_method"
field_type = "static_select"
prompt = "Brew method"
options = ["V60", "AeroPress", "Espresso", "French Press"]
TUI: Enter toggles a dropdown overlay. Up/Down cycles options while open. Enter again confirms selection. The selected value is shown inline when the dropdown is closed.
Output: Selected string written to frontmatter. If wikilink = true, the value is wrapped in [[...]] before output (e.g. roaster: "[[Onyx]]"), creating an Obsidian backlink to the named note.
Extensible options: With allow_create = true, a novel value typed into the open dropdown is accepted on Enter, appended to the in-memory options list, and persisted back to the field's options array in config.toml. Fields without allow_create remain locked to the configured options.
Validation: options must be present and non-empty. Config load fails otherwise. allow_create is only valid on static_select and dynamic_select fields.
dynamic_select
Dropdown populated from vault directory contents at runtime via the 3-tier fallback pipeline. With allow_create = true, novel values trigger inline note creation back into the vault.
[[modules.coffee.fields]]
name = "bean"
field_type = "dynamic_select"
prompt = "Bean"
source = "Coffee/Beans"
TUI: Same dropdown interaction as static_select. Options are populated via the 3-tier fallback: API directory listing, filesystem scan, JSON cache (~/.pour/cache/state.json), then freetext input if all fail.
When allow_create = true, the user can type characters directly into the field to filter the dropdown options (case-insensitive substring match). If typing produces no matching options, Enter accepts the typed text as a novel value. Backspace trims the typed text. Esc clears the search buffer before closing the dropdown. Navigating away (Tab/Shift-Tab) discards any unsaved search text.
Output: Selected (or typed) string written to frontmatter. If wikilink = true, the value is wrapped in [[...]] before output.
Validation: source must be present and must be a vault-relative path (no absolute, drive-qualified, UNC, or .. traversal paths). Config load fails otherwise. allow_create is only valid on dynamic_select and static_select; using it on any other field type fails config validation.
Source path: Relative to the vault root. Example: "Coffee/Beans" resolves to <vault_base_path>/Coffee/Beans/.
Auto-create Behavior
When allow_create = true and the submitted value is not in the existing options list (case-insensitive), Pour automatically creates a note at {source}/{sanitized_value}.md before writing the module output.
Without create_template — a bare stub note is created:
---
date: YYYY-MM-DD
---
With create_template — a sub-form overlay appears in the TUI, prompting the user to fill in the template's fields. The created note gets full frontmatter from the template. See Template-Driven Creation below.
The filename is sanitized: characters invalid on any platform (: ? * < > | " \ /) are replaced with -, consecutive dashes are collapsed, and Windows reserved device names (CON, NUL, COM1–COM9, etc.) are rejected. If the value sanitizes to an empty or reserved string, auto-creation is skipped and a one-line note is printed to stderr after the TUI exits.
The new entry is appended to the in-memory cache so the next dropdown opens with the value available immediately. Creation is best-effort — a transport failure is logged to stderr but does not block form submission.
Combined Example (bare stub)
[[modules.coffee.fields]]
name = "bean"
field_type = "dynamic_select"
prompt = "Bean"
source = "Coffee/Beans"
allow_create = true
wikilink = true
With this config, selecting or typing "Ethiopia Guji" writes bean: "[[Ethiopia Guji]]" to frontmatter and, if the value is novel, creates Coffee/Beans/Ethiopia Guji.md with a date frontmatter entry.
Template-Driven Creation
When create_template references a [templates.<name>] section, novel values trigger a sub-form overlay instead of creating a bare stub. This lets you capture structured metadata for the new note without leaving the TUI.
Flow
- User types a value that doesn't match any existing option.
- The sub-form overlay appears with the template's fields (text, number, static_select).
- User fills in the fields.
Tab/Shift+Tabnavigates,Enteron the submit button creates the note. - Pour writes the note with full YAML frontmatter:
date,name(the typed value), and all template fields. - If
post_create_commandis set and the API is connected, the Obsidian command fires (e.g. Templater processes the new file to add body content). - The parent form field is populated with the new value.
Esc cancels the sub-form without creating anything. If the terminal is too small for the overlay (< 10 rows or < 30 cols), Pour falls back to bare stub creation.
Combined Example (template + Command hook)
# Field references the template
[[modules.coffee.fields]]
name = "bean"
field_type = "dynamic_select"
prompt = "Bean"
source = "02 - Areas/204 - Cooking/Coffee/Beans"
allow_create = true
wikilink = true
create_template = "bean"
post_create_command = "templater:run"
# Template defines the sub-form fields and output path
[templates.bean]
path = "02 - Areas/204 - Cooking/Coffee/Beans/{{name}}.md"
[[templates.bean.fields]]
name = "roaster"
field_type = "text"
prompt = "Roaster"
[[templates.bean.fields]]
name = "origin"
field_type = "static_select"
prompt = "Origin"
options = ["Ethiopia", "Colombia", "Guatemala", "Kenya", "Brazil", "Yemen", "Blend"]
[[templates.bean.fields]]
name = "process"
field_type = "static_select"
prompt = "Process"
options = ["Washed", "Natural", "Honey", "Anaerobic", "Wet Hulled"]
default = "Washed"
[[templates.bean.fields]]
name = "roast_level"
field_type = "static_select"
prompt = "Roast level"
options = ["Light", "Light-Medium", "Medium", "Medium-Dark", "Dark"]
default = "Light"
[[templates.bean.fields]]
name = "bag_weight_g"
field_type = "number"
prompt = "Bag weight (g)"
default = "250"
Typing "Ethiopia Guji" opens the sub-form. After filling in roaster, origin, etc., Pour creates Beans/Ethiopia Guji.md:
---
date: 2026-04-02
name: Ethiopia Guji
roaster: Onyx
origin: Ethiopia
process: Washed
roast_level: Light
bag_weight_g: "250"
---
The number value comes out quoted, as it does for create-mode number fields (see `number`).
Then post_create_command fires templater:run, which can add body content (brew log table, tasting notes section, metadata) via an Obsidian Templater template.
toggle
A boolean property. Valid in any write mode — a general primitive, not a habit-only type.
[[modules.habit.fields]]
name = "cannabis"
field_type = "toggle"
prompt = "Partaken?"
TUI: Renders as [x] / [ ]; space flips it, and the footer says so (space flip) whenever the row is focused. Typing does nothing — there is no text buffer. On an update module the checkbox is seeded from the note's current value when the form opens. If the note holds something that is not a boolean word (a hand-edit, a value from before the field existed), the field is left unseeded and renders [?]: pour will not guess false on your behalf, and an unflipped [?] is skipped on submit so the note's value survives.
One-shot: pour habit cannabis sets true; pour habit cannabis false (or off) clears it. Also accepts on/yes/1 and no/0.
Output: On an update module, a bare YAML boolean: cannabis: true, never "true". On a create module the value goes through the text quoting rules instead, so it is written as cannabis: "true".
counter
A number that accumulates. Valid in any write mode, but only meaningful over time on an update module.
[[modules.habit.fields]]
name = "water"
field_type = "counter"
prompt = "Water"
unit = "oz" # display only, never written to YAML
goal = 96 # reach-target; progress renders as 64/96 oz
Semantics (update mode):
pour habit water 16→ read the current value, add 16, write.pour habit water =160→ set it. The fat-finger correction.- A missing key, an empty value, and an explicit
null/~all read as0, so a template'swater: null("untouched today") stays meaningfully distinct from an explicit0in the note. - A non-numeric current value (
water: lots) is an error, not a silent reset — incrementing it would destroy what is there. - Values parse as
f64; integral results emit bare (64, not64.0). - A blank counter on a submitted form means "no change", not "set to zero".
TUI: Inline input filtered to digits, ., -, and =. The footer spells out which is which (0-9 add, = set) whenever the row is focused, since a bare number and an =-prefixed one do opposite things. On an update module the row also shows the note's current state — now 64/96 oz — read once when the form opens. A failed or slow read renders now —/96 oz rather than blocking the form.
Echo: every write echoes the resulting state, water: 64/96 oz, which is simultaneously the confirmation, the correction prompt, and the progress display.
Output: On an update module, a bare YAML number. On a create module the typed token is written as a quoted string (water: "16"), with no reading of a prior value.
limit and limit_period are reserved on counter for periodic stay-under targets (the inverse of goal). They are not implemented — nothing reads them today.
composite_array
Tabular data entry with multiple columns (sub-fields). With the default frontmatter target it is written twice: as a YAML array of objects in frontmatter and as a Markdown table in the body. With target = "body" only the table is written.
[[modules.recipe.fields]]
name = "ingredients"
field_type = "composite_array"
prompt = "Ingredients"
[[modules.recipe.fields.sub_fields]]
name = "item"
field_type = "text"
prompt = "Item"
[[modules.recipe.fields.sub_fields]]
name = "amount"
field_type = "number"
prompt = "Amount"
[[modules.recipe.fields.sub_fields]]
name = "unit"
field_type = "static_select"
prompt = "Unit"
options = ["g", "ml", "oz", "cups", "tbsp", "tsp"]
TUI: Enter opens a bordered table editor overlay. Navigate cells with arrow keys. Tab advances to next cell. Enter inserts a new row below the current one, and Delete removes the current row. Space cycles a static_select cell. Escape closes the overlay. Empty rows are stripped on output. Inside the overlay, s saves the current rows as a per-field preset, l opens a picker over saved presets, and p cycles through them in place — see "Per-field presets" below. Those three keys are always taken by the preset actions, so a lowercase s, l, or p cannot be typed into a cell.
Output (frontmatter): Serialized as a YAML array of objects. Number sub-fields are written as unquoted YAML numbers. Other cells follow the text quoting rules, so plain words stay bare.
ingredients:
- item: flour
amount: 200
unit: g
- item: milk
amount: 250
unit: ml
Output (body): Rendered as a Markdown table.
Validation: sub_fields must be present and non-empty. Sub-field names must be unique. static_select sub-fields must have non-empty options.
Per-field Presets
Composite-array fields support saved row-set presets so high-friction inputs (recipes, pressure profiles, ingredient lists) can be replayed with a single keypress. Presets are scoped per module.field — coffee.recipe and coffee.pressure_profile have independent lists.
Storage: ~/.pour/field_presets.json (or $POUR_HOME/field_presets.json). User-curated, atomic-replaced on save, separate from module-level presets.json.
Keys (inside the composite overlay):
| Key | Action |
|---|---|
s |
Save current rows as a named preset. Opens a name + description prompt. Empty editors are rejected with a status message. |
l |
Open the load picker. Up/Down navigate, Enter applies, Ctrl+D deletes, Esc cancels. |
p |
Quick-cycle to the next saved preset. Wraps; no modal. |
Apply behaviour: Always replaces all existing rows silently — no confirmation prompt. The composite overlay shows preset: <name> as a subtitle once a preset has been applied so the active selection is visible.
Schema drift: If sub_fields changed since the preset was saved (column added or removed), each saved row is right-padded with empty strings or truncated to match the current sub-field count on apply. The status line reads "preset shape adjusted to current schema" so the change is visible; the on-disk preset is not rewritten — re-save with s to clean it up.
PWA Overlay Rendering
The PWA sub-form overlay (shipped in Phase 2, closed 2026-04-27) renders template fields using the same field-type contract defined in this document. Overlay rendering does not change any field-type semantics: text and number fields render as standard inputs; static_select fields render as inline-cycling controls (◂ ▸ chevrons) instead of a <select> element (PWA-only, no <select> in overlays per UX convention). The dynamic_select and composite_array types are not permitted as template fields (§7.4 already restricts templates to text | number | static_select). Output targets, required semantics, and default-value behavior are identical to the TUI sub-form overlay.
Template Fields and allow_create
Template fields ([[templates.<name>.fields]]) support allow_create = true on static_select fields only. When set, typing a novel value in the sub-form is accepted; after the templated note is written successfully, the new value is appended to the template field's options array in config.toml so it appears next session. Without allow_create, the sub-form static_select remains locked to the configured cycle of options.
Sub-field Types
Sub-fields support a restricted set of types — no nesting or dynamic data:
| Sub-field type | Description |
|---|---|
text |
Free text cell |
number |
Numeric cell (digits, ., - only) |
static_select |
Dropdown cell with options |
Module-Level Config Keys
These keys are set on the module itself, not on individual fields:
| Key | Type | Required | Description |
|---|---|---|---|
mode |
string | yes | "create" (new file per entry), "append" (add to existing note), or "update" (mutate frontmatter keys on an existing note — see `update` mode) |
path |
string | yes | Vault-relative output path. Supports strftime tokens: %Y, %m, %d, %H, %M, %S |
fields |
array | yes | At least one field definition |
display_name |
string | no | Human-readable name shown in the dashboard (defaults to module key) |
append_under_header |
string | conditional | Required when mode = "append". The Markdown heading to append under |
append_template |
string | no | Template for append-mode content. Supports {{time}}, {{date}}, {{callout}}, and field name placeholders. A multi-line value on a line that starts with > gets > on every continuation line, so > {{body}} keeps a multi-paragraph body inside the callout |
callout_type |
string | no | Obsidian callout type (e.g. "note", "tip"). Resolved as {{callout}} in append_template |
icon |
string | no | Unicode emoji shown in the TUI dashboard and written to frontmatter in create-mode output |
daily_link |
boolean | no | When true, create-mode output includes a daily frontmatter key linking to today's daily note, named with [vault].date_format (default %Y%m%d): daily: "[[20260405]]" |
append_shallow |
boolean | no | When true (append mode only), treats any subsequent heading as a section boundary — prevents sub-headings from being absorbed into the append target |
mobile_visible |
boolean | no | When false, this module is hidden from the mobile PWA (/api/v1/config omits it entirely). Defaults to true. Togglable from the module configure screen. |
base_path |
string | no | Per-module root override. When set, this module's path resolves against it instead of [vault].base_path. Absolute only — ~ is not expanded (Pour expands it nowhere). Absent → the vault, exactly as before. See Per-module root (`base_path`). |
[modules.<name>.platform] |
table | no | Per-OS overrides for this module's base_path, keyed by std::env::consts::OS (linux, macos, windows). Mirrors [vault.platform]. |
[modules.<name>.frontmatter] |
table | no | Static key→value frontmatter merged into create-mode output. Arrays render as YAML block sequences; scalars as scalars. No token interpolation — values are emitted literally. See Static module frontmatter. |
frontmatter_date_format |
string | no | strftime format for the auto-injected create-mode date key. Absent → %Y-%m-%d. Per-module only; there is no global equivalent. Create mode only. |
post_write_shell |
string | no | Shell command run after a successful write. Only the tokens in `post_write_shell` may be interpolated; anything else is rejected at load. |
post_write_shell_on_serve |
boolean | no | Whether post_write_shell also fires for captures submitted over the LAN (pour serve). Defaults to false. Requires post_write_shell. |
update mode
update resolves path (strftime-templated, like append) to an existing note and merges only the frontmatter keys named by the module's fields. The body is never touched, key order and quoting survive byte-for-byte, and no key outside the field list is rewritten.
[modules.habit]
mode = "update"
path = "06 - Periodic/00 - Daily/%Y%m%d.md"
display_name = "Habits"
icon = "🌱"
[[modules.habit.fields]]
name = "cannabis"
field_type = "toggle"
prompt = "Partaken?"
Transports. Over the API, one PATCH /vault/{path} per key with Operation: replace, Target-Type: frontmatter, Target: <key> — Obsidian's own metadata layer does the mutation, so pour never re-emits YAML. Over the filesystem it is a guarded surgical edit: capture mtime → read → replace exactly one line → re-verify mtime → atomic rename. The stat comes before the read deliberately, so a concurrent save that lands while pour is reading is caught as well. A mismatch aborts without writing. An API too old to serve the PATCH degrades to the filesystem path rather than failing the capture.
Multi-key writes are not atomic. The patch operation is single-key on both transports, so a module with two live fields writes two keys in sequence. Every value error (a bad token, a non-numeric current value) is raised before the first byte is written; only a transport failure — a concurrent save landing between the two patches, or I/O — can strike mid-write. When one does, the keys that already landed stay landed and the error names them, so a retry is an informed choice rather than a blind double-count.
Missing note. Pour never fabricates a daily note — the template owns that shape. Over the API it fires the daily-notes command and retries the read once; over the filesystem it fails loudly with an actionable message.
Missing key. If the note exists but the key doesn't (a stale template), the key is inserted into the existing frontmatter block, the capture succeeds, and a one-line notice tells you the template needs updating. Capture-first: refusing to log because a template drifted is exactly the friction pour exists to kill.
A note with no frontmatter block at all is an error on both transports. Pour mutates properties; it does not restructure notes.
Keys rejected on update modules, because they belong to another mode and silently ignoring them would be a trap: append_under_header, append_template, append_shallow, daily_link, frontmatter_date_format, [modules.<n>.frontmatter], plus any field that is composite_array, list = true, or targets the body.
One-shot capture
pour <module> <field> [value] # no TUI, write, echo, exit 0
$ pour habit water 16
water: 64/96 oz · ✓ 20260805.md
$ pour habit cannabis
cannabis: true · ✓ 20260805.md
pour <module> with no field argument opens the TUI form exactly as before. Unknown module, unknown field, or a bad value token exits non-zero with an actionable message before the vault is touched. v1 wires the grammar for toggle/counter fields on update modules only; text-bearing one-shots (pour me "thought") are deferred.
Per-module root (base_path)
By default every module writes under [vault].base_path. A module that sets its own base_path writes somewhere else entirely — useful when a capture target is genuinely not part of the vault (e.g. an agent inbox kept in a different git repo).
Resolution order, first match wins:
[modules.<name>.platform][OS] → [modules.<name>].base_path → [vault.platform][OS] → [vault].base_path
[modules.inbox]
mode = "create"
base_path = "/home/user/notes-repo" # absolute; `~` is NOT expanded
path = "inbox/%Y%m%d-%H%M%S{{slug}}.md"
# Optional: same logical root, different mount per machine.
[modules.inbox.platform]
windows = "C:\\Users\\user\\notes-repo"
Notes and limits:
pathstays root-relative. The override moves the root; it does not relax any guard. Absolute paths, drive letters, UNC paths, and..traversal are still rejected — now against the module's root.- Always filesystem transport. The Obsidian Local REST API can only address notes inside the vault it serves, so a root-overriding module bypasses the API even when it is connected. The TUI summary and the
/api/v1/submitresponse both reportFileSystemfor these captures — truthfully, not as a fallback. - Known limit: a
dynamic_selectsourceon a root-overriding module still resolves against the vault, not the module root. Reads and auto-creates stay consistent with each other; only the module's own note is redirected. - Windows-style and Unix-style absolute paths both validate on every OS — one
config.tomlis meant to describe every machine.
Static module frontmatter
[modules.<name>.frontmatter] holds keys that are a property of the module rather than of the capture:
[modules.inbox.frontmatter]
tags = ["inbox", "capture"]
cssclasses = ["poured"]
author = "sam"
---
date: 2026-07-16T14:32
kind: musing
author: sam
cssclasses:
- poured
tags:
- inbox
- capture
---
- Arrays always become block sequences, even single-element ones. This is not the
list = truepath, which only splits a comma-joined string and would rendertags = ["inbox"]as the scalartags: inbox. - Values are literal. There is no token interpolation here, deliberately — it is static config, not a template.
- Emitted after captured fields, in alphabetical key order (stable across runs).
- The capture wins on collision. A static whose key matches a captured field (or the injected
icon/daily) is skipped — a static is a default, not an override. - Create mode only. Append mode has no frontmatter block; setting it there is a validation error rather than a silent no-op.
dateis rejected as a static key — usefrontmatter_date_formatto change its shape.
Every plain module key (path, post_write_shell, …) must appear before [modules.<name>.frontmatter] and [modules.<name>.platform]. Once a sub-table header is opened, following bare keys belong to it — a post_write_shell written after [modules.inbox.frontmatter] silently becomes a frontmatter entry instead of a hook, with no error.
post_write_shell
An optional command run after a successful write — the step that turns a local file into something delivered (committed and pushed, synced, indexed).
[modules.inbox]
post_write_shell = "git add '{{rel_path}}' && git commit -q -m 'capture: {{slug_or_time}}' -- '{{rel_path}}' && git push -q"
# post_write_shell_on_serve = true # default false
Tokens — this list is exhaustive:
| Token | Value |
|---|---|
{{base_path}} |
the module's resolved root (the vault path when the module sets no base_path) |
{{rel_path}} |
written file, relative to base_path |
{{abs_path}} |
written file, absolute: base_path and rel_path joined with / on every OS |
{{slug}} |
kebab-cased title field, dash-prefixed (-my-title); empty when untitled |
{{slug_or_time}} |
bare slug (my-title), or a %Y%m%d-%H%M%S timestamp when untitled |
Any other token — including {{field_name}} and {{title}} — is rejected at config-load time, not silently stripped (contrast path, where unknown placeholders are stripped). Token spelling is exact: {{ slug }} is an error, not a synonym for {{slug}}.
Semantics:
- Working directory is
base_path— sogit add <rel_path>needs nogit -C. - Runs through the OS shell (
sh -c/cmd /C), so&&and pipelines work. - Best-effort, never fatal. The note is on disk before the hook runs. A non-zero exit, a spawn failure, or a 30s timeout surfaces as a warning (TUI summary message, or a
post_write_shell_failedwarning on the 201) — the capture is never lost. - The child gets null stdin and piped stdout/stderr: a command that prompts fails fast instead of hanging behind the TUI, and its output cannot corrupt the terminal.
post_write_shell_on_servedefaults tofalse. A LAN capture does not run commands unless the module opts in. (The wire DTO cannot carry config keys at all, so this is a second gate, not the only one.)- One-shot capture (
pour <module> <field> [value]) never runs the hook. Only TUI saves and, when opted in,pour servecaptures do.
It is safe to interpolate without quoting only because no token can carry raw user text — the slug is [a-z0-9-] by construction. If a hook ever needs a token that can carry user text, that is the trigger to move to argv-style execution, not to extend the token list. Note also that a hook which auto-commits and pushes makes a bad capture public history.
{{slug}} in path
{{slug}} and {{slug_or_time}} are special path tokens (like {{date}} and {{time}}), derived from the module's title field:
title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "")
- Runs of non-
[a-z0-9]collapse to a single-; leading/trailing dashes are trimmed. All non-ASCII is dropped —café→caf— matching the Obsidian Templater's JS exactly, so hand-authored and poured notes land on the same name. {{slug}}is dash-prefixed so%Y%m%d-%H%M%S{{slug}}.mdreads20260716-143255-my-title.mdwhen titled and20260716-143255.mdwhen not.- A field literally named
slugis shadowed by the token (as a field nameddatealready is). - Use
%Sin an untitled-capable path. Two untitled captures in the same minute collide, and a filesystem collision is a hard error that discards the entry just typed — not a silent overwrite.
Top-Level Config Keys
| Key | Type | Description |
|---|---|---|
config_version |
string | Optional semver string declaring the config schema version. Defaults to "0.1.0" when absent. Current version: "0.4.0". It must be major.minor.patch with numeric segments and no leading zeros. A config newer than the build is rejected at load with an "update Pour" message. While the major is 0, the minor decides that, so a 0.5.0 config fails on a 0.4.0 build. Older versions always load. The schema version is separate from the app version in Cargo.toml. |
[vault].base_path |
string | Absolute path to the Obsidian vault root |
[vault.platform] |
table | Per-OS overrides for base_path, keyed by std::env::consts::OS (linux, macos, windows). A key matching the running OS wins; otherwise base_path is used. |
[vault].api_port |
integer | REST API port (default: 27124) |
[vault].api_key |
string | Bearer token for API auth (overridden by POUR_API_KEY env var). Prefer ~/.pour/secrets.toml over storing here. |
[vault].date_format |
string | strftime format string used to expand the {{date}} placeholder in module path values. Also names the daily_link target and the file pour generates when a create-mode path has no extension. Defaults to "%Y%m%d" when absent. Example: "%Y-%m-%d" produces 2026-04-21. It does not apply to append_template, where {{date}} is always %Y-%m-%d. |
module_order |
string[] | Optional dashboard display ordering. Modules not listed appear alphabetically after listed ones |
[sound].on_save |
boolean | Play one short synthesized tone when a TUI capture saves (the summary reads ▽ saved). Default false, and when off pour opens no audio device. Never plays on ! error, for one-shot capture, or for pour serve. Saves during a tone queue and play in turn. If playback fails (no output device, an SSH session), a one-line status toast says so and the capture is unaffected. That toast shows at most once per session and never replaces another toast. |
[sound] Example
[sound]
on_save = true
It's a table rather than a bare key because of where TOML puts things. A top-level sound_on_save = true appended to the end of config.toml would land inside whichever table came last and be silently ignored. A [sound] table can go anywhere in the file.
date_format Example
date_format controls what {{date}} resolves to in a module path. It does not affect strftime tokens (%Y, %m, %d) — those always expand using the standard strftime rules. In append_template, {{date}} ignores date_format and is always %Y-%m-%d; write strftime tokens in the template if you want another shape.
[vault]
base_path = "/path/to/vault"
date_format = "%Y-%m-%d" # {{date}} → "2026-04-21" (default: "%Y%m%d" → "20260421")
Use {{date}} in a path:
[modules.note]
mode = "create"
path = "Notes/%Y/%m/{{date}}-{{title}}.md"
[modules.journal]
mode = "append"
path = "Daily/{{date}}.md"
append_template = "- {{time}} | {{body}}" # {{date}} here would be %Y-%m-%d
date_format is editable from the dashboard via vault settings (v → date_format field).
Templates
Templates define the note structure created when a dynamic_select field with create_template triggers inline creation. Each [templates.<name>] block specifies the output path and a set of fields that appear in a sub-form overlay.
Template Config Keys
| Key | Type | Required | Description |
|---|---|---|---|
path |
string | yes | Vault-relative output path for the created note. Must contain {{name}} (replaced with the user's typed value). Supports strftime tokens (%Y, %m, %d). Must not contain .. path traversal. |
fields |
array | yes | At least one field definition (see below) |
Template Field Keys
| Key | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Field identifier, used as the YAML frontmatter key. Must not be date or name (these are auto-generated). |
field_type |
string | yes | text, number, or static_select only |
prompt |
string | yes | Label shown in the sub-form overlay |
options |
string[] | conditional | Required for static_select |
default |
string | no | Pre-filled value. If the user leaves a field empty and no default exists, the key is omitted from frontmatter. |
allow_create |
bool | no | Only valid on static_select template fields. Accepts a typed value outside options and appends it to the field's options in config.toml after the note is written. See Template Fields and `allow_create`. |
How Pour Templates Relate to Obsidian Templater
Pour templates and Obsidian's Templater plugin serve complementary roles:
- Pour templates define and collect structured frontmatter at capture time (in the terminal, before the file exists).
- Templater templates add body content, dynamic expressions, and formatting after the file is created (inside Obsidian).
The post_create_command config key bridges the two: after Pour writes the note with frontmatter, it fires an Obsidian command (e.g. templater:run) via the REST API, which triggers Templater to process the file. The Templater template can read Pour's frontmatter with tp.frontmatter and use it to build the note body.
Example coordination:
- Pour's
[templates.bean]collectsroaster,origin,process,roast_level,bag_weight_gand writes them as YAML frontmatter. post_create_command = "templater:run"fires Templater.- Templater's
(TEMPLATE) Bean.mdreadstp.frontmatter.roasterandtp.frontmatter.originto build a wikilinked header, brew log table, and metadata block.
This means Pour handles data capture and Templater handles presentation — each doing what it's best at. Users who don't use Templater still get a fully functional note with clean frontmatter.
Validation Rules
- Template
pathmust contain{{name}} - Template
pathmust be vault-relative: no absolute, drive-qualified, or UNC paths, and no..segments - A template must have at least one field
static_selecttemplate fields require non-emptyoptions- Template field names must be unique within a template
- Field names
dateandnameare reserved (auto-generated in frontmatter) create_templateis only valid ondynamic_selectfields withallow_create = truepost_create_commandrequirescreate_templateto be set on the same field- Referenced template names must exist in
[templates]
Module Validation Rules (root, frontmatter, hooks)
-
Every module must have at least one field, and field names must be unique within a module
-
module.pathmust be vault-relative (no absolute, drive-qualified, UNC, or..paths) -
appendmodules requireappend_under_header -
updatemodules rejectappend_under_header,append_template,append_shallow,daily_link, and any field that iscomposite_array,list = true, or targets the body -
list = trueis only valid ontext,static_select, anddynamic_select -
unitandgoalare only valid oncounterfields -
base_pathand every[modules.<name>.platform]value must be absolute and must not start with~ -
module.pathmust stay root-relative even whenbase_pathis set (no absolute, drive-qualified, UNC, or..paths) -
[modules.<name>.frontmatter]values must be a string, number, boolean, or a flat array of those — nested tables and TOML datetimes are rejected -
dateis not a permitted[modules.<name>.frontmatter]key (auto-injected; usefrontmatter_date_format) -
[modules.<name>.frontmatter]andfrontmatter_date_formatarecreate-mode only -
post_write_shellmay only interpolate{{base_path}},{{rel_path}},{{abs_path}},{{slug}},{{slug_or_time}}; any other token is a load error -
post_write_shellmust not be empty -
post_write_shell_on_serverequirespost_write_shell