Skip to content

Configuration

Each vault has an optional configuration file at .typemd/config.yaml. It controls CLI defaults, TUI behavior, and AI features. The file is created automatically when you run tmd init or tmd config set.

my-vault/
└── .typemd/
└── config.yaml

The config uses YAML with top-level display settings and three namespaces:

date_format: "YYYY-MM-DD"
datetime_format: "YYYY-MM-DD HH:mm:ss"
cli:
default_type: page
tui:
debounce_ms: 200
stats_type_layout: fullscreen
toast:
duration_ms: 3000
dismiss_key: esc
ai:
enabled: true
default: claude
providers:
claude:
type: cli
model: claude-sonnet-4-6-20250627
ollama:
type: openai-compatible
base_url: http://localhost:11434
model: qwen3-coder:30b
prompts:
describe: "Custom prompt for descriptions"
explore:
sample_count: 20
body_truncate: 1000
KeyTypeDefaultDescription
date_formatstringYYYY-MM-DDDisplay format for date properties
datetime_formatstringYYYY-MM-DD HH:mm:ssDisplay format for datetime properties and system timestamps (created_at, updated_at)

These settings control how dates appear in the TUI and CLI. Storage format is unchanged (ISO 8601 / RFC 3339).

Supported tokens: YYYY (year), MM (month), DD (day), HH (24-hour), mm (minute), ss (second). Unrecognized characters pass through as literals.

# European format
date_format: "DD/MM/YYYY"
datetime_format: "DD/MM/YYYY HH:mm:ss"
# Japanese style
date_format: "YYYY年MM月DD日"
KeyTypeDefaultDescription
cli.default_typestring(empty)Default type for tmd object create when no type argument is given

When set, you can create objects without specifying a type:

Terminal window
# Without default_type — type is required
tmd object create idea "My Idea"
# With cli.default_type: idea
tmd object create "My Idea"
KeyTypeDefaultDescription
tui.debounce_msint200File watcher debounce interval in milliseconds
tui.stats_type_layoutstringfullscreenStats type detail layout: fullscreen or popup
tui.toast.positionstringbottom-rightToast display position: bottom-right or help-bar
tui.toast.duration_msint3000Auto-dismiss duration in milliseconds
tui.toast.dismiss_keystringescKey to manually dismiss a toast notification
tui.toast.show_warningsbooltrueShow warning-level toast notifications
tui.toast.show_successboolfalseShow info/success-level toast notifications
tui.theme.focus_borderstring63Focused panel border color (ANSI code or hex)
tui.theme.wiki_linkstring33Wiki-link display text color
tui.theme.headingstring3Markdown heading color
tui.theme.boldstring(empty)Bold text color (empty = bold weight only)
tui.theme.italicstring(empty)Italic text color (empty = italic style only)
tui.theme.inline_codestring245Inline code color
tui.theme.code_blockstring245Fenced code block color
tui.theme.linkstring33Markdown link color
tui.theme.blockquotestring8Blockquote line color
tui.theme.hrulestring8Horizontal rule color
tui.keybindings.<action>string(per-action default)Override a global TUI keybinding by action name. See TUI customization for the full action list and validation rules.

The file watcher monitors objects/ and types/ for changes. The debounce interval controls how quickly the TUI reacts to file modifications — lower values make updates feel more instant, higher values reduce redundant refreshes.

Toast notifications appear in the bottom-right corner of the TUI for transient messages such as sync warnings (unresolved references) and AI operation errors. They auto-dismiss after duration_ms and can be manually dismissed by pressing the dismiss_key. Error-level toasts always show regardless of configuration.

AI features support multiple providers. The cli type uses the Claude CLI binary; the openai-compatible type works with any OpenAI-compatible API (Ollama, LM Studio, vLLM, LocalAI, etc.).

KeyTypeDefaultDescription
ai.enabledboolfalseEnable AI features in the TUI
ai.defaultstring(empty)Name of the active provider from ai.providers
ai.providers.<name>.typestringProvider type: cli or openai-compatible
ai.providers.<name>.modelstring(empty)Model identifier
ai.providers.<name>.base_urlstring(empty)HTTP endpoint (required for openai-compatible)
ai.providers.<name>.api_keystring(empty)Optional Bearer token for authentication

Example with multiple providers:

ai:
enabled: true
default: ollama
providers:
claude:
type: cli
model: claude-sonnet-4-6-20250627
ollama:
type: openai-compatible
base_url: http://localhost:11434
model: qwen3-coder:30b
my-server:
type: openai-compatible
base_url: http://192.168.1.100:8080
model: llama3.2
api_key: sk-my-key

Switch providers by changing ai.default — no other changes needed.

KeyTypeDefaultDescription
ai.prompts.describestring(built-in)Custom system prompt for description generation
ai.prompts.tagstring(built-in)Custom system prompt for tag suggestions
ai.prompts.explorestring(built-in)Custom system prompt for schema exploration
ai.explore.sample_countint10Number of objects sampled for schema exploration
ai.explore.body_truncateint500Max characters of object body included in explore prompt

When ai.enabled is true, the TUI adds two AI keybindings:

  • g in object detail — open AI action picker (generate description / suggest tags)
  • ctrl+e from sidebar — enter schema explore mode

You can edit .typemd/config.yaml directly, use the CLI, or use the TUI settings page (press , in the TUI to open a browsable config editor):

Terminal window
# Set a value
tmd config set ai.enabled true
# Get a value
tmd config get cli.default_type
# List all set values
tmd config list
# List all known keys with defaults
tmd config list --all

Only known keys are accepted. Setting an unknown key returns an error listing the valid keys.

If .typemd/config.yaml does not exist or a key is not set, TypeMD uses sensible defaults:

  • No default type — tmd object create requires a type argument
  • File watcher debounce at 200ms
  • Stats layout in fullscreen mode
  • Toast notifications: bottom-right, 3s auto-dismiss, Esc to dismiss, warnings shown, success hidden
  • AI features disabled
  • Built-in prompts for all AI operations
  • 10 sample objects and 500 character body limit for schema exploration