Skip to content

Releases: 4fuu/code-search-cli

codes v0.1.4

15 May 05:53
2715067

Choose a tag to compare

Merge pull request #4 from 4fuu/copilot/fix-github-actions-release-wo…

codes v0.1.3

31 Mar 03:54

Choose a tag to compare

主要变更

• 改进 skill 文档,优化使用场景说明

  • 重写 "When to use codes vs rg/grep" 章节,采用更直观的场景化描述
  • 明确列出 codes 的四大用途:找定义、追踪引用、浏览文件符号、全局符号搜索
  • 强调 references 命令的 AST-aware 特性,相比 grep 有更少的误报
  • 说明 fallback 策略:先用 codes 定位,再用 rg/grep 查文本细节
  • 新增 Speed 章节,展示性能数据(10 秒索引 305k 符号)
  • description 简化为直接说明使用场景,吸引 Agent 主动使用

• 新增 --version 标志

  • 支持 codes --versioncodes -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 references command 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 --version or codes -V to display version
  • Version injected at compile time from CODES_VERSION environment variable
  • Output format: codes <version>

codes v0.1.2

30 Mar 10:22

Choose a tag to compare

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 输出新增 totaloffsetlimit 字段,便于调用方做后续分页处理。
  • definition 的分页顺序现在显式稳定

    • 之前 definition 没有单独排序,理论上可能受索引内部顺序影响。
    • 现在会在分页前按 path -> line -> column -> kind 排序,使分页边界稳定。
    • 这个排序只作用于精确名字匹配后的结果集,不会影响缓存构建或并行解析路径的性能。

兼容性说明

  • 这是一次向前兼容的增强版本。
  • 未显式传入 --limitsymbols / 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 install command for direct Codex / Claude Code skill installation

    • New command: codes skill install --target <codex|claude-code> [--force].
    • --target codex writes to ~/.codex/skills/code-search-cli/SKILL.md.
    • --target claude-code writes to ~/.claude/skills/code-search-cli/SKILL.md.
    • Existing files are preserved by default; overwrite requires an explicit --force.
    • codes skill print remains available, so shell-redirect based installation still works.
  • Pagination is now available for symbols, definition, and references

    • All three commands now support --limit and --offset.
    • --offset skips the first N results before returning the current page, which works well for both scripting and interactive paging.
    • These commands now default to --limit=100 to 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, and limit fields for downstream pagination logic.
  • definition pagination order is now explicitly stable

    • Previously, definition had no explicit sort of its own and could theoretically inherit index-internal ordering.
    • Results are now sorted by path -> line -> column -> kind before 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.

Compatibility

  • This is a forward-compatible enhancement release.
  • If you do not pass --limit, symbols / definition / references now return only the first 100 results by default. If you want larger result sets, pass a larger explicit --limit.
  • codes skill print and all existing query flags remain available.

Full Changelog: 0.1.1...0.1.2

codes v0.1.1

30 Mar 08:57

Choose a tag to compare

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 不使用窄查询。

兼容性说明

  • 这是一次向前兼容的修复;默认不带 `--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_declaration in Go, method_definition in TypeScript), the narrowed CALLABLE_REFS query only matched call expressions and bare identifiers, missing the declaration node where the method name itself lives.
    • This caused references --include-def on same-name methods (e.g. ListUploads defined 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_REFS now includes (method_declaration name: (field_identifier) @reference) and TypeScript's includes (method_definition name: (property_identifier) @reference), making --include-def consistent with how plain functions already behaved.
    • Rust and Python are unaffected: Rust method names are plain identifier nodes already covered by existing rules; Python does not use the narrowed query path.

Compatibility

  • This is a fully forward-compatible fix. The default references behavior (without --include-def) is unchanged; only --include-def results are now more complete.

Full Changelog: 0.1.0...0.1.1

codes v0.1.0

30 Mar 06:34

Choose a tag to compare

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 cache
  • codes symbols: search symbols across the repository with filters for name, kind, language, path, and limit
  • codes definition: find case-insensitive exact-name symbol definitions
  • codes references: find heuristic AST-based references with kind-aware narrowing when definitions are available
  • codes index: prebuild and refresh the repository cache
  • codes clear-cache: remove the local .code-search/ cache
  • codes skill print: print the SKILL.md content

Supported languages:

  • Rust
  • TypeScript / TSX
  • Python
  • Go

Output modes:

  • text
  • json