个人知识管理系统

一个用于日常日志、会议记录和想法捕捉的个人知识管理系统,具有MCP集成、全文搜索和Git同步功能。

  • by laspencer91
  • TypeScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 laspencer91/better-notes

使用说明

更好的笔记

一个个人知识管理系统,用于日常日记、会议笔记和捕捉想法。使用MCP(模型上下文协议)集成构建,用于Claude、全文搜索、git同步和跨项目的git活动跟踪。

使用它来:

  • 通过Claude对话记录每日笔记、会议摘要和想法
  • 自动跟踪对人物(@hannah)和主题(#project)的提及
  • 使用自然语言查询搜索所有笔记
  • 监控多个存储库中的git活动
  • 结合注释和代码提交生成每日摘要

特性

  • MCP集成:使用Claude自然地创建、搜索和管理笔记
  • 全文检索:在所有笔记中使用SQLite进行搜索
  • Git自动同步:自动提交和推送,智能取消公告
  • Git活动跟踪:监控跨多个存储库的提交
  • 每日总结:结合笔记和git活动生成摘要
  • 实体提取:自动跟踪人们的@提及
  • 后台守护程序:文件监视和同步在后台运行
  • 人类可读存储:按日期组织的Markdown文件

安装

npm install -g @better-notes/cli

快速开始

  1. 初始化:

    better-notes init
    
  2. 启动守护进程 (可选,用于文件监视和git同步):

    better-notes daemon start
    
  3. 添加到克劳德代码 (一个衬垫):

    claude mcp add-json better-notes '{"command":"npx","args":["@better-notes/cli","serve"]}' --scope user
    

    或者,如果全局安装:

    claude mcp add-json better-notes '{"command":"better-notes","args":["serve"]}' --scope user
    

    注: --scope user 标志使MCP服务器在所有项目中全局可用。在项目本地配置中省略它。

  4. 或者手动配置Claude Desktop:

    {
      "mcpServers": {
        "better-notes": {
          "command": "better-notes",
          "args": ["serve"]
        }
      }
    }
    

CLI命令

设置和配置

# Interactive setup
better-notes init

# Show configuration
better-notes config

守护进程管理

# Start background daemon
better-notes daemon start

# Stop daemon
better-notes daemon stop

# Check status
better-notes daemon status

# Run in foreground
better-notes daemon start --foreground

笔记管理

# Create a note
better-notes note create --title "Meeting with team" --content "Discussed roadmap"

# View today's note
better-notes note today

# List recent notes
better-notes note recent --days 7

搜索

# Full-text search
better-notes search "project timeline"

# Search with filters
better-notes search "@hannah past week"

索引管理

# Rebuild search index
better-notes index rebuild

# Show index stats
better-notes index stats

Git同步

# Manually sync notes with git (pull, commit, push)
better-notes sync

Git项目跟踪

# List tracked git projects
better-notes projects --list

# Scan a directory and select repos to track
better-notes projects --add ~/Projects

# Interactively remove tracked projects
better-notes projects --remove

日常活动和总结

# View git commits across tracked projects for today
better-notes changes

# View git commits for a specific date
better-notes changes --date 2026-01-15

# Create a daily summary note (notes + git activity)
better-notes summarize

# Summarize a specific date
better-notes summarize --date 2026-01-15

服务安装

# Show instructions for systemd/launchd
better-notes install-service

MCP工具

与Claude一起使用时,可以使用以下工具:

工具 说明
create_note 创建新的笔记条目
append_note 附于今天的笔记
search_notes 使用过滤器的自然语言搜索
search_by_person 查找提及某人的笔记
search_by_topic 全文主题搜索
get_daily_summary 获取一天的总结
list_recent_notes 列出过去N天的笔记
get_note 获取完整的笔记内容
list_categories 列出可用类别
list_tags 列出所有标签
list_people 列出提到的人
search_by_category 按类别筛选
search_by_tag 按标签筛选
get_git_changes 查看跟踪项目中的git提交
summarize_day 生成包含笔记和git活动的每日摘要

文件结构

注释以markdown格式存储:

~/notes/
├── 2026/
│   ├── 01/
│   │   ├── 2026-01-15.md
│   │   └── 2026-01-16.md
│   └── 02/
│       └── ...
├── .index/
│   ├── notes.db      # SQLite search index
│   ├── daemon.pid    # Daemon PID file
│   └── daemon.log    # Daemon log
└── .gitignore

备注格式

注释使用YAML frontmatter:

---
title: Notes for 2026-01-15
created: 2026-01-15T09:00:00.000Z
updated: 2026-01-15T14:30:00.000Z
tags:
  - project
  - meeting
mentions:
  - hannah
  - bob
---

## 09:00 - Morning standup

Discussed sprint progress with @hannah and @bob.

Tags: #meeting #standup

## 14:30 - Project review

Reviewed Q1 roadmap. Key decisions:
- Launch feature X by Feb
- Prioritize performance work

Tags: #project #planning

配置

配置文件: ~/.better-notes.json

{
  "notesDirectory": "~/notes",
  "categories": ["work", "meeting", "personal", "idea", "task"],
  "defaultCategory": "personal",
  "gitSync": {
    "enabled": true,
    "debounceSeconds": 30,
    "autoCommit": true,
    "autoPush": true
  },
  "daemon": {
    "enabled": true,
    "watchFiles": true
  },
  "search": {
    "enableEntityExtraction": true,
    "maxResults": 20
  },
  "gitProjects": [
    { "name": "my-app", "path": "~/Projects/my-app" },
    { "name": "api-server", "path": "~/Projects/api-server" }
  ]
}

许可证

麻省理工学院