Skip to content

chant migrate

chant migrate <file> [flags]

chant migrate translates a workflow file from one lexicon’s source format into another lexicon’s output. v1 ships a single edge: GitHub Actions (.github/workflows/*.yml) → GitLab CI (.gitlab-ci.yml or chant TypeScript).

The translation is deterministic and typed — the same input produces the same output, every translation decision is recorded as per-key provenance, and unknown patterns surface as machine-readable diagnostics rather than guesswork.

For the full surface (supported translations, marketplace-action coverage, NeedsReview catalog, --use-composites, validators), see GitLab → Migration.

FlagTypeDefaultDescription
--fromstringgithubSource lexicon name
--tostringgitlabTarget lexicon name
-o, --outputstringstdoutWrite rendered output to this file
--emitstringyamlOutput format: yaml (one-shot) or ts (own-it-going-forward chant source)
--reportstringWrite SARIF v2.1.0 report to this path
--strictboolfalseExit non-zero on any needs-review diagnostic (and on validator failure when --validate is set)
--validateboolfalseRun an external validator (glci lint preferred, glab ci lint fallback) against the emitted YAML
--use-compositesboolfalseRewrite recognised IR shapes (NodePipeline, NodeCI) into composite calls
Terminal window
# Default: GitHub Actions YAML → GitLab CI YAML on stdout
chant migrate .github/workflows/ci.yml
# Write to file + emit SARIF report
chant migrate .github/workflows/ci.yml \
--output .gitlab-ci.yml \
--report migration.sarif
# Own it going forward: emit typed chant TypeScript
chant migrate .github/workflows/ci.yml --emit ts --output src/pipeline.ts
# Strict + validate (CI-friendly)
chant migrate .github/workflows/ci.yml \
--output .gitlab-ci.yml \
--strict \
--validate
# Collapse Node-shaped pipelines into NodePipeline({...}) calls
chant migrate .github/workflows/ci.yml \
--emit ts \
--use-composites \
--output src/pipeline.ts

Diagnostics surface as SARIF v2.1.0 (via --report) and as a Markdown summary on stderr. Each diagnostic carries:

  • ruleId — e.g. MIG-PERMISSIONS-001, MIG-ON-SCHEDULE, ACT-actions-checkout
  • severityinfo / warning / error (warning becomes error under --strict)
  • message — human-readable description
  • file + line — source workflow location

The full rule catalog with explanations lives at GitLab → Migration → NeedsReview rules.

CodeMeaning
0Success (or non-strict run with warnings)
1Cannot read source file, target lexicon missing, transform failed, or --strict and one or more error-severity diagnostics emitted
  • GitLab → Migration — full surface, marketplace-action coverage, worked examples, limitations
  • chant import — sibling command for importing existing templates into typed chant source (single-lexicon, no cross-lexicon translation)