经 AI Skill Hub 精选评估,Tokenix 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
本地语义搜索、符号图、秘密扫描和CLI工具
Tokenix 是一款基于 Rust 开发的开源工具,专注于 ai、ai-tools、cli 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
本地语义搜索、符号图、秘密扫描和CLI工具
Tokenix 是一款基于 Rust 开发的开源工具,专注于 ai、ai-tools、cli 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:cargo install(推荐) cargo install tokenix # 方式二:从源码编译 git clone https://github.com/juninmd/tokenix cd tokenix cargo build --release # 二进制在 ./target/release/tokenix
# 查看帮助 tokenix --help # 基本运行 tokenix [options] <input> # 详细使用说明请查阅文档 # https://github.com/juninmd/tokenix
# tokenix 配置说明 # 查看配置选项 tokenix --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export TOKENIX_CONFIG="/path/to/config.yml"
<p><strong>Local semantic search, symbol graphs, secrets scanning, output filters, and CLI hooks that save 60-90% LLM tokens.</strong></p>
<p> <a href="https://github.com/juninmd/tokenix/releases"><img src="https://img.shields.io/github/v/release/juninmd/tokenix?style=flat-square&color=orange&label=release" alt="Latest Release" /></a> <a href="https://crates.io/crates/tokenix"><img src="https://img.shields.io/crates/v/tokenix?style=flat-square&color=orange" alt="crates.io" /></a> <a href="https://crates.io/crates/tokenix"><img src="https://img.shields.io/crates/d/tokenix?style=flat-square&color=orange&label=downloads" alt="crates.io downloads" /></a> <a href="https://github.com/juninmd/tokenix/stargazers"><img src="https://img.shields.io/github/stars/juninmd/tokenix?style=flat-square&color=yellow" alt="GitHub stars" /></a> <a href="https://github.com/juninmd/tokenix/actions/workflows/rust.yml"><img src="https://img.shields.io/github/actions/workflow/status/juninmd/tokenix/rust.yml?branch=main&style=flat-square&label=CI" alt="CI" /></a> <a href="https://github.com/juninmd/tokenix/actions/workflows/supply-chain.yml"><img src="https://img.shields.io/github/actions/workflow/status/juninmd/tokenix/supply-chain.yml?branch=main&style=flat-square&label=supply%20chain" alt="Supply Chain" /></a> <a href="https://scorecard.dev/viewer/?uri=github.com/juninmd/tokenix"><img src="https://img.shields.io/ossf-scorecard/github.com/juninmd/tokenix?style=flat-square&label=scorecard" alt="OpenSSF Scorecard" /></a> <a href="https://github.com/juninmd/tokenix/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a> <a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/built%20with-Rust-orange?style=flat-square&logo=rust" alt="Built with Rust" /></a> <img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey?style=flat-square" alt="Platforms" /> </p>
<p> <a href="#-quick-install">Install</a> · <a href="#-interactive-dashboard">Dashboard</a> · <a href="#-how-it-works">How it Works</a> · <a href="#-usage">Usage</a> · <a href="#-setup-by-tool">Setup</a> · <a href="#-commands-reference">Commands</a> · <a href="CONTRIBUTING.md">Contributing</a> </p> </div>
---
tokenix is a local-first Rust CLI that helps AI coding agents understand a repository without dumping huge files into the prompt. It indexes your code, finds relevant chunks by meaning, returns compact file outlines, and can hook into AI tools to replace noisy reads and command output with smaller, more useful context. Works with Claude Code, GitHub Copilot, OpenAI Codex CLI, Gemini, and any MCP client. No Ollama or external server required.
Without tokenix: Read(src/auth/middleware.rs) → 800 lines → ~2,400 tokens (illustrative)
With tokenix: tokenix read src/auth/middleware.rs → symbol outline → ~180 tokens
Savings depend on codebase size, AI behavior, and file sizes. Run tokenix gain to see your real numbers.
---
| Feature | Description |
|---|---|
| **Semantic search** | Find relevant code by meaning, not just keywords (tokenix query); cross-project with --link |
| **Context artifacts** | tokenix artifacts indexes non-code schemas, API docs, and specs via .tokenix/artifacts.json |
| **Hybrid ranking** | FTS5 BM25 + vector cosine + RRF fusion for ranked results |
| **Exact search** | Regex/literal search over indexed content, no embedding (tokenix grep) |
| **One-call task context** | tokenix context combines semantic search, entry points, and compact outlines with strict budget modes (plan, debug, audit, security, review) |
| **Graph-aware explore** | tokenix explore returns related symbols, relationship maps, and grouped source in one capped call |
| **Repository pack** | tokenix pack emits a budgeted, secret-safe repo map with changed-file packs, token maps, and safety reporting |
| **Symbol graph** | tokenix symbols (--kind filters by symbol type), callers, callees, impact, flow, and cycles trace relationships, call-flow, and circular deps between indexed symbols |
| **Import graph** | tokenix deps FILE shows file-level import dependencies (--reverse for importers, --transitive to follow the chain); external deps are tracked too |
| **Int8-quantized embeddings** | Vectors are stored int8-quantized (4x smaller DB + daemon RAM, near-identical recall); legacy f32 indexes migrate automatically on the next tokenix index |
| **JSON output** | --json on query, context, explore, read, symbols, callers, callees, deps (+ impact --format json) for scripts and agent pipelines |
| **PC-friendly indexing** | tokenix index runs at below-normal OS priority by default so long index runs never starve the machine (--no-low-priority opts out) |
| **Interactive HTML/Mermaid graphs** | tokenix impact --format html\|mermaid exports vis.js / Mermaid flowcharts; tokenix flow --format mermaid traces call flow |
| **Cycle detection** | tokenix cycles finds circular dependencies via Tarjan's strongly-connected components algorithm, dropping same-name (homonym) false positives and annotating each node with path:line |
| **Token map** | tokenix tokenmap shows a directory tree with token counts per file/folder |
| **Preference memory** | tokenix memory add/list stores global and project preferences in editable Markdown; context/explore include saved preferences |
| **Dynamic language detection** | Map custom file extensions to any built-in parser via a project .tokenix.toml — no recompile needed |
| **Legacy VB6 + SQL sources** | .bas/.cls/.ctl/.frm/.vbp and .sql/.fnc/.trg/.pkg/.prc/.tab/.vw indexed with symbol-aware heuristic chunking (Sub/Function/Property, CREATE objects); UTF-16 SQL files decoded via BOM; binary files (e.g. .frx) skipped by a NUL sniff |
| **Symbol-aware chunking** | AST Tree-sitter parsers for Rust, Python, TypeScript, JavaScript, Go, C/C++ |
| **Multi-agent safe index** | PID-based index lock prevents concurrent reindex; embeddings are committed per batch, so a killed index run resumes from the last completed batch |
| **Smart file reader** | Outlines large files; supports --symbol and --lines reads |
| **Hook-based interception** | PreToolUse intercepts large reads and rewrites noisy Bash **and PowerShell** commands before execution; thresholds tunable via [hook] in .tokenix.toml |
| **Structural output compression** | Fuzzy grouping, compact git/cargo filters, NDJSON/JSON compaction, and ANSI/Emoji stripping |
| **Local project filters** | Drop .toml files in .tokenix/filters/ for project-scoped compression rules — highest priority over user and bundled filters |
| **Output filters** | 244 TOML output filters embedded in the binary (each homologated against 522 golden cases) — auto-applied to Bash output for uv, cargo, terraform, ansible, docker, kubectl, git, npm, pnpm, bun, deno, vite, pip, poetry, go, rust, helm, and more |
| **Filter generation** | tokenix filter generate writes a TOML filter for a command; tokenix filter record captures real output for richer generation |
| **GPU acceleration (opt-in)** | Build with --features directml (Windows) or --features cuda to run embeddings on GPU; GPU is used by default at runtime with automatic CPU fallback, or force CPU with --only-cpu |
| **Environment diagnostics** | tokenix doctor reports the compiled backend, detected GPU, CUDA/cuDNN status, model cache, and daemon |
| **Branch-aware indexing** | TOKENIX_BRANCH_AWARE=true isolates indexes per git branch |
| **In-memory daemon** | tokenix serve keeps model + index in RAM so repeated hook calls avoid reloading the model each invocation; tokenix daemon status\|stop\|restart manages it |
| **Graceful fallback** | Exits 0 on errors — your AI session is never broken |
| **Token budget** | Results fit within a configurable token budget (default 1200) |
| **Savings analytics** | tokenix gain — token summary, savings split by source (semantic index vs command filters), and by-tool histogram; --cost-estimate adds a per-model cost table (10 reference models across Anthropic / OpenAI / Google) |
| **Slim MCP profile** | tokenix mcp --profile slim exposes 3 meta-tools instead of the full tool surface for hosts that support progressive discovery |
| **MCP/prompt weight audit** | tokenix prompt-audit --recommend --profile-impact connects to configured MCP servers, tokenizes tool schemas, and shows full-vs-slim MCP savings |
| **Session audit** | tokenix session-audit --cache-hygiene combines index freshness, hook history, MCP/tool weight, and prompt-cache stability risks |
| **Conversation token-waste audit** | tokenix conversation-audit scans local Claude / Codex / Copilot / OpenAI histories for large assistant-visible blobs such as full reads, command logs, bootstrap prompts, connector JSON, images, patches, and task artifacts |
| **Conversation secret scan** | tokenix scan-secrets — gitleaks-style credential scan of Claude / Gemini / Copilot / Antigravity conversation transcripts (no git); findings are always redacted, exits non-zero when any are found. Patterns live in TOML (assets/secret-rules/), extensible via ~/.tokenix/secret-rules/*.toml or <repo>/.tokenix/secret-rules/*.toml |
| **Local-first, no dependencies** | fastembed ONNX in-process — no Ollama, no server, no internet after first run |
---
Run baretokenix(ortokenix --help) for an audience-grouped command catalog with examples. The reference below mirrors that grouping: AI agent commands (the LLM/hooks drive these for token-lean retrieval) vs human commands (setup, ops & analytics you run yourself).
Tokenix是一个功能强大的本地语义搜索工具
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:Tokenix 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | tokenix |
| 原始描述 | 开源AI工具:Local semantic search, symbol graphs, secrets scanning, output filters, and CLI 。⭐11 · Rust |
| Topics | aiai-toolsclirust |
| GitHub | https://github.com/juninmd/tokenix |
| License | MIT |
| 语言 | Rust |
收录时间:2026-06-17 · 更新时间:2026-06-17 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。