Level up your Sitecore Content Hub development: Why the CLI is your new best friend
Initialise your scripting workspace with the Content Hub CLI.
Stop wasting time in the UI
If you’re still doing everything through the Content Hub UI, you’re leaving speed and accuracy on the table. At this year’s SUGCON, I joined Thomas Cauldron’s Content Hub developer optimisation workshop, and one thing was clear: the CLI is no longer optional, yet it’s a relatively unknown or underused tool.
Why it matters to serious developers
Navigating the UI, copying scripts, guessing configs, pushing to test, it’s slow, clunky, and not built for modern development workflows. The CLI changes all of that.
With the CLI, you get control, repeatability, and insight. You can move fast, collaborate better, and avoid surprises across environments. For delivery teams, it’s the kind of upgrade that shows instantly in velocity and quality.
Faster, cleaner environment management
Serious Content Hub projects span multiple environments. Switching between them, managing models, and deploying updates shouldn’t slow you down.
The CLI lets you:
- Export targeted content by ID or type
- Use wildcards to serialise sets of entities
- Compare environments to see deltas clearly
- Serialise everything into YAML for source control
- Package and deploy cleanly across dev, test, and prod
If you’ve used Sitecore Content Serialization, this will feel familiar, but with more precision and control.
Script like a real developer
Scripting in Sitecore Content Hub lets you customise and automate how the platform behaves, without needing to wait on product updates or do everything manually through the UI.
Most scripting is done through Action Scripts, which are triggered by specific events (like when an entity is created, updated, or deleted). You can use scripts to:
- Enforce business rules (e.g. auto-populate fields, apply logic based on metadata)
- Trigger workflows or external integrations
- Clean up or transform content automatically
- Extend platform behaviour beyond standard configurations
It’s a powerful way to tailor Content Hub to your exact needs, and when combined with the CLI, you can script with proper tooling, version control, and confidence.
Action scripts are powerful. But if you’re writing them in the UI, without versioning or testing, you're doing it the hard way.
With the CLI, you can:
- Work in Visual Studio Code
- Get full IntelliSense with OmniSharp for .csx (note: you may need disable C# IntelliSense and enable OmniSharp Intellisense to get this working)
- Debug scripts and run unit tests
- Reuse logic across your team using shared scripts
Just run the cli init command:
$ ch-cli scripting initialize -f <YOUR_FOLDER_PATH>
which will pull down the necessary DLLs and type references, and you’re ready. From there, it’s proper dev work: faster, structured, and ready for collaboration.
Basic Action Script example:
# load ./references/Action.csx
Var targetId = Context.targetId;
MClient.Logger.Info($”Target id: {targetId}”);
And of course, you can use the Content Hub CLI in your DevOps pipelines for full automation and pre-deployment validation.
The bottom line
If you're working in Content Hub without the CLI, you're working blindfolded.
Switching to the CLI is about levelling up your workflow to match the complexity of the platform.
Got questions? Reach out to Thomas on Slack (don’t worry he said you can), or of course refer to the official documentation.
https://doc.sitecore.com/ch/en/developers/cloud-dev/content-hub-command-line-interface--cli-.html