TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/andresilva-cc/grafex/llms.txt
Use this file to discover all available pages before exploring further.
grafex init command is the fastest way to get a new project ready for writing compositions. Run it once after installing Grafex and it creates two files in your current directory: a tsconfig.json pre-configured with the JSX settings Grafex requires, and a composition.tsx starter file you can edit immediately. If either file already exists it is silently skipped, so the command is always safe to re-run.
Usage
Flags
Print the help text and exit. Short form:
-h.What gets created
Runninggrafex init in a fresh directory produces the following terminal output:
Skipped <filename> (already exists) instead.
tsconfig.json
Grafex uses its own JSX factory (h) and fragment factory (Fragment) — both are injected at transpile time so you never need to import them. The generated tsconfig.json wires up those settings:
These three
compilerOptions are the only ones Grafex requires. You can add any other TypeScript options alongside them — strict, paths, baseUrl, etc. — without affecting how Grafex transpiles your compositions.composition.tsx
The starter composition is a 1200 × 630 gradient card — the standard Open Graph image size — so you can run grafex export straight away and see a real output:
Full workflow after init
Preview your composition live
composition.tsx and the browser updates automatically.Global flags
The following flags are available on the top-levelgrafex command, before any subcommand: