{
  "slug": "import-graph-extractor",
  "name": "gizza-ai/import-graph-extractor",
  "version": "0.1.0",
  "title": "Import Graph Extractor — gizza.ai",
  "description": "Paste JS, Python, Rust, or Go source and get an import graph with file edges, external deps, dependents, orphans, leaves, and cycles.",
  "tags": [
    "import graph",
    "dependency graph",
    "circular dependency",
    "madge alternative",
    "module graph",
    "javascript imports",
    "python imports",
    "graphviz dot",
    "mermaid",
    "code analysis"
  ],
  "category": "math",
  "urls": {
    "page": "https://gizza.ai/tools/import-graph-extractor/",
    "markdown": "https://gizza.ai/tools/import-graph-extractor/index.md",
    "descriptor": "https://gizza.ai/tools/import-graph-extractor/tool.json",
    "deep_link_example": "https://gizza.ai/tools/import-graph-extractor/?input=%3D%3D%3D%20src%2Fapp.js%20%3D%3D%3D%0Aimport%20%7B%20greet%20%7D%20from%20%27.%2Futil%2Fgreet%27%3B%0Aimport%20React%20from%20%27react%27%3B%0A%0A%3D%3D%3D%20src%2Futil%2Fgreet.js%20%3D%3D%3D%0Aexport%20const%20greet%20%3D%20%28%29%20%3D%3E%20%27hi%27%3B&language=auto&format=text&include_external=true&detect_cycles=true"
  },
  "cli": "gizza tool import-graph-extractor \"=== src/app.js ===\nimport { greet } from './util/greet';\nimport React from 'react';\n\n=== src/util/greet.js ===\nexport const greet = () => 'hi';\"",
  "tool": {
    "description": "Extract the import/require/use dependency graph from pasted source code. Paste one or more files, separated by `=== path ===` (or `--- path ---`) header lines; supports JavaScript/TypeScript (import, dynamic import, export-from, require), Python (import, from, relative imports), Rust (use, mod, extern crate), and Go (import). Resolves file-to-file edges for JS/TS relative paths and Python dotted modules, and reports external dependencies, dependents (who imports each file), orphan and leaf files, and circular dependencies. Choose format=text (default), json, dot (Graphviz), or mermaid; toggle include_external and detect_cycles.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "detect_cycles": {
          "default": true,
          "description": "Detect and report circular dependencies (import cycles) between the pasted files. Default true.",
          "type": "boolean"
        },
        "format": {
          "default": "text",
          "description": "Output format. 'text' (default) is a human-readable report; 'json' is a structured graph object; 'dot' is Graphviz DOT; 'mermaid' is a Mermaid flowchart. Paste dot/mermaid into any renderer for a picture.",
          "enum": [
            "text",
            "json",
            "dot",
            "mermaid"
          ],
          "type": "string"
        },
        "include_external": {
          "default": true,
          "description": "Include third-party packages and standard-library modules (e.g. react, lodash, os, fmt) in the report and graph. Default true; set false to focus only on file-to-file edges.",
          "type": "boolean"
        },
        "input": {
          "description": "Source code to analyze. Paste one or more files; separate multiple files with a header line like `=== src/app.js ===` or `--- src/app.js ---` (the path sets each file's name and, in auto mode, its language from the extension). With no headers the whole input is treated as one file and its name is inferred from `language`.",
          "type": "string"
        },
        "language": {
          "default": "auto",
          "description": "Source language. 'auto' (default) detects each file from its header extension, or sniffs a single headerless file. Force 'javascript' (JS/TS/JSX/TSX), 'python', 'rust', or 'go' to treat every pasted file as that language.",
          "enum": [
            "auto",
            "javascript",
            "python",
            "rust",
            "go"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}