serpentine catalog

Flat list of every named entity in the codebase — modules, classes, functions, and variables.

Output a flat list of all nodes. The default format is a file-grouped text hierarchy; use --format json to see node IDs for use in selector expressions.

serpentine catalog [PATH] [OPTIONS]

Options

OptionDescription
--filter TEXTGlob pattern matched against node ID and name (repeatable; multiple patterns = union)
--format TEXTOutput format: text (default) or json
--include-assignmentsInclude variable/assignment nodes (default: excluded)
-o, --output PATHWrite output to file instead of stdout
--prettyPretty-print JSON output
--include-standardInclude stdlib nodes
--include-third-partyInclude third-party nodes

Finding node IDs

Every node has a dotted ID that reflects its location in the codebase. Use catalog with --format json to discover them:

serpentine catalog . --format json --pretty

This outputs a flat list of every module, class, and function with its ID:

{
  "nodes": [
    { "id": "src.auth.models.User", "name": "User", "type": "class" },
    { "id": "src.auth.views.login", "name": "login", "type": "function" },
    { "id": "src.payments.stripe.charge", "name": "charge", "type": "function" }
  ]
}

Filtering with globs

Narrow results with --filter (glob matched against both ID and name). The * wildcard matches across dots, so it crosses module boundaries.

# Everything related to auth
serpentine catalog . --filter "*auth*"

# Find a class by name across all modules
serpentine catalog . --filter "*User*" --format json --pretty

# Combine multiple filters (union)
serpentine catalog . --filter "*auth*" --filter "*payment*"

Text output format

The text output groups nodes by file, showing the hierarchy:

src/auth/models.py
  class User
    def get_full_name
    def save
  class Permission

src/auth/views.py
  def login
  def logout

Use this to get a quick structural overview of any module or the whole project.