CharQL is a small, composable automation language and runtime for structured operational workflows, especially ones that combine data transformation, external tools, and selective AI judgment.
- functional programming syntax
- pipeline-oriented query and transformation language
- Statements are newline-delimited.
- Semicolons are not supported; rewrite multi-statement programs as one statement per line.
- Pipelines can continue across lines by leading with
|on continuation lines.
read-yaml "data.yaml" | filter it.price > 100 | map { name, price: it.price * 0.9 } | write-json "output.json"
read-csv "test/fixtures/reviews.csv" | cluster it.review ['positive', 'neutral', 'negative'] | map { item: it.name, sentiment: it.cluster } | write-json 'sentiment.json'
gh ["pr", "list", "--repo", "owner/repo", "--limit", "5", "--json", "title,body,url"]
| parse-json
| fetch-pr-diffs
| assess-pr-safety
| cluster it.assessment ['safe', 'risky', 'needs-human-review']
| filter it.cluster == 'safe'
| write-json 'safe-prs.json'
The bundled PR-review scripts read these optional environment variables:
CHARQL_GH_REPO: repository forgh --repo. Useowner/repofor github.com orhost/owner/repofor GHE, for exampleva.ghe.com/software/vets-api.CHARQL_GH_TEAM_REVIEW_QUERY: query fragment for PR search, for exampleteam-review-requested:software/backend-review-group.
This keeps the CharQL flow unchanged while letting gh route requests to github.com or GHE based on its normal repo/host handling.
i think my broadest long-term vision is being able to define in typescript your own commands/queries that can be used in charql. ultimately even the core stdlib should be implementable this way (ie as TS models). this would allow users to create their own domain-specific languages on top of charql, and also enable better type safety and autocompletion when writing charql queries.