Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

309 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 English | 繁體中文

TypeMD icon

TypeMD

A local-first CLI knowledge management tool inspired by Anytype and Capacities.

Website Β· Docs Β· GitHub

Your knowledge base is made of Objects β€” not files. Markdown is just the storage format.

Philosophy

Most note-taking tools make you think like a computer: files, folders, hierarchies.

TypeMD lets you think in Objects β€” books, people, ideas, meetings β€” connected by Relations. The structure emerges from your knowledge, not from a folder tree.

Features

  • Typed Objects β€” define schemas for each type (Book, Person, Idea, etc.)
  • Structured Relations β€” connect objects with named, optionally bidirectional links
  • Wiki-links & Backlinks β€” link objects inline with [[type/name-ulid]] syntax, with automatic backlink tracking
  • Full-text search β€” find anything across your vault
  • Structured queries β€” filter objects by type, property, or relation
  • TUI β€” Three-panel interface powered by Bubble Tea, with inline property editing and auto-refresh on file changes
  • Web UI β€” Browser-based interface via tmd serve, with three-panel layout, property editing, and object creation
  • AI Assist β€” generate descriptions, suggest tags, and explore schemas with Claude AI in the TUI
  • MCP Server β€” integrate with AI assistants via Model Context Protocol
  • Local-first β€” everything lives on your machine as plain Markdown files

Data Structure

vault/
β”œβ”€β”€ .typemd/
β”‚   β”œβ”€β”€ index.db            # SQLite index (auto-updated)
β”‚   └── tui-state.yaml      # TUI session state (auto-saved)
β”œβ”€β”€ types/                  # user-defined type schemas (directory format)
β”‚   β”œβ”€β”€ book/
β”‚   β”‚   └── schema.yaml     # you create these
β”‚   └── person/
β”‚       └── schema.yaml
β”œβ”€β”€ properties/
β”‚   β”œβ”€β”€ <name>.yaml         # shared property definitions (optional, one per property)
β”‚   └── ...
β”œβ”€β”€ templates/              # object templates by type (optional)
β”‚   └── book/
β”‚       └── review.md       # template with default frontmatter + body
└── objects/
    β”œβ”€β”€ book/
    β”‚   └── golang-in-action-01jqr3k5mpbvn8e0f2g7h9txyz.md
    └── person/
        └── alan-donovan-01jqr3k8yznw2a4dbx6t7c9fpq.md

Objects are stored as Markdown files with YAML frontmatter. Each directory under objects/ is a type namespace β€” different types can share the same slug.

The full Object ID is type/<slug>-<ulid>, e.g. book/golang-in-action-01jqr3k5mpbvn8e0f2g7h9txyz. A ULID is automatically appended to every new object to guarantee uniqueness.

Installation

brew install typemd/tap/typemd-cli

Or from source:

go install github.com/typemd/typemd/cmd/tmd@latest

Pre-built binaries are also available on GitHub Releases.

Usage

# Initialize a new vault
tmd init

# Open TUI
tmd

# Create objects (names are auto-slugified, ULID appended)
tmd object create book "Clean Code"
tmd object create "Some Thought"          # uses default type from config

# Search and explore
tmd search "concurrency"
tmd object show book/clean-code           # prefix matching, no full ULID needed
tmd object list

# Connect objects (name references in frontmatter auto-expand on sync)
tmd relation link book/golang-in-action author person/alan-donovan

# Manage templates
tmd template list                         # list all templates
tmd template show book/review             # view template content
tmd template create book/review           # create and open in $EDITOR
tmd template delete book/review           # delete with confirmation

# Maintenance
tmd format                                # normalize frontmatter & schema formatting
tmd doctor                                # vault health check
tmd stats                                 # vault-wide statistics

# Web UI
tmd serve                                 # starts web UI at http://localhost:3000
tmd serve -p 8080                         # custom port

# MCP server for AI integration
tmd mcp

See tmd --help and docs for the full command reference.

TUI

β”Œβ”€ Objects ─────────┐  β”Œβ”€ Body ─────────────┐  β”Œβ”€ Properties ──────┐
β”‚ β–Ό book (2)        β”‚  β”‚ # Notes            β”‚  β”‚ title: Go in      β”‚
β”‚   golang-in-actionβ”‚  β”‚ A great book about β”‚  β”‚   Action          β”‚
β”‚   clean-code      β”‚  β”‚ Go...              β”‚  β”‚ status: reading   β”‚
β”‚ β–Ά person (1)      β”‚  β”‚                    β”‚  β”‚ author:           β”‚
β”‚ β–Ά note (3)        β”‚  β”‚                    β”‚  β”‚   β†’ person/alan   β”‚
β”‚                   β”‚  β”‚                    β”‚  β”‚                   β”‚
β”‚                   β”‚  β”‚                    β”‚  β”‚                   β”‚
β”‚                   β”‚  β”‚                    β”‚  β”‚                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Press ? in the TUI for the full keybinding reference.

Type Schema

Define your types in types/ (tag and page are built-in β€” all others are user-defined):

# types/book/schema.yaml
name: book
plural: books
emoji: πŸ“š
properties:
  - name: title
    type: string
  - name: author
    type: relation
    target: person
    bidirectional: true
    inverse: books
  - name: status
    type: select
    options:
      - value: to-read
      - value: reading
      - value: done
    default: to-read
  - name: rating
    type: number

Relations are defined as type: relation properties. Use bidirectional and inverse to auto-sync both sides. See docs for full schema reference.

MCP Server

Run tmd mcp to start a Model Context Protocol server over stdio. AI clients (e.g. Claude Code) can read and write your vault through these tools:

Tool Description
search Full-text search objects, returns ID, type, and filename
get_object Get full object detail by ID, including properties and body
list_types List all available type schemas with metadata
vault_overview One-call vault summary: per-type count, emoji, description, and recent objects
list_objects List object summaries with optional type filter and pagination
query_objects Structured query with filters, optional sort, and pagination
list_backlinks Return wiki-link and typed-relation backlinks for an object
vault_stats Per-property distribution stats for a single type (filled, fill rate)
create_object Create a new object with type, name, optional template, properties, and body
update_object Update an object's properties (merge) and/or body (replace)
link_objects Create a relation between two objects
unlink_objects Remove a relation between two objects

Architecture

TypeMD is a monorepo with a shared Go core and multiple interfaces:

typemd/
β”œβ”€β”€ core/       # Core library β€” objects, types, relations, index
β”œβ”€β”€ cmd/        # CLI commands (Cobra)
β”œβ”€β”€ tui/        # Terminal UI (Bubble Tea)
β”œβ”€β”€ mcp/        # MCP server for AI integration
β”œβ”€β”€ web/        # Web UI β€” Go HTTP server + React frontend
β”œβ”€β”€ site/       # Official website (Astro) β†’ typemd.io
β”œβ”€β”€ docs/       # Documentation (Starlight) β†’ docs.typemd.io
└── app/        # Desktop app (planned)

All interfaces share the same core library.

Tech Stack

  • Language: Go
  • TUI: Bubble Tea + Lip Gloss
  • Web UI: React + Tailwind CSS + Vite (embedded in Go binary)
  • MCP: mcp-go β€” Model Context Protocol server
  • Index: SQLite with FTS5 full-text search
  • Storage: Markdown + YAML frontmatter

Resources

Inspiration

  • Anytype β€” encrypted, local-first alternative to cloud apps
  • Capacities β€” object-based knowledge studio

Releases

Packages

Contributors

Languages