Lexicon

io.github.ashlrai由 GitHub 帳號 ashlrai 發布v0.5.4更新於 Oct 24, 2026

Fixes the names and jargon speech-to-text gets wrong before your agent acts on a dictated prompt.

概覽

AI 產生的概覽

在 AI 代理處理聽寫提示之前,修正語音轉文字對專有名詞與術語的誤聽。

可以做什麼
Lexicon 在語音轉文字與模型之間,用個人 YAML 詞典修正文字。它提供二十個 MCP 工具、兩個資源與兩個提示,代理可自行完成設定、診斷檢查、用戶端註冊、專案信任以及詞典或詞彙匯入。比對在詞元視窗上分精確別名、語音與模糊三層,並搭配停用詞表以及程式碼、網址、電子郵件與路徑保護。它另外附帶 CLI、Claude Code 外掛、本機 HTTP API 以及面向聽寫應用程式的匯出格式。
適用情境
當你的聽寫提示包含語音轉文字經常聽錯的公司名、產品名或技術術語時,值得加入。適合使用 Claude Code、Codex、Cursor、Windsurf、Gemini CLI、VS Code 或 Claude Desktop,並希望在模型讀取提示前完成修正的使用者。它不是聽寫應用程式,而是位於你現有聽寫工具與代理之間。
執行需求
以本機 stdio 程序執行,通常透過 npx 從 npm 套件 @ashlr/lexicon 啟動,或作為 Claude Code 外掛使用。npm 方式需要 Node.js 20 或更高版本。選用環境變數 LEXICON_CWD 與 LEXICON_PATH 分別指向專案與全域詞典 YAML 檔案。僅限桌面端;未宣告身分驗證。
安裝前請注意
設定步驟可能變更你的機器:在偵測到的代理用戶端中註冊 MCP 伺服器與鉤子、安裝登入服務,以及匯出到聽寫應用程式。會寫入的工具先預覽,並要求 apply: true。引導式匯入器僅在逐個來源被選擇加入時讀取聯絡人、行事曆與 GitHub,候選詞在寫入前需經核准。網路操作包括取得 whisper 模型、從登錄 URL 取得社群詞包,以及透過你現有的 gh 登入呼叫 GitHub API 中繼資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lexicon,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[圖片]

Lexicon

Speech-to-text gets English right and your names wrong.

Lexicon is one YAML file of the words you actually say. It rewrites the transcript before an agent reads it. It is not a dictation app.

[CI] [npm]

[![source version](https://img.shields.io/badge/source-v0.5.7-blue)](package.json)

[license: MIT] [node >=20]

Live demo · Docs · llms.txt · llms-full.txt · lexicon.ashlr.ai

Start here (60 seconds)

Agents are first-class users. One command checks for Node 20+, installs the CLI, and runs lexicon setup when it has a terminal. Without a terminal (CI, a Dockerfile), under sudo, or with LEXICON_NO_SETUP=1, it only installs and ends with run: lexicon setup.

bash
curl -fsSL https://ashlrai.github.io/lexicon/install.sh | sh

No global install:

bash
npx @ashlr/lexicon@latest setup

Do not install it unasked. Preview the plan, show it, then apply. --dry-run writes nothing. Stdout is one JSON document. Read ok first.

bash
lexicon setup --dry-run --jsonlexicon setup --yes --packs developer,ai --json

--packs, --harvest and --serve stay opt-in even with --yes, because each writes a lot or installs a service.

[Speech-to-text wrote ashler, kuber netties and post gressql. Lexicon rewrites them to Ashlr.AI, Kubernetes and PostgreSQL. The rest of the sentence stays put.]

Correct one sentence. With no lexicon of your own, arguments (not piped input) are corrected against a built-in example, and stderr says so. Nothing is written.

bash
lexicon normalize "ask ashler to deploy kuber netties with post gressql" --json
json
{"ok":true,"input":"ask ashler to deploy kuber netties with post gressql","output":"ask Ashlr.AI to deploy Kubernetes with PostgreSQL","replacements":[{"start":4,"end":10,"original":"ashler","replacement":"Ashlr.AI","canonical":"Ashlr.AI","reason":"alias","confidence":1},{"start":21,"end":34,"original":"kuber netties","replacement":"Kubernetes","canonical":"Kubernetes","reason":"phonetic","confidence":0.8826923076923077},{"start":40,"end":52,"original":"post gressql","replacement":"PostgreSQL","canonical":"PostgreSQL","reason":"phonetic","confidence":0.8795454545454546}],"changed":true,"example":true}

example: true means those terms are the built-in sample, not the user's file yet.

Add the spelling, still as JSON:

bash
lexicon add Ashlr.AI Ashler Ashlar "Ashler AI" --phonetic ASH-ler --json

When the user corrects you, record it. --dry-run writes nothing.

bash
lexicon learn --from "it's Ashlr.AI not Ashler" --dry-run --json

Check the install. Read ready, summary and nextStep.

bash
lexicon doctor --json

The same contract, in one fetch: llms.txt (index) and llms-full.txt (install, tools, privacy, FAQ). The page written to an agent is docs/AGENTS.md. Copy-paste only, no commentary: docs/COPY-PASTE.md.

This tree is source version 0.5.7. On 2026-10-31, when that version was prepared, npm latest was 0.5.4. Check lexicon --version and npm view @ashlr/lexicon version before you pin.

MCP server

Preview, then write. Without --apply, nothing is written. --json returns { ok, client, scope, applied, written, output }.

bash
lexicon install claude --jsonlexicon install claude --apply --jsonlexicon install cursor --jsonlexicon install cursor --apply --jsonlexicon install codex --jsonlexicon install codex --apply --json

Paste these only when lexicon-mcp is already on PATH (a global install). lexicon install writes the path that matches how Lexicon was installed, which is the safer call.

Claude Code, Cursor (~/.cursor/mcp.json), and any other client that reads mcpServers:

json
{  "mcpServers": {    "lexicon": {      "command": "lexicon-mcp",      "args": []    }  }}

Codex (~/.codex/config.toml):

toml
[mcp_servers.lexicon]command = "lexicon-mcp"args = []

Claude Code also gets a SessionStart hook and a UserPromptSubmit hook from lexicon install claude --apply. Restart the client after --apply. Cursor needs a window reload.

Environment variables the server reads (LEXICON_PATH, LEXICON_HARVEST_ROOTS, LEXICON_REGISTRIES and the rest): docs/MCP.md.

These calls cover almost every session. The server has twenty-one MCP tools, three resources and two prompts. The full table is docs/MCP.md.

  • normalize_transcript { text } corrects a dictated string and returns output, changed and replacements.
  • learn_correction { heard, meant } records a correction the user just made.
  • add_term { canonical, aliases?, phonetic? } adds a spelling. Omit aliases and the server proposes the mis-hearings.
  • setup_lexicon { apply? } returns a plan and writes nothing until apply: true.
  • lexicon_doctor {} is the structured health check. Read ready, summary and nextStep.

setup_lexicon, install_client and trust_project preview first. Do not set LEXICON_TRUST_ALL=1 on a user's behalf.

Plugin, if you would rather not install a CLI:

bash
claude plugin marketplace add ashlrai/lexiconclaude plugin install lexicon@ashlrai

How it works

[You speak, speech-to-text writes a guess, Lexicon rewrites the names it knows, and the agent reads the corrected line. Matching is alias, then phonetic, then fuzzy.]

Exact alias first, then double-metaphone phonetic, then Damerau-Levenshtein fuzzy above a confidence floor. Exact hits win the span. Matches never overlap. A stoplist of common English words, per-term never lists, and code spans, URLs, emails and paths are off limits. Every replacement reports reason and confidence.

The same sentence, as a person would read it. Replacements go to stderr. The corrected line is stdout.

bash
lexicon normalize --diff "ask ashler to deploy kuber netties with post gressql"# stderr:  lexicon: no terms yet, so this is the built-in example (Ashlr.AI, Kubernetes, PostgreSQL, Pydantic, SaaS, Hetzner).#          lexicon: run `lexicon setup` to build your own; nothing was written.#          "ashler" -> "Ashlr.AI" (alias, 1.00)#          "kuber netties" -> "Kubernetes" (phonetic, 0.88)#          "post gressql" -> "PostgreSQL" (phonetic, 0.88)# stdout:  ask Ashlr.AI to deploy Kubernetes with PostgreSQL

Rules: docs/MATCHING.md.

What you get

  • One file, ~/.config/lexicon/lexicon.yaml. Project .lexicon.yaml merges only after lexicon trust.
  • Twenty-one MCP tools for Claude Code, Codex, Cursor, Windsurf, Gemini CLI, VS Code and Claude Desktop.
  • A CLI with 27 commands. lexicon --help lists them. docs/CLI.md is generated from that help.
  • 246 terms across the seven packs (developer, AI, business, voice tools, cloud and DevOps, legal profession, law and litigation). Community packs install from a registry after a checksum preview.
  • Sixteen export formats and eight importers, including Wispr Flow, Superwhisper, macOS Text Replacement and espanso. lexicon export with no format lists them.
  • The same correction in the browser, in any macOS text field, and from your own pipeline (normalize()).

[The browser demo. Left, what speech-to-text heard. Middle, the corrected line with each replacement's tier and confidence. Right, the lexicon YAML.]

Try it in the browser. The matcher runs on the page. The Dictate button uses the browser's speech recognizer, which in Chrome sends audio to Google.

[A terminal running lexicon setup through seven steps and finishing on a dictated sentence corrected from Mason Wiatt and Ashler to Mason Wyatt and Ashlr.AI.]

Watch the terminal setup recording.

[A TextEdit note where the dictated line rewrites itself in place to Ashlr.AI, Kubernetes and Vercel, with a bubble listing the three fixes.]

SurfaceHow
Claude Codelexicon install claude --apply, or the plugin
Codex, Cursor, and the other clientslexicon install cursor --json, then the same command with --apply
Browser chatsExtension from the latest release
Any macOS text fieldLexiconBar menu bar app
Shortcuts, Raycast, your own applexicon serve on 127.0.0.1:41733
Your own speech pipelinenormalize() between the recognizer and the model

Which of those exist on Windows and Linux: docs/PLATFORMS.md.

FAQ

Why does dictation get my company name wrong?

The name is out of vocabulary. The recognizer picks the nearest common-sounding sequence it does know. "Ashlr.AI" becomes "Ashler". "Kubernetes" becomes "Cuban eats". The audio was fine. The vocabulary was missing. Lexicon maps the spelling you got back to the one you meant.

How does an agent install it?

curl -fsSL https://ashlrai.github.io/lexicon/install.sh | sh, or npx @ashlr/lexicon@latest setup. Preview with lexicon setup --dry-run --json. The script runs setup only in a terminal. Under sudo, without a terminal, or with LEXICON_NO_SETUP=1, it prints run: lexicon setup.

Does this replace Wispr Flow or Superwhisper?

No. It runs after whatever produced the transcript, and it exports into those dictionaries: lexicon export wispr, lexicon export superwhisper, lexicon export macos. lexicon import reads them back.

Is the transcript sent anywhere?

Ordinary correction is local. There is no account, no sync and no telemetry. The CLI, hooks, MCP server, loopback API and extension do not send transcripts to a remote service. Three features use the network, and only when you turn them on: lexicon voice downloads a whisper.cpp model the first time (audio stays on the machine), lexicon pack fetches a community pack from a registry URL you choose, and the GitHub source in lexicon import --guided calls the GitHub API through your existing gh login. Email and chat are not imported. Threat model: SECURITY.md.

What does it cost?

Nothing. MIT license. No paid tier.

More answers: docs/FAQ.md.

Measured

On 330 clips of synthesized speech through whisper.cpp small.en (three voices, the same 70-term lexicon in every row), Lexicon recovered 91.0% of the proper nouns. Raw whisper.cpp recovered 45.9%. Clean prose wrongly changed: 0 of 72. The audio is macOS text-to-speech read into whisper.cpp, cleaner than a phone microphone. Method, the other rows, and every failing case: docs/BENCHMARK.md. Reproduce with npm run bench.

Other installs

bash
brew install ashlrai/tap/lexiconnpm i -g @ashlr/lexicon

Plain brew install lexicon is dns-lexicon, a different project. Use the full tap name.

After 0.5.7 is published, npm i -g github:ashlrai/lexicon#v0.5.7 installs that tag from GitHub and builds on install.

Homebrew formula: ashlrai/homebrew-tap. Release zips (extension, LexiconBar, checksums): GitHub releases.

lexicon doctor --fix previews safe repairs and writes nothing. lexicon doctor --fix --apply makes them, after a backup. Details: docs/doctor-fix.md.

Docs

You wantRead
Commands onlydocs/COPY-PASTE.md
Install for someone elsedocs/AGENTS.md
Five minutes, with what setup writesdocs/QUICKSTART.md
Every clientdocs/CLIENTS.md
Every tooldocs/MCP.md
The indexdocs/README.md

Changing the code: CONTRIBUTING.md, docs/ARCHITECTURE.md.

Lexicon is one of the open-source tools from Ashlr.AI. It does not need the others to run. How it sits next to Phantom: docs/PHANTOM-USAGE.md.

Roadmap and non-goals

This is not a dictation app. There is no hosted account and no sync. It is a file.

  • The extension installs from the release zip. It is not in the Chrome Web Store or on Firefox Add-ons yet.
  • LexiconBar is ad-hoc signed, not notarized. The first launch needs right-click and Open.
  • Linux has no tray app. The Windows tray app is built and unit-tested, and it has never been run on Windows: docs/WINDOWS-APP.md.
  • Double metaphone is tuned for English. Names in other languages fall back to fuzzy matching.
  • The audio benchmark is text-to-speech read into whisper.cpp, not a phone microphone.

Star Lexicon

If this stopped an agent from shipping the wrong name, star the repo. That is how the next person who dictates a company name finds it.

Star ashlrai/lexicon on GitHub

Found a name it gets wrong? Open a misheard term issue.

License

MIT. Copyright 2026 AshlrAI, Inc.

來源:README.md,提交 e27c40a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.4最新Sep 28, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分