Metadata-Version: 2.4
Name: cmdop-coder
Version: 0.1.12
Summary: CMDOP skill — code analysis with tree-sitter AST parsing
Project-URL: Homepage, https://cmdop.com/skills/cmdop-coder/
Author-email: CMDOP Team <team@cmdop.com>
License-Expression: MIT
Keywords: ast,cmdop,code,skill,tree-sitter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: cmdop
Requires-Dist: cmdop-skill
Requires-Dist: pydantic>=2.0
Requires-Dist: tree-sitter-language-pack>=0.1
Requires-Dist: tree-sitter>=0.21
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# cmdop-coder

> **[CMDOP Skill](https://cmdop.com/skills/cmdop-coder/)** — install and use via [CMDOP agent](https://cmdop.com):
> ```
> cmdop-skill install cmdop-coder
> ```

Code analysis using tree-sitter AST parsing. Extract functions, find symbols, get structural outlines. Supports 40+ languages.

## Install

```bash
pip install cmdop-coder
```

Or as a CMDOP skill:

```bash
cmdop-skill install path/to/cmdop-coder
```

## CLI

### Extract functions

```bash
cmdop-coder functions --path src/main.py
```

```json
{
  "file": "src/main.py",
  "language": "python",
  "count": 3,
  "functions": [
    {"line": 5, "name": "hello", "signature": "def hello(name: str) -> str:"},
    {"line": 9, "name": "fetch", "signature": "async def fetch(url: str) -> bytes:"}
  ]
}
```

### Find symbol

```bash
cmdop-coder symbols --symbol MyClass --path ./src
```

### Structural outline

```bash
cmdop-coder outline --path internal/agent/core/agent.go
```

### File statistics

```bash
cmdop-coder analyze --path service.py
```

## Python API

```python
from cmdop_coder import extract_functions, find_symbol, get_outline, analyze_file

# Extract all functions from a file
result = extract_functions("src/main.py")
for fn in result.functions:
    print(fn.line, fn.name, fn.signature)

# Find symbol across a directory
matches = find_symbol("MyClass", "./src")
for m in matches.matches:
    print(m.file, m.line, m.text)

# Structural outline
outline = get_outline("main.go")
for item in outline.outline:
    print(item.line, item.type, item.name)

# File statistics
stats = analyze_file("service.py")
print(stats.language, stats.total_lines, stats.function_count)
```

## Supported Languages

Go, Python, JavaScript, TypeScript, TSX, Rust, Java, C, C++, Ruby, PHP,
Swift, Kotlin, C#, CSS, HTML, JSON, YAML, TOML, Bash, SQL, Lua, Scala,
Elixir, Elm, Haskell, OCaml, HCL, Dockerfile and more.
