Releases: 4fuu/code-search-cli
codes v0.1.4
Merge pull request #4 from 4fuu/copilot/fix-github-actions-release-wo…
codes v0.1.3
主要变更
• 改进 skill 文档,优化使用场景说明
- 重写 "When to use codes vs rg/grep" 章节,采用更直观的场景化描述
- 明确列出 codes 的四大用途:找定义、追踪引用、浏览文件符号、全局符号搜索
- 强调
references命令的 AST-aware 特性,相比 grep 有更少的误报 - 说明 fallback 策略:先用 codes 定位,再用 rg/grep 查文本细节
- 新增 Speed 章节,展示性能数据(10 秒索引 305k 符号)
- description 简化为直接说明使用场景,吸引 Agent 主动使用
• 新增 --version 标志
- 支持
codes --version或codes -V查看版本号 - 版本号从编译时
CODES_VERSION环境变量注入 - 输出格式:
codes <version>
English
Highlights
• Improved skill documentation with scenario-based guidance
- Rewrote "When to use codes vs rg/grep" section with more intuitive scenario descriptions
- Clearly lists four main use cases: find definitions, track usages, browse file symbols, global symbol search
- Emphasizes AST-aware nature of
referencescommand for fewer false positives vs grep - Documents fallback strategy: use codes first to locate, then rg/grep for text patterns
- Added Speed section showcasing performance metrics (305k symbols indexed in 10s)
- Simplified description to focus on use cases, making it more appealing for Agent usage
• New --version flag
- Supports
codes --versionorcodes -Vto display version - Version injected at compile time from
CODES_VERSIONenvironment variable - Output format:
codes <version>
codes v0.1.2
codes v0.1.2
0.1.2 主要提升了 codes 在 Codex / Claude Code 会话中的可用性,以及大结果集查询时的可控性。这个版本新增了 skill 直接安装能力,并为仓库级查询命令补齐了分页支持。
主要变更
-
新增
codes skill install,可直接把内置 skill 安装到 Codex 或 Claude Code 的个人目录- 新命令为
codes skill install --target <codex|claude-code> [--force]。 --target codex会写入~/.codex/skills/code-search-cli/SKILL.md。--target claude-code会写入~/.claude/skills/code-search-cli/SKILL.md。- 已存在时默认拒绝覆盖,只有显式传入
--force才会覆盖,避免误改用户已有 skill。 codes skill print仍然保留,兼容现有通过 shell 重定向安装的用法。
- 新命令为
-
symbols/definition/references现在支持分页- 三个命令都支持
--limit和--offset。 --offset的语义是跳过前 N 条结果,再返回当前页,适合脚本和交互式翻页。- 这三类命令现在默认
--limit=100,避免在符号量很大的仓库里一次性输出过多结果。 - text 输出在分页时会显示当前窗口和总数,例如
20 matches (showing 41-60 of 137)。 - json 输出新增
total、offset、limit字段,便于调用方做后续分页处理。
- 三个命令都支持
-
definition的分页顺序现在显式稳定- 之前
definition没有单独排序,理论上可能受索引内部顺序影响。 - 现在会在分页前按
path -> line -> column -> kind排序,使分页边界稳定。 - 这个排序只作用于精确名字匹配后的结果集,不会影响缓存构建或并行解析路径的性能。
- 之前
兼容性说明
- 这是一次向前兼容的增强版本。
- 未显式传入
--limit的symbols/definition/references现在默认只返回前 100 条;如需旧行为的“大量结果”,请显式传入更大的--limit。 codes skill print和现有查询参数仍然可用。
English
0.1.2 improves codes usability inside Codex / Claude Code workflows and makes large result sets easier to handle. This release adds direct skill installation and introduces pagination for repository-level search commands.
Highlights
-
New
codes skill installcommand for direct Codex / Claude Code skill installation- New command:
codes skill install --target <codex|claude-code> [--force]. --target codexwrites to~/.codex/skills/code-search-cli/SKILL.md.--target claude-codewrites to~/.claude/skills/code-search-cli/SKILL.md.- Existing files are preserved by default; overwrite requires an explicit
--force. codes skill printremains available, so shell-redirect based installation still works.
- New command:
-
Pagination is now available for
symbols,definition, andreferences- All three commands now support
--limitand--offset. --offsetskips the first N results before returning the current page, which works well for both scripting and interactive paging.- These commands now default to
--limit=100to avoid dumping excessively large result sets in symbol-heavy repositories. - Text output now shows the current window and total count, for example:
20 matches (showing 41-60 of 137). - JSON output now includes
total,offset, andlimitfields for downstream pagination logic.
- All three commands now support
-
definitionpagination order is now explicitly stable- Previously,
definitionhad no explicit sort of its own and could theoretically inherit index-internal ordering. - Results are now sorted by
path -> line -> column -> kindbefore pagination, making page boundaries stable. - This sort only runs on the exact-name result set, so it does not affect cache build or parallel parsing performance.
- Previously,
Compatibility
- This is a forward-compatible enhancement release.
- If you do not pass
--limit,symbols/definition/referencesnow return only the first 100 results by default. If you want larger result sets, pass a larger explicit--limit. codes skill printand all existing query flags remain available.
Full Changelog: 0.1.1...0.1.2
codes v0.1.1
codes v0.1.1
0.1.1 是一次针对 `references` 命令正确性的修复版本,补齐了 Go 和 TypeScript 中 `--include-def` 对方法定义位置的覆盖缺失。
修复内容
- Go / TypeScript:`references --include-def` 现在能正确返回方法定义位置
- 之前,当查询目标是一个方法(Go 的
method_declaration、TypeScript 的method_definition)时,narrowed 查询(CALLABLE_REFS)只覆盖调用表达式和裸标识符,不覆盖方法名本身所在的声明节点。 - 这导致对同名方法(如同时存在于 handler 和 store 两个 struct 上的
ListUploads)执行 `references --include-def` 时,定义位置完全缺失,看上去像 0 结果或仅有调用侧。 - 现在 Go 的
CALLABLE_REFS新增了(method_declaration name: (field_identifier) @reference)规则,TypeScript 新增了(method_definition name: (property_identifier) @reference),两者的 `--include-def` 行为与函数保持一致。 - Rust 和 Python 不受影响:Rust 方法名本身是
identifier,已被现有规则覆盖;Python 不使用窄查询。
- 之前,当查询目标是一个方法(Go 的
兼容性说明
- 这是一次向前兼容的修复;默认不带 `--include-def` 的 `references` 行为不变,仅 `--include-def` 的返回结果更完整。
English
0.1.1 is a correctness fix for the references command, addressing a gap where --include-def failed to include method definition sites in Go and TypeScript.
Fix
- Go / TypeScript: `references --include-def` now correctly includes method definition sites
- Previously, when the target symbol was a method (
method_declarationin Go,method_definitionin TypeScript), the narrowedCALLABLE_REFSquery only matched call expressions and bare identifiers, missing the declaration node where the method name itself lives. - This caused
references --include-defon same-name methods (e.g.ListUploadsdefined on both a handler and a store struct) to silently drop all definition sites — the result looked like 0 results or only call sites. - Go's
CALLABLE_REFSnow includes(method_declaration name: (field_identifier) @reference)and TypeScript's includes(method_definition name: (property_identifier) @reference), making--include-defconsistent with how plain functions already behaved. - Rust and Python are unaffected: Rust method names are plain
identifiernodes already covered by existing rules; Python does not use the narrowed query path.
- Previously, when the target symbol was a method (
Compatibility
- This is a fully forward-compatible fix. The default
referencesbehavior (without--include-def) is unchanged; only--include-defresults are now more complete.
Full Changelog: 0.1.0...0.1.1
codes v0.1.0
code-search-cli 0.1.0
First public release of code-search-cli.
codes is a Tree-sitter based local code search CLI for Git repositories.
Current functionality:
codes overview <file>: list symbols from a single file without using the global cachecodes symbols: search symbols across the repository with filters for name, kind, language, path, and limitcodes definition: find case-insensitive exact-name symbol definitionscodes references: find heuristic AST-based references with kind-aware narrowing when definitions are availablecodes index: prebuild and refresh the repository cachecodes clear-cache: remove the local.code-search/cachecodes skill print: print the SKILL.md content
Supported languages:
- Rust
- TypeScript / TSX
- Python
- Go
Output modes:
textjson