Scripts2026年5月20日·1 分钟阅读

Foam — Personal Knowledge Management System for VS Code

Foam is a free, open-source personal knowledge management tool that runs inside VS Code. Inspired by Roam Research, it uses wikilinks, backlinks, and a graph visualization to help you organize interconnected notes in plain Markdown files.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 96/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Knowledge
安装
Single
信任
信任等级:Established
入口
Foam Overview
通用 CLI 安装命令
npx tokrepo install 3ab92074-5468-11f1-9bc6-00163e2b0d79

Introduction

Foam is an open-source personal knowledge management system that lives inside Visual Studio Code. Inspired by Roam Research, it brings bidirectional linking, graph visualization, and daily notes to your existing VS Code workflow. All notes are stored as plain Markdown files in a local Git repository, giving you full ownership of your data with no vendor lock-in.

What Foam Does

  • Creates bidirectional links between notes using [[wikilink]] syntax
  • Generates a visual graph of your knowledge base showing connections between notes
  • Automatically tracks backlinks so you can see which notes reference the current one
  • Provides daily note and note template features for structured journaling
  • Stores everything as plain Markdown files versioned with Git

Architecture Overview

Foam is implemented as a VS Code extension written in TypeScript. It parses the workspace for Markdown files and builds an in-memory graph of note relationships based on wikilinks. The extension hooks into VS Code's language server protocol to provide autocompletion for note titles, hover previews for linked notes, and CodeLens for backlink counts. The graph visualization uses a D3.js-based webview panel rendered inside VS Code.

Self-Hosting & Configuration

  • Install the Foam extension from the VS Code marketplace or via CLI
  • Use the official foam-template repository as a starting point for your knowledge base
  • Configure Foam behavior through VS Code settings (foam.edit.linkReferenceDefinitions, foam.graph.style, etc.)
  • Notes are plain .md files; use any Git host (GitHub, GitLab, self-hosted) for backup and sync
  • Pair with the recommended extensions listed in the template for an enhanced experience (Markdown All in One, paste-image, spellcheck)

Key Features

  • Zero lock-in: all data is plain Markdown stored locally in files you control
  • Leverages the full VS Code ecosystem including extensions, themes, and keybindings
  • Tag support and custom metadata via YAML frontmatter
  • Note embedding lets you transclude content from one note into another
  • Orphan note detection helps you find disconnected ideas in your knowledge base

Comparison with Similar Tools

  • Obsidian — Standalone app with a richer plugin ecosystem; Foam keeps you inside VS Code with no separate application
  • Logseq — Block-level outliner with stronger daily journaling focus; Foam works at the file level with standard Markdown
  • Dendron — Also VS Code-based but adds hierarchical naming conventions; Foam is more free-form
  • Roam Research — The original inspiration, but proprietary and cloud-only; Foam is free and local-first
  • Notion — All-in-one workspace but cloud-dependent and proprietary; Foam is offline-capable and open source

FAQ

Q: Do I need to pay for Foam? A: No. Foam is MIT-licensed and completely free. It runs as a VS Code extension.

Q: Can I publish my Foam notes as a website? A: Yes. Since notes are Markdown files, you can use static site generators like Jekyll, Hugo, or Eleventy to publish them. The foam-template includes a GitHub Pages workflow.

Q: Does Foam work with VS Code forks like VSCodium? A: Yes. The extension is compatible with any VS Code-based editor that supports the extension marketplace.

Q: How does Foam compare to just using Markdown files without it? A: Foam adds wikilink resolution, backlink tracking, graph visualization, and note templates on top of plain Markdown editing.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产