Skip to main content

A zero-dependency Python CLI toolset designed for AI agents to analyze codebases with surgical precision.

Project description

pypeeker-cli: Unified Agent-Native Python Analysis CLI

Powered by Cartograph License CI

pypeeker-cli is a zero-dependency Python CLI toolset designed for AI agents to analyze codebases with surgical precision. It transforms raw source code into structured, actionable logical maps.


Cartograph Showcase

pypeeker-cli is a premier showcase for Cartograph, a platform for reusable engineering.

Every core feature in pypeeker-cli, from AST parsing to graph cycle detection, is implemented as a standalone, validated Cartograph widget. This architecture ensures that pypeeker-cli is not just a tool, but a modular assembly of hardened building blocks that can be easily extended or repurposed.


Analysis Surface Area

pypeeker-cli categorizes its tools by Analysis Surface Area, allowing agents to choose the right depth for their task:

1. Project Scan (Horizontal)

Broad audits of the entire project tree to find relationships and hazards.

  • circular: Find import dependency loops (identifies runtime crashes vs safe TYPE_CHECKING cycles).
  • missing: Detect hallucinated or missing internal imports using Dynamic Root Discovery.
  • interfaces: Validate code contracts (flags missing docstrings and type hints; tests are ignored by default, use --include-tests to opt in).

2. Navigation (Relationship)

Pinpoint and trace symbols across file boundaries.

  • locate: Find a symbol's exact definition bounds (start/end lines) or trace its usages (--usages) and ancestry (--inherited).

3. Deep Dive (Vertical)

Surgical analysis inside a specific file or function.

  • skeleton: Extract the API surface of a file (imports, classes, variables, signatures) without function bodies.
  • flow: Map the logical control flow (pseudocode) of a function with precise line anchors.
  • impact: Analyze the blast radius of a function, distinguishing between internal and external side effects.

Tool Showcase

pypeeker transforms dense Python source into structured, machine-first intelligence.

API Skeleton extraction

Compress a 500-line file into a surgical map of its signatures and docstrings.

{
  "file": "cli.py",
  "skeleton": {
    "imports": ["import sys", "import os", "import argparse"],
    "functions": [
      {
        "name": "main",
        "docstring": "Main entry point for the pypeeker CLI.",
        "args": [{"name": "args", "type": "argparse.Namespace"}],
        "returns": "None"
      }
    ]
  }
}

Logical Flow mapping

View the branching logic and external calls of a function without reading the implementation boilerplate.

{
  "function": "main",
  "flow": [
    { "line": 77, "type": "call", "value": "cli.add_commands('Project Scan', [...])" },
    { "line": 143, "type": "call", "value": "cli.run()" }
  ]
}

Granular Impact analysis

Identify exactly which class attributes or globals a function modifies before refactoring.

{
  "function": "save",
  "external": {
    "writes": ["self.updated_at", "self.status"],
    "calls": ["db.commit", "logging.info"]
  }
}

Installation

Install the pypeeker-cli core primitive globally using pip:

pip install pypeeker-cli

This provides the pypeeker command on your system path.


Agent Native Integration

pypeeker-cli is designed to be consumed by AI agents via the Model Context Protocol (MCP). After installing the CLI, you can integrate it into your agent of choice.

Integration Methods

Gemini CLI

Install as a native extension:

gemini extensions install https://github.com/benteigland11/pypeeker

Claude Code

Add as a persistent MCP server:

claude mcp add pypeeker-cli -- pypeeker mcp

Codex

Add as a global MCP server:

codex mcp add pypeeker-cli -- pypeeker mcp

Cursor and Roo Code

Pypeeker is pre-configured for automatic detection via .cursor/mcp.json.

Continue

The server is pre-configured via .continue/mcpServers/pypeeker.json.

Windsurf

The server is pre-configured via .windsurf/mcp_config.json.

Claude Desktop and Aider

Copy the JSON from claude_desktop_snippet.json into your global claude_desktop_config.json.


Reusable Core

Built using the following Cartograph Widgets (found in cg/):

  • cg-infra-agent-cli-python: Machine-first declarative CLI framework.
  • data-ast-import-parser-python: Root-aware static import analysis.
  • data-ast-skeleton-parser-python: API signature extraction.
  • data-ast-symbol-locator-python: Surgical symbol pinpointing and ancestry.
  • data-ast-interface-validator-python: API gap detection.
  • data-ast-flow-mapper-python: Logical pseudocode generation.
  • data-ast-impact-analyzer-python: Side-effect and dependency mapping.
  • infra-mcp-manifest-generator-python: Automated distribution scaffolding.
  • universal-agent-response-python: Standardized JSON schema.
  • universal-list-paginator-python: Result set pagination.

License

Licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypeeker_cli-1.1.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypeeker_cli-1.1.0-py3-none-any.whl (68.5 kB view details)

Uploaded Python 3

File details

Details for the file pypeeker_cli-1.1.0.tar.gz.

File metadata

  • Download URL: pypeeker_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pypeeker_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 20fcd6eb8f2df4d6db9a7b19e85fe4c0e839156df011fbef452121072ccadfe9
MD5 90edddfe161c9035e1d419411e617b13
BLAKE2b-256 d52e9c321d2ee0d599a91de76183f1c27ea30eb7321226a44eaa6f5b98b2a308

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypeeker_cli-1.1.0.tar.gz:

Publisher: pypi-publish.yml on benteigland11/pypeeker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pypeeker_cli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pypeeker_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 68.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pypeeker_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0649add0fd9f589dd94fcda441f88fc334b2b8104401228f2f96a80dc1b4ea9e
MD5 b26cec03c936c9bd1610c1f2137483fd
BLAKE2b-256 883b287a442cee91b863827b16ddb6f647b8459144cb4a7be8301126e52a0fc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypeeker_cli-1.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on benteigland11/pypeeker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page