使用说明
tnotes
AI-native note-taking for plain Markdown files.
tnotes is a small Go CLI with an MCP server and a Neovim/Telescope plugin.
Notes live as regular .md files with YAML frontmatter. The derived search indexes live in a per-machine cache, outside the notes directory.
Features
- plain Markdown notes with YAML frontmatter
- timestamp-based note IDs
- fast indexed search over titles and content
- automatic
project:<name>andpath:<cwd>tags on note creation - MCP server for AI assistants
- Neovim plugin with Telescope pickers
Install
CLI
go install github.com/toshism/tnotes@latest
Neovim
Requires:
tnotesin your$PATHtelescope.nvimplenary.nvim
{
"toshism/tnotes",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("tnotes").setup()
end,
}
Quick start
# initialize the notes directory (default: ~/tnotes)
tnotes init
# create a note
tnotes add "My first note"
# create a note with tags
tnotes add "Search ideas" --tags search,bleve
# list notes
tnotes list
# search notes
tnotes search "query"
tnotes search --tag meeting
tnotes search --project toshism/tnotes "index rebuild"
# show a note by ID
tnotes show 20260219143022
# force a full rebuild of the indexes
tnotes index
All commands support --json.
Storage and config
By default notes are stored in ~/tnotes.
You can override the notes directory with, in priority order:
--dirTNOTES_DIR~/.config/tnotes/config.toml
Example config:
notes_dir = "~/notes/tnotes"
The notes directory holds only your *.md note files. The indexes for it live in
$XDG_CACHE_HOME/tnotes/<notes-dir-path>/ (default ~/.cache/tnotes/):
index.jsonmetadata indexbleve/full-text search index
The indexes hold absolute paths, so each machine keeps its own. This lets you sync the notes
directory (for example with Syncthing) to machines that mount it at different paths. search,
list and show check the notes on disk before reading, and update the indexes for any note
that was added, changed or deleted, including notes edited outside tnotes. A full rebuild
(tnotes index) is only needed if the cache gets into a bad state.
Older versions kept the indexes in a .tnotes/ folder inside the notes directory. Current
versions ignore it. Once every machine runs a current version, you can delete it.
Project tagging
When creating notes, tnotes resolves the project name in this order:
.tnotes-projectfile found by walking upward- git remote
origin, normalized toorg/repo - current directory basename
New notes automatically get:
project:<resolved-project>path:<current-working-directory>
You can also set the project explicitly with tnotes add --project <name>.
Search
tnotes search searches indexed note titles and content.
Examples:
tnotes search "roadmap"
tnotes search --tag meeting
tnotes search --project toshism/tnotes "bleve"
tnotes search --snippet "index"
The Neovim Telescope picker also supports prompt prefixes like:
tag:meetingproject:toshism/tnotestag:meeting project:toshism/tnotes roadmap
MCP server
Run the stdio MCP server with:
tnotes mcp
Claude Code / Claude Desktop config:
{
"mcpServers": {
"tnotes": {
"command": "tnotes",
"args": ["mcp"]
}
}
}
Custom notes directory:
{
"mcpServers": {
"tnotes": {
"command": "tnotes",
"args": ["mcp", "--dir", "/path/to/notes"]
}
}
}
Available MCP tools:
tnotes_inittnotes_listtnotes_searchtnotes_showtnotes_addtnotes_index
Neovim
Default mappings:
| Key | Action |
|---|---|
gf |
Follow [[wiki links]] in Markdown, otherwise normal gf |
<leader>nn |
Create a new note |
<leader>ns |
Open the main indexed notes picker |
<leader>nt |
Browse tags |
User commands:
:TnotesNew [title]:TnotesRefresh:Telescope tnotes notes:Telescope tnotes notes_all:Telescope tnotes tags:Telescope tnotes search
Example config:
require("tnotes").setup({
bin = "tnotes",
mappings = {
follow_link = "gf",
new_note = "<leader>nn",
search = "<leader>ns",
tags = "<leader>nt",
},
telescope = {
theme = nil, -- or "dropdown", "ivy", "cursor"
},
})
CLI reference
| Command | Description |
|---|---|
tnotes init |
Initialize a notes directory |
tnotes add <title> |
Create a note |
tnotes list |
List notes |
tnotes show <id> |
Print a note |
tnotes search [query] |
Search notes |
tnotes index |
Rebuild metadata and search indexes |
tnotes mcp |
Run the MCP server over stdio |
License
MIT