Skip to main content

CMDOP skill — code analysis with tree-sitter AST parsing

Project description

cmdop-coder

CMDOP Skill — install and use via CMDOP agent:

cmdop-skill install cmdop-coder

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

Install

pip install cmdop-coder

Or as a CMDOP skill:

cmdop-skill install path/to/cmdop-coder

CLI

Extract functions

cmdop-coder functions --path src/main.py
{
  "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

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

Structural outline

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

File statistics

cmdop-coder analyze --path service.py

Python API

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.

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

cmdop_coder-0.1.5.tar.gz (69.0 kB view details)

Uploaded Source

Built Distribution

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

cmdop_coder-0.1.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file cmdop_coder-0.1.5.tar.gz.

File metadata

  • Download URL: cmdop_coder-0.1.5.tar.gz
  • Upload date:
  • Size: 69.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for cmdop_coder-0.1.5.tar.gz
Algorithm Hash digest
SHA256 991e51ad7303ebaa121c00cedb4c165274108956ead80c50a2d955f7acdb41c9
MD5 8a7c55f4bd61b53a2203048896e16bc0
BLAKE2b-256 ff49c8e1d1fb9b602b9f1b74bab9514b5436e843cb0b98ab69b2d81698a2dfe6

See more details on using hashes here.

File details

Details for the file cmdop_coder-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cmdop_coder-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for cmdop_coder-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0a65602d2ac362a4fccff8cee000179d38fa41bd48d7c1f00f0892a5d45d3ff4
MD5 ca54fa07cf27360525182d0461306f4f
BLAKE2b-256 c06d39a533b7e9ab8a2a6d0dfbb7268ef9e02afe55a19f239c1cc54ed7a9483b

See more details on using hashes here.

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