sense
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesense
sense
Use sense to locate evidence in a markdown tree before reading files. Every command reconciles changed files first. Results contain paths, metadata, excerpts, and line ranges. Read the returned files or ranges when the task needs their prose.
Setup, store selection, presets, and note design belong to the skill. Translating an Obsidian Bases file belongs to .
sense-setupsense-bases在读取文件之前,使用 sense 在 markdown 树中定位证据。每条命令都会先对变更的文件进行同步。结果包含路径、元数据、摘录和行范围。当任务需要这些文件的正文时,请阅读返回的文件或行范围。
设置、存储选择、预设和笔记设计属于 skill。翻译 Obsidian Bases 文件属于 。
sense-setupsense-basesStart with the tree
从目录树开始
Run these when the tree or its configuration is unfamiliar:
sh
sense status # config, store, cache, document count, preset coverage
sense map # fields, hubs, recent notes
sense --list # saved queriesIf a command reports a missing config, run only when the user wants the tree configured. A one-off query does not authorize changing the tree.
sense init当目录树或其配置不熟悉时,运行以下命令:
sh
sense status # config, store, cache, document count, preset coverage
sense map # fields, hubs, recent notes
sense --list # saved queries如果命令报告缺少配置,仅当用户希望配置该目录树时才运行 。一次性查询并不授权修改目录树。
sense initChoose the command
选择命令
| Need | Command |
|---|---|
| Exact count, filter, grouping, or known-field report | |
| Notes about a subject | |
| One note's frontmatter, outline, links, and backlinks | |
| Shortest link chain between two notes | |
| Similar notes that a note does not link to | |
| Tree shape and available fields | |
Start with a bounded result. Raise , widen the preset, or broaden the words only when the first result does not answer the question.
--ksh
sense search "pricing" --k 10
sense search "sourcing quotes" --preset raw
sense peek notes/pricing-model.md
sense path onboarding.md pricing-model.md
sense related notes/pricing-model.md --k 10
sense sql "SELECT path FROM frontmatter WHERE status = ? LIMIT 50" active| 需求 | 命令 |
|---|---|
| 精确计数、过滤、分组或已知字段报告 | |
| 关于某个主题的笔记 | |
| 单篇笔记的 frontmatter、大纲、链接和反向链接 | |
| 两篇笔记之间的最短链接链 | |
| 与某篇笔记相似但未链接的笔记 | |
| 目录树结构和可用字段 | |
先使用受限的结果。仅当首个结果无法回答问题时,才提高 、扩大预设范围或放宽搜索词。
--ksh
sense search "pricing" --k 10
sense search "sourcing quotes" --preset raw
sense peek notes/pricing-model.md
sense path onboarding.md pricing-model.md
sense related notes/pricing-model.md --k 10
sense sql "SELECT path FROM frontmatter WHERE status = ? LIMIT 50" activeRead the store guide before composing syntax
在编写语法前阅读存储指南
The config's key selects the SQL dialect and text-search grammar. An omitted key means . Bare words and quoted phrases work in on every store. Advanced operators and raw text-index SQL differ.
storesqlitesense searchRead the matching guide before writing raw SQL that uses engine functions, dates, JSON, text matching, or native types. Also read it before using advanced search operators.
- SQLite query guide
- DuckDB query guide
- Turso query guide
The tables, placeholders, quoted identifiers, , , and preset binding are shared. Portable SQL documents the schema and queries that work without depending on one engine.
?has()basename()scope配置中的 键选择 SQL 方言和文本搜索语法。省略该键表示 。裸词和带引号的短语在每个存储的 中都能使用。高级运算符和原始文本索引 SQL 则各不相同。
storesqlitesense search在编写使用引擎函数、日期、JSON、文本匹配或原生类型的原始 SQL 之前,请阅读相应的指南。在使用高级搜索运算符之前也请阅读。
- SQLite 查询指南
- DuckDB 查询指南
- Turso 查询指南
这些表、 占位符、带引号的标识符、、 和预设的 绑定是通用的。可移植 SQL 记录了不依赖于单一引擎即可工作的 schema 和查询。
?has()basename()scopeSearch and evidence
搜索与证据
search| Signal | Evidence |
|---|---|
| The note contains the search words. |
| A note that matched links to this note. |
| The embedding model placed this note near the query. The search words may be absent. |
Combinations such as mean that more than one signal produced the row. ranks rows within that result only. Do not compare it across searches. ranks vector evidence within the current result and model. Do not carry a fixed similarity cutoff between trees.
match+linkscoresimilarityThe value points at the section that earned the row. Read that range when it is present. A null range means the whole note is the reference. A vector-only row has no lexical snippet and is a lead, not proof that the note contains the query terms.
linesRead search evidence and troubleshooting when a search will support a factual claim, when absence matters, when results look noisy, or when tuning signal weights.
search| 信号 | 证据 |
|---|---|
| 笔记包含搜索词。 |
| 一篇匹配的笔记链接到该笔记。 |
| 嵌入模型将该笔记放置在查询附近。搜索词可能不存在。 |
类似 的组合意味着不止一个信号产生了该行。 仅对当前结果中的行进行排名,不要跨搜索比较。 对当前结果和模型中的向量证据进行排名。不要在目录树之间携带固定的相似度截止值。
match+linkscoresimilaritylines当搜索将支持事实性断言、缺失很重要、结果看起来有噪声或需要调整信号权重时,请阅读搜索证据与故障排查。
Scope and output
范围与输出
Bare commands use the preset. chooses another. For , , , and change the query scope for one invocation, but cannot reach files that no preset indexes. shows actual coverage.
default--preset <name>search--include--exclude--no-excludesense status--wherefsh
sense search "pricing" --where "f.status = 'active' AND has(f.tags, 'sales')"sense sql--presetscope(path)sh
sense sql "SELECT f.path FROM frontmatter f JOIN scope ON scope.path = f.path" --preset defaultTable output is for people. Use when code or an agent will parse rows. Use when redirecting a large row set to a file. , , , and saved queries support all three formats. , , , and support table and JSON.
--format json--format csvsqlsearchrelatedmappeekstatuspath裸命令使用 预设。 选择其他预设。对于 ,、 和 会在一次调用中更改查询范围,但无法访问任何预设均未索引的文件。 显示实际覆盖范围。
default--preset <name>search--include--exclude--no-excludesense status--wherefsh
sense search "pricing" --where "f.status = 'active' AND has(f.tags, 'sales')"sense sql--presetscope(path)sh
sense sql "SELECT f.path FROM frontmatter f JOIN scope ON scope.path = f.path" --preset default表格输出面向人。当代码或 agent 将解析行时,使用 。当将大量行集重定向到文件时,使用 。、、 和已保存查询支持所有三种格式。、、 和 支持表格和 JSON。
--format json--format csvsqlsearchrelatedmappeekstatuspathSaved queries
已保存查询
Save a query in only when it will be reused:
sense.config.jsonjson
{
"queries": {
"by-tag": { "sql": "SELECT path, title FROM frontmatter WHERE has(tags, ?) ORDER BY path" },
"hot": { "search": "pricing", "preset": "raw", "k": 20 }
}
}Run these as and . Invocation flags override a saved search's , , or value.
sense by-tag urgentsense hotpresetkwhereRunning a saved entry validates it. Exit code 0 means it ran, 2 means the invocation needs different arguments, and 1 means the query or store failed. An empty result can be valid data, so interpret it from the query's purpose.
仅在需要重复使用时,才将查询保存到 :
sense.config.jsonjson
{
"queries": {
"by-tag": { "sql": "SELECT path, title FROM frontmatter WHERE has(tags, ?) ORDER BY path" },
"hot": { "search": "pricing", "preset": "raw", "k": 20 }
}
}以 和 的方式运行。调用参数会覆盖已保存搜索的 、 或 值。
sense by-tag urgentsense hotpresetkwhere运行已保存条目会对其进行验证。退出码 0 表示运行成功,2 表示调用需要不同的参数,1 表示查询或存储失败。空结果也可能是有效数据,因此要根据查询的目的来解释。
Tables
数据表
| Table | Holds |
|---|---|
| One discovered column per frontmatter key, plus |
| |
| |
| Merged and deduplicated frontmatter and inline tags |
| Heading, level, line range, and token estimate |
| Paths covered by each preset |
Features can add tables. and show which features are active.
sense mapsense statusA non-null means the file has no recovered frontmatter values. To distinguish a missing field from invalid frontmatter, include in the filter. Fixes appear on the next command because reconciliation runs first.
_parse_error_parse_error IS NULL| 表 | 内容 |
|---|---|
| 每个 frontmatter 键对应一个发现的列,外加 |
| |
| |
| 合并并去重后的 frontmatter 和内联标签 |
| 标题、层级、行范围和 token 估算 |
| 每个预设覆盖的路径 |
功能可以添加表。 和 会显示哪些功能处于活动状态。
sense mapsense status非 null 的 表示该文件没有可恢复的 frontmatter 值。要区分缺失字段与无效 frontmatter,请在过滤条件中包含 。由于对账(reconciliation)首先执行,修复会在下一条命令时体现。
_parse_error_parse_error IS NULLReading discipline
阅读纪律
Select only the columns needed for the answer. Use for row-returning exploration. Prefer , , , and bounded snippets over . Aggregates such as and are already bounded by their result shape.
LIMITpathtitlesummarycontent.textCOUNTGROUP BYWhen a result identifies a large note, use and then read the relevant line range. Small files are often cheaper to read whole.
peekWorked command traces are in EXAMPLES.md.
只选择回答问题所需的列。对于返回行的探索,使用 。优先选择 、、 和有界的摘录,而不是 。诸如 和 之类的聚合已由其结果形态限定了边界。
LIMITpathtitlesummarycontent.textCOUNTGROUP BY当结果指向一篇较大的笔记时,使用 ,然后阅读相关的行范围。小文件通常整体读取成本更低。
peek完整的命令示例参见 EXAMPLES.md。
Upkeep
维护
- Install a missing CLI with .
npm install -g sensemaking - prints the cache path and watcher state.
sense status - Delete the cache directory printed by only when the derived index is in doubt. The next command rebuilds it.
sense status - Use when another process should keep the index warm during frequent edits. Queries remain responsible for their own freshness check.
sense watch
- 使用 安装缺失的 CLI。
npm install -g sensemaking - 打印缓存路径和 watcher 状态。
sense status - 仅当派生的索引存在疑问时,才删除 打印的缓存目录。下一条命令会重建它。
sense status - 当需要另一个进程在频繁编辑期间保持索引热时,使用 。查询仍需自行负责新鲜度检查。
sense watch