Loading...
Loading...
Use the codeintel command-line tool: intelligent indexing and field trace query for Go codebases. Features include building indexes (init), querying symbol/field read-write summaries (query fields), field tracing (trace-backward/forward), full-chain data value tracing (value-trace), call relationship analysis (callers/callees/impact), export (export), and Web service (serve). This skill is used when users request to analyze field data flows in Go codebases, trace field users/producers, check function field read-write operations, or query call relationships.
npx skill4agent add schaepher/codeintel codeintel-cli.codeintel/codeintel.dbgithub.com/schaepher/codeintel# Build within the codeintel repository
go build -o codeintel ./cmd/codeintel
# Or install to GOBIN
make installcodeintel init --repo <path> # Full index build (requires go.mod; will prompt to enter module directory at go.work root)
codeintel update --repo <path> # Incremental update (git detects changed files, full analysis + incremental write)
codeintel serve --repo <path> --addr :8096 # Start graph exploration Web service (frontend AntV G6, default port :8090)
codeintel query <sub> ... --repo <path> # Query (see below; all subcommands support --json / --compact)
codeintel export --repo <path> [--out x.json] # Export field double-layer index JSON (field → producer/consumer)
codeintel export graph --type value-trace|callees|lifecycle --target <node> [--format mermaid|dot] [--out file]
# Graph export: value-trace defaults to mermaid (function grouping), callees defaults to dot,
# lifecycle diagram ([storage]/[observation]/[read]/[write] + condition annotations)
codeintel clean --repo <path> --force # Delete index (must clean + init rebuild after schema changes)
codeintel version| Subcommand | Purpose | Key Parameters |
|---|---|---|
| Symbol details (including callers/callees) | |
| Function field read-write summary (direct_read/write + indirect_write) | |
| Reverse trace of field production points | |
| Forward trace of subsequent field usage | |
| Full chain of data values (cross-function, grouped by function context) | |
| Callers/callees | |
| Impact analysis | |
| Cross-layer summary: main chain of entry → compute → write → consume (each step with file:line) | |
--json--compact.codeintel/codeintel.log<sym>symbol:go:<pkg>:<name>(T).m<field>example.com/app/internal/agent.Config.APIKey<nodeID>symbol:go:...:(Manager).Run#m.cfg.APIKey.read@47example.com/appm.cfg.APIKey# 1. Build index (first time or after schema changes)
codeintel init --repo <target-repo>
# 2. Function field read-write summary (after verification, you can see [direct_read]/[direct_write]/[indirect_write] groups)
codeintel query fields "(Manager).Run" --repo <target-repo>
# 3. Forward trace of field users
codeintel query trace-forward example.com/app/internal/agent.Config.APIKey \
--func "(Manager).Run" --repo <target-repo>
# 4. Full chain of data values (cross-function): first query node ID, then trace
sqlite3 <target-repo>/.codeintel/codeintel.db \
"SELECT id FROM nodes WHERE kind='field_access' AND json_extract(properties,'\$.instance_path')='m.cfg.APIKey' LIMIT 1"
codeintel query value-trace "<ID obtained above>" --repo <target-repo>[direct_read][direct_write][indirect_write]m.mu :55 m.mu.Lock()【function name】←→[read]/[write]m.cfgm.cfg.APIKey[]T{...}[condition: ...][register 0.9][enum 0.7]users.namevar.<name>query summary <node>make testmake itmake e2eE2E_REPO=<repo>clean --forceinit.codeintel/codeintel.logpkill -f "codeintel-e2e serve"pgrep -x codeintel-e2egoscip-go