Stellarion
Tools

stellarion_api_surface [Pro]

Catalog public exports by module and identify unused exports
This is a Pro tool. Requires a Stellarion Pro license. A 180-day free trial starts automatically.

Catalogs all public exports across your codebase by module. Identifies which exports have no external consumers (unused exports), ranks the most consumed symbols, and reports the overall unused export ratio.

When to Use

  • To understand the public API surface of a library or module
  • To find exports that can be made internal (reducing the public API)
  • Before a major version bump to audit what is exposed
  • To identify the most-depended-on symbols for careful handling during refactors

Parameters

ParameterTypeRequiredDefaultDescription
scopestringNoworkspacePath filter to narrow the analysis (e.g., src/lib/)
limitnumberNo30Maximum number of items to return per section

Examples

Audit the full API surface

What does this project export publicly? Are any exports unused?

Returns a catalog of all public exports and flags those with no external consumers.

Focus on a specific module

Show me the public API surface of src/utils/. Which exports are actually used?

Scopes the analysis to the src/utils/ directory.

Find the most consumed symbols

What are the most imported functions in this project?

Returns the top consumed symbols ranked by number of consumers.

Output Format

Public Exports

For each module:

  • Module path — file or directory
  • Exported symbols — functions, classes, constants, types
  • Consumer count — how many other modules import each symbol

Unused Exports

  • Symbol name and location — exports with zero external consumers
  • Unused ratio — percentage of total exports that are unused

Top Consumed Symbols

  • Ranked list of the most-imported symbols across the codebase
  • Consumer count for each

Tips

  • A high unused export ratio (> 30%) suggests the module is exposing more than it needs to
  • Unused exports are safe candidates for making internal (pub(crate) in Rust, removing from index.ts in TypeScript, dropping from __all__ in Python)
  • The "top consumed" list shows your most critical API — changes to these symbols have the highest blast radius
  • Pair with stellarion_find_unused_code for a broader dead code search that includes non-exported symbols
  • Use limit to control output size when working with large codebases