Skip to main content

mdix is a command-line toolkit that keeps Markdown knowledge bases consistent, especially when humans and AI agents maintain them together.

Project description

mdix - Agent-friendly Markdown Toolkit

mdix is a command-line toolkit that keeps Markdown knowledge bases consistent, especially when humans and AI agents maintain them together.

The setup: You keep a folder of Markdown files — one per entity — with YAML frontmatter for metadata. You browse and edit in Obsidian (or any editor), and an AI agent researches, creates, and curates notes alongside you. Git tracks history. Structure grows organically as you learn more about the subject.

The problem: Over time, this workflow accumulates drift. Filenames follow mixed conventions, frontmatter keys diverge (type vs kind, renamed fields that linger), value vocabularies become inconsistent (active, identified, is_identified), and partial metadata silently propagates into new notes. This makes agent behavior less reliable, search noisier, and automation harder to trust.

What mdix does: It gives the agent that works alongside you a command-line interface to search, validate, and normalize frontmattser across your vault, with dry-run previews, schema contracts, and stable machine-readable output. Tell your agent to run mdix --help and it can orient itself and start using mdix competently.

For more background, see docs/why.md.

Prerequisites

  • Python 3.11+
  • uv (recommended) or pipx/pip
  • jq (optional, used in examples to filter JSON output)

Installation

Recommended: run with uvx (no install)

uvx mdix --help
uvx mdix --root ~/notes find "search term"

Install as a tool

uv tool install mdix
# or
pipx install mdix
# or
pip install --user mdix

Quick start

No git clone needed. Download a demo vault and start exploring:

# Copy a demo vault to your current directory
uvx mdix demo great-discoveries
cd great-discoveries

# Text search across notes
uvx mdix find relativity

# List notes that have a specific frontmatter key
uvx mdix ls --has fm.status

# Query all notes as JSON; filter with jq to show only those with errors
uvx mdix q | jq '[.[] | select((.errors | length) > 0) | {path, errors}]'

There is also an energy storage vault (17 notes with a schema and agent instructions):

uvx mdix demo energy-storage
cd energy-storage

uvx mdix schema validate --human
uvx mdix schema inventory --human

See INSTRUCTIONS.md in that vault for the entry point an agent would use.

Commands

Command What it does
mdix q Index all notes as JSON (path, frontmatter, errors). YAML dates are serialized as ISO-8601. Add --fail-on-errors / --strict to exit non-zero on parse errors.
mdix find <text> Full-text search across notes
mdix ls List notes, optionally filtered by frontmatter keys (--has fm.status)
mdix fm show <path> Inspect frontmatter on one note
mdix fm normalize Batch frontmatter normalization: value remapping, defaults, derived fields, null-key removal. Always supports --dry-run.
mdix schema inventory Frontmatter key inventory and drift visibility across the vault
mdix schema validate Check notes against mdix.schema.yml. Exits 2 on violations. Supports --include/--exclude glob filters.
mdix schema migrate Apply key/value/default/null migrations defined in the schema. Supports --dry-run and --include/--exclude.

Read-only commands (never write files): q, find, ls, fm show, schema inventory, schema validate, and any command with --dry-run.

Commands that write files: fm normalize (without --dry-run), schema migrate (without --dry-run).

Full help:

mdix --help
mdix <command> --help

Schema contract (mdix.schema.yml)

Place an mdix.schema.yml in your vault root (or pass --schema-path):

version: 1
fields:
  title:
    type: string
    required: true
  type:
    type: string
    required: true
    enum: [person, discovery, media, subject]
  position:
    type: string
  kontakt.email:
    type: string
migrations:
  - op: rename
    from: rolle
    to: position
  - op: rename
    from: kontakt_email
    to: kontakt.email
  - op: value_map
    field: status
    map:
      active: identified
  - op: set_default
    field: type
    value: person
  - op: unset_if_null
    field: legacy_note

Then validate and migrate:

mdix --root ~/notes schema validate
mdix --root ~/notes schema migrate --dry-run
mdix --root ~/notes schema migrate

Going further

Status

Early-stage.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdix-0.1.0.tar.gz (80.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdix-0.1.0-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

Details for the file mdix-0.1.0.tar.gz.

File metadata

  • Download URL: mdix-0.1.0.tar.gz
  • Upload date:
  • Size: 80.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for mdix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90d59a34b42547a40e707159e08154ca301903d810d3807d186df1bad8e27b3b
MD5 3a8acaa7650153373bdc833d3860f903
BLAKE2b-256 2933afa24b0808173586e434dfb1d999c26b914312b01379d9903c686f20867e

See more details on using hashes here.

File details

Details for the file mdix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for mdix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf6edc0330ca060ab4b7b1a64080901aca1aec135a47e0150589bc05d27dc5bb
MD5 112fd0b5e20e2b0b8582604cd9402b84
BLAKE2b-256 809b5bd9554bb61fb0076072fd4d4de14d3ebabe7d8954ead0e65d59b440b1c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page