Extract the public API surface from source files as compact JSON — function signatures, type/struct/interface definitions, const/var blocks — without implementation bodies.
| Extension | Language |
|---|---|
.go |
Go |
.ts, .tsx, .mts, .cts |
TypeScript |
.cs |
C# |
go build -o sig
codesign -s - sig
sudo cp sig /usr/local/bin/
sudo codesign -f -s - /usr/local/bin/sigOr with just:
just installsig --cli file.go # public API only
sig --cli --all file.go # include private/unexported symbolssig runs as an MCP JSON-RPC stdio server by default (no flags). Register it with Claude Code:
claude mcp add --transport stdio --scope user sig -- /usr/local/bin/sigTool: sig
Parameters:
file(string, required) — absolute path to source fileall(boolean, optional) — include private/unexported symbols (default: false)
Returns a FileShape JSON object:
{
"file": "/path/to/file.go",
"package": "main",
"imports": ["fmt", "os"],
"types": [
{
"name": "Server",
"kind": "struct",
"line": 15,
"fields": [{"name": "Port", "type": "int"}],
"methods": [{"name": "Start", "signature": "() error", "line": 20}]
}
],
"functions": [
{"name": "NewServer", "signature": "(port int) *Server", "line": 10}
],
"constants": [],
"variables": []
}MIT