SitecoreCommander is a .NET/C# automation toolkit for SitecoreAI and Sitecore 10.3+.
It is built for developers, technical content teams, and administrators who need reliable API automation for real projects, not one-off requests. Instead of isolated calls in Postman or GraphQL Playground, SitecoreCommander helps you compose reusable command chains that execute multiple API steps safely and consistently.
The toolkit is designed for a productive programming workflow in Visual Studio and Visual Studio Code: strong typing, refactoring support, debugging, and source-controlled automation code. Visual Studio Code offers excellent GitHub Copilot support for fast iteration, while Visual Studio provides a more advanced debugging experience for complex flows.
SitecoreCommander provides a script-like automation approach in C#, with production-oriented engineering practices. It is well suited for multi-step and high-volume API workflows where reliability, diagnostics, and maintainability matter.
Typical workflow shape:
- Run one operation to discover context (for example sites/items/pages).
- Feed results into follow-up operations (update, move, publish, verify).
- Validate outcomes and rerun safely when needed.
It covers:
- Sitecore Agent API (REST)
- Sitecore Authoring API (GraphQL)
- Sitecore Edge API (GraphQL)
- Sitecore ItemService (REST)
- WordPress XML import and transformation helpers
- Optional Content Hub integration helpers (Content Hub API; service-based integration layer)
- Optional Bynder DAM integration helpers (Bynder API v4 REST)
- Not-from-scratch advantage: start from existing wrappers, examples, and operational patterns instead of rebuilding plumbing.
- Reliability for larger runs: designed for pagination, batch-oriented processing, and limit-aware API usage patterns.
- Better debugging and maintenance: C# tooling in Visual Studio and Visual Studio Code makes multi-step flows easier to inspect, refactor, and test, with the deepest debugger capabilities in Visual Studio.
- Safer automation: encourage explicit prechecks, controlled mutations, and explicit publish steps.
- AI-ready execution layer: AI can generate tasks quickly, while SitecoreCommander provides structure and guardrails for real execution.
A blank script can work for small one-off tasks, but larger Sitecore automation often fails on details such as pagination, query limits, inconsistent retry/error handling, and partial result interpretation.
SitecoreCommander reduces that risk by providing:
- Reusable API wrappers and examples.
- Repeatable workflow patterns for multi-step operations.
- A typed C# codebase that is easier to review and maintain over time.
- A stronger debugging experience than ad-hoc request collections.
SitecoreCommander works well with GitHub Copilot and other AI assistants when you want fast iteration without losing operational discipline.
Recommended flow:
- Ask AI to draft a workflow goal and required operations.
- Map each step to existing wrappers/examples.
- Add prechecks and rollback/compensation for mutating operations.
- Execute in controlled batches and validate output.
- Keep the result as reusable C# code in source control.
- Content migration and bulk content updates
- Automated creation, update, and deletion of items
- Publication and versioning workflows
- Repetitive maintenance and cleanup tasks
- Data import/export and system integration pipelines
This is an actively evolving toolkit. Some scenarios may require customization for your implementation model, templates, and governance rules. The codebase is intentionally extensible so you can adapt and grow it per project.
- Sitecore Authoring API (GraphQL)
- Sitecore Agent API (REST)
- Sitecore Edge API (GraphQL)
- Sitecore ItemService (REST)
- WordPress XML import helpers
- Optional Content Hub integration helpers (Content Hub API; service-based integration layer)
- Optional Bynder DAM integration helpers (Bynder API v4 REST)
README.md: product overview, setup, and quick operational guidance.AI/: human-facing playbooks, templates, and checklists for implementation and review..github/skills/: agent-invocable deep technical rules (placeholder/layout mechanics).Examples/: executable examples aligned with playbooks.
Start points:
AI/README.mdfor the documentation map..github/skills/sitecore-layout-xml/SKILL.mdfor layout XML and placeholder rules.
- Create or update local settings in
appsettings.Local.json. - Use
appsettings.example.jsonas a template. - Choose an authentication method:
- JWT client credentials (
JwtClientId+JwtClientSecret) - Sitecore CLI
user.json(XMCloudUserJsonPath)
- JWT client credentials (
- Run:
dotnet builddotnet run
SitecoreCommander examples support two authentication paths:
-
JWT(automation/client credentials)- Configure
SitecoreCommander:JwtClientIdandSitecoreCommander:JwtClientSecret. - Recommended for unattended automation and Agent API examples.
- Configure
-
Sitecore CLI user.json(developer context)- Configure
SitecoreCommander:XMCloudUserJsonPath. - Recommended for interactive Authoring/Edge work with your CLI session context.
- Configure
- Install Sitecore CLI (if not already installed):
dotnet tool install -g Sitecore.CLI
- Authenticate:
dotnet sitecore cloud login
- Confirm the file exists at:
%USERPROFILE%/.sitecore/user.json
- Point
SitecoreCommander:XMCloudUserJsonPathto that file.
appsettings.Local.json- Environment variables (if a key is not set in local settings)
appsettings.Local.jsonis intended for local values and should not be committed.- Publish operations should be executed explicitly; avoid automatic publish after write operations.
AI/AGENT_API_PLAYBOOK.mdAI/AGENT_PROMPT_TEMPLATE.mdAI/agent-api-index.jsonAI/README.mdAI/DOCUMENTATION-VALIDATION.md
If Authoring API search returns Solr schema/index errors, verify that the relevant index is populated and up to date.