| name | codeprobe-configure |
| description | Generate `.codeprobe.toml` and recommend scanner/tool configuration for a repository based on detected languages, frameworks, and IaC types. Use when the user says 'configure codeprobe', 'what scanners should I use', or 'initialize codeprobe'. DO NOT use when `.codeprobe.toml` already exists and the user has not asked to regenerate or reconfigure it — edit the existing file directly. DO NOT use for running scans — use codeprobe-probe or the `/probe` command. |
Configure Codeprobe
Set up config-driven multi-language static analysis for a repository.
Step 1: Detect Project Profile
Run project detection to identify the tech stack:
uv run codeprobe detect .
This outputs a JSON ProjectProfile with:
languages: Detected programming languages (python, typescript, go, rust, java, ruby)
frameworks: Detected frameworks (fastapi, django, flask, react, next, express, pytest, pydantic, strands, boto3, sqlalchemy, langchain)
iac_types: Infrastructure as Code types (docker, terraform, cdk, cloudformation, kubernetes, helm)
manifest_files: Found build/dependency files (pyproject.toml, package.json, Cargo.toml, etc.)
src_dirs: Detected source directories mapped to language hints
Step 2: Verify Tool Availability
uv run codeprobe check
This checks three tool groups:
Core (required):
rg (ripgrep) -- file search
gitnexus -- structural code graph
repomix -- context generation
npx -- Node.js package runner
Static analysis (optional):
semgrep -- SAST rules
ruff -- Python linter (fast, covers flake8/isort/pyflakes)
ty -- Python type checker (by Astral, fast)
radon -- Python cyclomatic complexity
vulture -- Python dead code detection
pipdeptree -- Python dependency graph
Security (optional):
betterleaks -- secrets detection
bandit -- Python security linting
osv-scanner -- dependency vulnerability scanning
Step 3: Scanner Selection Logic
The scanner catalog at src/codeprobe/scanners/catalog.py maps scanners to languages:
| Scanner | Languages | Category | SARIF Native | Install |
|---|
ruff | Python | lint | Yes | uvx ruff |
ty | Python | typecheck | No | uvx ty |
bandit | Python | sast | Yes | uv run bandit |
vulture | Python | dead-code | No | uvx vulture |
radon | Python | complexity | No | uvx radon |
semgrep | All | sast | Yes | semgrep |
betterleaks | All | secrets | Yes | betterleaks |
osv | All | deps | Yes | osv-scanner |
gitnexus | All | graph | No | gitnexus |
Scanners are auto-selected based on detected languages. Cross-language scanners (semgrep, betterleaks, osv, gitnexus) always run.
Step 4: Generate .codeprobe.toml
Run uv run codeprobe init . to auto-generate the config, or create it manually:
[project]
languages = ["python"]
frameworks = ["fastapi", "pydantic", "pytest"]
iac_types = ["docker"]
[scanners]
Step 5: Recommend Tool Configuration
Based on the detected stack, recommend appropriate tool configurations:
For Python projects
pyproject.toml sections to add:
[tool.ruff]
line-length = 120
target-version = "py313"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "C4", "SIM", "TCH", "RUF", "PLR", "PLW", "PLE", "PERF", "FURB"]
[tool.ruff.format]
quote-style = "double"
docstring-code-format = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.bandit]
exclude_dirs = ["tests", ".venv"]
For TypeScript projects
biome.json (strict config):
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": { "recommended": true }
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
}
}
Step 6: Recommend mise.toml Tool Entries
If tools are missing, recommend adding them to mise.toml:
[tools]
python = "3.13"
node = "22"
ruff = "latest"
"pipx:bandit" = "latest"
"npm:repomix" = "latest"
[env]
_.python.venv = { path = ".venv", create = true }
[tasks]
scan = "uv run codeprobe scan ."
check = "uv run codeprobe check"
index = "uv run codeprobe index ."
Step 7: Generate lefthook.yml Pre-Commit Hooks
pre-commit:
parallel: true
commands:
ruff-check:
glob: "*.py"
run: ruff check --fix {staged_files}
stage_fixed: true
ruff-format:
glob: "*.py"
run: ruff format {staged_files}
stage_fixed: true
ty-check:
glob: "*.py"
run: ty check
betterleaks:
run: betterleaks -c betterleaks.toml .
commit-msg:
commands:
commitizen:
run: uv run cz check --commit-msg-file {1}
pre-push:
parallel: true
commands:
lint:
run: ruff check .
typecheck:
run: ty check
test:
run: uv run pytest
semgrep:
run: semgrep --config p/owasp-top-ten --quiet .
betterleaks:
run: betterleaks -c betterleaks.toml .
Step 8: Next Steps
After configuration:
- Run
uv run codeprobe scan . to get your first scan results
- Run
uv run codeprobe index . to build the full deterministic index (includes git hotspots, complexity analysis, GitNexus graph)
- Use
/probe for a full scan-and-interpret cycle
- Use
/interpret to analyze existing scan results
- Set up CI/CD with
uv run codeprobe ci-init . for automated PR verdicts
Acceptance
Success = .codeprobe.toml exists at the repository root with [project] and [scanners] sections that reflect the detected ProjectProfile; uv run codeprobe check lists the required tools; and the user has a clear list of recommended mise.toml / pyproject.toml / biome.json entries for any missing tools.