mdsmith
Esc
    v0.52.0 GitHub

    mdsmith deps

    List a file’s dependency-graph edges (includes, links, catalogs, builds).

    Print the dependency edges of one Markdown file: the includes, catalogs, build inputs, and links it points at. With --incoming, print every workspace file that points at it instead. This is the CLI surface for the same workspace graph the LSP call-hierarchy walks.

    mdsmith deps [flags] <file>

    <file> is workspace-relative. Absolute paths and parent-traversal entries (../foo.md) are rejected with exit code 2.

    # Flags

    FlagDefaultDescription
    -c, --configautoOverride config path
    -f, --formattextOutput format: text or json
    --incomingfalseList files that depend on <file> instead
    --no-gitignorefalseDisable .gitignore filtering during walk
    --follow-symlinksconfigFollow symlinks; tri-state — see below
    --max-input-size2MBMax file size (e.g. 2MB, 0=none)

    --follow-symlinks and file discovery (the files: and ignore: patterns in .mdsmith.yml) match mdsmith check .

    # Output

    text (default), one row per edge:

    docs/index.md:14: file-link docs/api.md#authentication
    docs/index.md:20: include docs/frag.md

    Each row carries the source path, the 1-based source line, the edge kind, and the target. Outgoing rows are sorted by line; --incoming rows are sorted by source path then line.

    Edge kinds are anchor-link, file-link, ref-link, include, catalog, and build. An unresolved <?catalog?> glob renders its target as (glob).

    json:

    [
      {
        "source": "docs/index.md",
        "line": 14,
        "kind": "file-link",
        "target": "docs/api.md#authentication"
      }
    ]

    Keys are stable. Empty results emit [], not null.

    # Examples

    What does this file pull in?

    mdsmith deps docs/index.md

    What depends on this file (impact analysis before a move or delete)?

    mdsmith deps docs/api.md --incoming

    JSON for a CI dependency check:

    mdsmith deps --format json docs/api.md --incoming

    # Exit codes

    CodeMeaning
    0At least one edge
    1No edges, no errors
    2Runtime/parse error

    # See also

    • mdsmith list backlinks — the reverse-link query scoped to direct Markdown links.
    • mdsmith lsp — the editor surface for the same graph (call hierarchy, references).