Code metrics analysis tool for Python projects. Calculates LOC, complexity, Halstead metrics, and maintainability.
Commands
# Raw metrics (LOC, LLOC, SLOC, Comments, Blank)
cytoscnpy raw [OPTIONS] <PATH>
# Cyclomatic Complexity
cytoscnpy cc [OPTIONS] <PATH>
# Halstead Metrics
cytoscnpy hal [OPTIONS] <PATH>
# Maintainability Index
cytoscnpy mi [OPTIONS] <PATH>
Full project statistics report
cytoscnpy stats [OPTIONS]
Per-file metrics tablecytoscnpy table [OPTIONS]
MCP server for LLM integrationcytoscnpy mcp-server
Initialize config (.cytoscnpy.toml)cytoscnpy init
## Quality Gates
Use strict flags to fail CI when thresholds are exceeded (exit code 1):
```bash
cytoscnpy raw --max-loc 500 --max-complexity 15 <PATH>
Configuration
Create .cytoscnpy.toml in project root, or add [tool.cytoscnpy] to pyproject.toml.
cytoscnpy init # scaffolds config file
MCP Server
Starts an MCP server for LLM integration. Requires the standalone CLI build (not the Python package).
cytoscnpy mcp-server
Reference
See references/cli-reference.md for full option details.