A Cline CLI plugin that gives Cline a goto_definition tool powered by the TypeScript Language Service API.
Instead of relying on grep or text search, this plugin resolves symbol definitions through imports, re-exports, type aliases, barrel files, and more. It uses the same engine that powers "Go to Definition" in VS Code.
cline plugin install https://github.com/cline/typescript-lsp-plugin.gitVerify it's loaded:
cline config # check the plugin tabCline passes a file path and line number to the goto_definition tool. The plugin:
- Walks up from the file to find the nearest
tsconfig.json - Creates a TypeScript Language Service for that project
- Scans the AST to find all identifiers on the given line
- Resolves each identifier to its definition using
getDefinitionAtPosition
The Language Service is cached per tsconfig, so repeated calls in the same project are fast.
TypeScript itself is resolved from the target project's node_modules at runtime, so this plugin has zero dependencies and uses whatever TS version the project is compiled with.
Given a file with this import on line 4:
import { disposeAll, initVcr } from "@cline/shared"The plugin resolves both symbols through the workspace package alias:
disposeAll -> packages/shared/src/dispose.ts:19
initVcr -> packages/shared/src/vcr.ts:699
This repo follows the Cline plugin manifest format. The package.json declares plugin entry points in a cline field:
{
"cline": {
"plugins": [
{
"paths": ["./src/index.ts"],
"capabilities": ["tools"]
}
]
}
}See the Cline plugin docs for more on writing and distributing plugins.