Skip to main content
Extract resources that formae knows about into a forma file, so you can bring existing infrastructure under management as code. Select the resources with a query and give a target file to write.

Examples

Flags

Plugin dependencies

The extracted file needs every plugin whose resources it declares to be a dependency of the PklProject that covers it. When you extract into a directory that already has a PklProject, extract adds any plugin namespace the resources need but the project is missing and re-resolves the project — silently, as part of extracting. Only the missing entries are added; your existing dependencies (including your pinned formae version) are preserved. If a resource needs a plugin the agent does not report as installed, extract fails with an actionable message instead of producing a file that can’t be generated:
Missing plugin dependencies are added automatically, because the extracted file cannot be generated without them. The formae core schema version is handled differently: extract only notifies you (see below) and never rewrites it.

Schema version compatibility

Extracted forma files use extends "@formae/forma.pkl" (see Properties), a shape introduced in formae 0.88.0. A PklProject pinning an older formae cannot evaluate a freshly extracted file, because the Pkl evaluator fails to resolve the extends. When you extract into a directory already covered by a PklProject, formae checks the formae version it pins: The extracted .pkl is always written. The notice is advisory: extract never rewrites your PklProject, so it introduces no surprise diff into your working tree.
To resolve it, bump the formae dependency in your PklProject to 0.88.0 or greater, then run:
The extracted file then evaluates correctly.