Skip to content

jweissman/charql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CharQL

What is charql?

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.

features

  • functional programming syntax
  • pipeline-oriented query and transformation language

syntax notes

  • 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.

examples

simple data transformation

read-yaml "data.yaml" | filter it.price > 100 | map { name, price: it.price * 0.9 } | write-json "output.json"

semantic operators

read-csv "test/fixtures/reviews.csv" | cluster it.review ['positive', 'neutral', 'negative'] | map { item: it.name, sentiment: it.cluster } | write-json 'sentiment.json'

find easy github prs

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'

configure repo target

The bundled PR-review scripts read these optional environment variables:

  • CHARQL_GH_REPO: repository for gh --repo. Use owner/repo for github.com or host/owner/repo for GHE, for example va.ghe.com/software/vets-api.
  • CHARQL_GH_TEAM_REVIEW_QUERY: query fragment for PR search, for example team-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.

vision

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.

About

small, composable automation language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors