Supported Patterns
Jnkn detects environment variables and configuration patterns across multiple languages and frameworks.
How Detection Works
- Parse — Tree-sitter parses source code into an AST
- Extract — Pattern extractors find specific code patterns
- Normalize — Variable names are tokenized for matching
graph LR
F[Source File] --> P[Parser]
P --> A[AST]
A --> E1[Extractor 1]
A --> E2[Extractor 2]
A --> E3[Extractor N]
E1 --> N[Nodes]
E2 --> N
E3 --> N
Supported Languages
| Language | Patterns | Status |
|---|---|---|
| Python | os.getenv, Pydantic, Click, django-environ | ✅ Full |
| Terraform | Resources, variables, outputs | ✅ Full |
| Kubernetes | ConfigMaps, Secrets, env vars | ✅ Full |
| JavaScript | process.env, dotenv | 🚧 Beta |
| dbt | ref(), source(), var() | ✅ Full |
Adding New Patterns
If Jnkn doesn't detect your pattern:
- Check if it's a supported variation
- File a GitHub issue with an example
- Or write a custom extractor
Detection Confidence
Each pattern has inherent confidence:
| Source | Base Confidence | Notes |
|---|---|---|
Explicit (os.getenv("VAR")) |
1.0 | Direct reference |
Framework (Field(env="VAR")) |
0.95 | Framework-specific |
| Inferred (Pydantic field name) | 0.85 | Name → env var mapping |
Heuristic (DATABASE_URL = ...) |
0.7 | Pattern-based guess |
Testing Detection
Check if a pattern is detected:
Or test in Python: