Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

grepai-trace-callersgrepai 跟踪调用者

Agent Skill

grepai-trace-callers 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

11,280

周安装

470

GitHub Stars

16

下载量

3,760
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:grepai-trace-callers(grepai 跟踪调用者)
来源仓库:https://github.com/yoanbernabeu/grepai-skills
仓库路径:skills/grepai-trace-callers
安装命令:
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers

简介

用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 它根据关键词或任务场景在代码或文档中匹配内容片段。
  • 使用方式依赖具体仓库结构和搜索模式,需结合上下文调整参数。
  • 安装命令:npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers。
  • 注意确认权限范围和是否允许读取项目文件,避免误触敏感路径。

SKILL.md

GrepAI Trace Callers

This skill covers using grepai trace callers to find all code locations that call a specific function or method.

When to Use This Skill

  • Finding all usages of a function before refactoring
  • Understanding function dependencies
  • Impact analysis before changes
  • Code navigation and exploration

What is Trace Callers?

grepai trace callers answers: "Who calls this function?"

func Login(user, pass) {...}
        ↑
        │
┌───────┴───────────────────┐
│   Who calls Login()?      │
├───────────────────────────┤
│ • HandleAuth (auth.go:42) │
│ • TestLogin (test.go:15)  │
│ • CLI (main.go:88)        │
└───────────────────────────┘

Basic Usage

grepai trace callers "FunctionName"

Example

grepai trace callers "Login"

Output:

🔍 Callers of "Login"

Found 3 callers:

1. HandleAuth
   File: handlers/auth.go:42
   Context: user.Login(ctx, credentials)

2. TestLoginSuccess
   File: handlers/auth_test.go:15
   Context: result := Login(testUser, testPass)

3. RunCLI
   File: cmd/main.go:88
   Context: err := auth.Login(username, password)

JSON Output

For programmatic use:

grepai trace callers "Login" --json

Output:

{
  "query": "Login",
  "mode": "callers",
  "count": 3,
  "results": [
    {
      "file": "handlers/auth.go",
      "line": 42,
      "caller": "HandleAuth",
      "context": "user.Login(ctx, credentials)"
    },
    {
      "file": "handlers/auth_test.go",
      "line": 15,
      "caller": "TestLoginSuccess",
      "context": "result := Login(testUser, testPass)"
    },
    {
      "file": "cmd/main.go",
      "line": 88,
      "caller": "RunCLI",
      "context": "err := auth.Login(username, password)"
    }
  ]
}

Compact JSON (AI Optimized)

grepai trace callers "Login" --json --compact

Output:

{
  "q": "Login",
  "m": "callers",
  "c": 3,
  "r": [
    {"f": "handlers/auth.go", "l": 42, "fn": "HandleAuth"},
    {"f": "handlers/auth_test.go", "l": 15, "fn": "TestLoginSuccess"},
    {"f": "cmd/main.go", "l": 88, "fn": "RunCLI"}
  ]
}

TOON Output (v0.26.0+)

TOON format offers ~50% fewer tokens than JSON:

grepai trace callers "Login" --toon

Output:

callers[3]:
  - call_site:
      context: "user.Login(ctx, credentials)"
      file: handlers/auth.go
      line: 42
    symbol:
      name: HandleAuth
      ...
Note: --json and --toon are mutually exclusive.

Extraction Modes

GrepAI offers two extraction modes:

Fast Mode (Default)

Uses regex patterns. Fast and dependency-free.

grepai trace callers "Login" --mode fast

Precise Mode

Uses tree-sitter AST parsing. More accurate but requires tree-sitter.

grepai trace callers "Login" --mode precise

Comparison

ModeSpeedAccuracyDependencies
fast⚡⚡⚡GoodNone
precise⚡⚡Excellenttree-sitter

Configuration

Configure trace in .grepai/config.yaml:

trace:
  mode: fast  # fast or precise

  enabled_languages:
    - .go
    - .js
    - .ts
    - .py
    - .php
    - .rs

  exclude_patterns:
    - "*_test.go"
    - "*.spec.ts"

Supported Languages

LanguageExtensions
Go.go
JavaScript.js, .jsx
TypeScript.ts, .tsx
Python.py
PHP.php
C/C++.c, .h, .cpp, .hpp, .cc, .cxx
Rust.rs
Zig.zig
C#.cs
Java.java
Pascal/Delphi.pas, .dpr

Use Cases

Before Refactoring

# Find all usages before renaming
grepai trace callers "getUserById"

# Check impact of changing signature
grepai trace callers "processPayment"

Understanding Codebase

# Who uses this core function?
grepai trace callers "validateToken"

# Find entry points to a module
grepai trace callers "initialize"

Debugging

# Where is this function called from?
grepai trace callers "problematicFunction"

Code Review

# Verify function usage before approving changes
grepai trace callers "deprecatedMethod"

Handling Common Names

If your function name is common, results may include unrelated code:

Problem

grepai trace callers "get"  # Too common, many false positives

Solutions

  1. Use more specific name:
grepai trace callers "getUserProfile"
  1. Filter results by path:
grepai trace callers "get" --json | jq '.results[] | select(.file | contains("auth"))'

Combining with Semantic Search

Use together for comprehensive understanding:

# Find what Login does (semantic)
grepai search "user login authentication"

# Find who uses Login (trace)
grepai trace callers "Login"

Scripting Examples

Bash

# Count callers
grepai trace callers "MyFunction" --json | jq '.count'

# Get caller function names
grepai trace callers "MyFunction" --json | jq -r '.results[].caller'

# Get file paths only
grepai trace callers "MyFunction" --json | jq -r '.results[].file' | sort -u

Python

import subprocess
import json

result = subprocess.run(
    ['grepai', 'trace', 'callers', 'Login', '--json'],
    capture_output=True,
    text=True
)

data = json.loads(result.stdout)
print(f"Found {data['count']} callers of Login:")
for r in data['results']:
    print(f"  - {r['caller']} in {r['file']}:{r['line']}")

Common Issues

Problem: No callers found ✅ Solutions:

  • Check function name spelling (case-sensitive)
  • Ensure file type is in enabled_languages
  • Run grepai watch to update symbol index

Problem: Too many false positives ✅ Solutions:

  • Use more specific function name
  • Add exclude patterns in config
  • Filter results with jq

Problem: Missing some callers ✅ Solutions:

  • Try --mode precise for better accuracy
  • Check if files are in ignore patterns

Best Practices

  1. Use exact function name: Case matters
  2. Check symbol index: Run grepai watch first
  3. Use JSON for scripts: Easier to parse
  4. Combine with search: Semantic + trace = full picture
  5. Filter large results: Use jq or grep

Output Format

Trace callers result:

🔍 Callers of "Login"

Mode: fast
Language files scanned: 245

Found 3 callers:

1. HandleAuth
   File: handlers/auth.go:42
   Context: user.Login(ctx, credentials)

2. TestLoginSuccess
   File: handlers/auth_test.go:15
   Context: result := Login(testUser, testPass)

3. RunCLI
   File: cmd/main.go:88
   Context: err := auth.Login(username, password)

Tip: Use --json for machine-readable output
     Use --mode precise for more accurate results

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.8%
按下载量换算1,271

Claude

28.18%
按下载量换算1,060

Cursor

18.7%
按下载量换算703

Gemini CLI

9.51%
按下载量换算358

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills