Expand description
Interface command - Public API extraction
Extracts the public interface (API surface) from source files. Supports all languages with tree-sitter grammars: Python, Rust, Go, TypeScript, JavaScript, Java, C, C++, Ruby, C#, Scala, PHP, Lua, Luau, Elixir, and OCaml.
§Features
- Extracts public functions (language-appropriate visibility rules)
- Extracts public classes/structs/traits with their public methods
- Captures export declarations when present (e.g., Python
__all__) - Marks async functions/methods
- Includes function signatures with type annotations
- Includes docstrings/doc comments when present
§Example
tldr interface src/api.py
tldr interface src/lib.rs
tldr interface src/ --format textStructs§
- Interface
Args - Arguments for the interface command.
Functions§
- extract_
all_ exports - Extract the contents of
__all__if defined in the module (Python only). - extract_
class_ info - Extract class/struct/trait information from a definition node.
- extract_
function_ info - Extract function information from a function definition node.
- extract_
function_ signature - Extract the function signature from a definition node.
- extract_
interface - Extract the public interface from a source file.
- extract_
interface_ with_ lang - Extract the public interface from a source file with an explicit language.
- format_
interface_ text - Format interface info as human-readable text.
- is_
public_ name - Check if a name is public based on language conventions.
- run
- Run the interface command.