Quick Start
This guide walks you through the basic CRADLE workflow using CradleXC and the cxc command-line interface.
You will:
- install CradleXC
- verify that
cxcis available - obtain a CRADLE scenario
- validate the scenario
- compile it to YAML
No backend plugin is required for validation or compilation.
Prerequisites
Before starting, make sure you have:
- a supported operating system
- a terminal or command prompt
curl
Install CradleXC
-
CradleXC is distributed as a prebuilt binary through the CRADLE APT repository:
https://repo.cradle-lang.org/apt/ -
Add the CRADLE package repository, update your package index and install CradleXC.
For example:
echo "deb [trusted=yes] https://repo.cradle-lang.org/apt/ /" | sudo tee /etc/apt/sources.list.d/cradle.listsudo apt updatesudo apt install cxc
Verify the installation
Confirm that the CLI is available:
cxc --version
Then check the dependencies required by your local environment:
cxc doctor
If cxc doctor reports missing dependencies, view the installation guidance with:
cxc install-deps
Resolve any required dependency issues reported by cxc doctor before continuing.
Obtain a CRADLE scenario
Use an existing .cradle scenario or follow the
First Scenario guide to create one.
For example:
scenarios/HelloWorld.cradle
The remaining examples in this guide assume that file path.
Validate the scenario
Validate the scenario before compiling it:
cxc validate -i scenarios/HelloWorld.cradle
Validation checks whether the CRADLE syntax is valid and reports any syntax errors that need to be fixed.
Fix any reported validation errors before continuing.
Compile the scenario
Compile the validated scenario to YAML:
cxc compile -i scenarios/HelloWorld.cradle -o HelloWorld.yml
CradleXC processes the scenario and writes the compiled output to HelloWorld.yml.
You have now completed the basic CRADLE workflow:
cxc validatecxc compileOptional next steps
Inspect the intermediate representation
To inspect how CradleXC interpreted the scenario, run:
cxc dump-ir -i scenarios/HelloWorld.cradle
This command displays the intermediate representation produced from the CRADLE scenario. It is useful for troubleshooting or reviewing CradleXC's parsing and semantic processing.
Generate target-specific output
Backend plugins provide target-specific file generation.
To see the backend plugins available to your installed CradleXC release, run:
cxc plugin list
Backend installation and configuration are covered separately in the backend guide.
Once a compatible backend plugin is installed, generate target-specific output with:
cxc build -i scenarios/HelloWorld.cradle --target <plugin_name> -o /path/to/output
For example:
cxc build -i scenarios/HelloWorld.cradle --target vagrant -o ./output
The backend plugin generates the files required by its target. These files are not automatically executed by CradleXC. You can use the generated files with the corresponding tools in your own testbed environment.
Next steps
- Learn how to install and configure CradleXC.
- Build your first CRADLE scenario.
- Learn more about validation and compilation.
- Learn how to inspect compiler output.
- Continue to using a backend when you are ready to generate target-specific files for your testbed.