xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField Sales & SFACRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
Auto DMSConsumer Goods DMSSales Force Automation (SFA) FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Developer/The xMatix CLI
OVERVIEW · Last reviewed

The xMatix CLI

xmatix is a single command-line tool that gives developers a git-friendly, round-trippable view of every customizable artifact in a tenant: automation scripts, business rules, workflows, dashboards, reports and metadata. Each artifact kind has pull and push verbs that write to and read from a canonical folder tree, so a tenant's configuration can live in a repository, travel through pull-request review, and be promoted by pipeline. It also builds and installs metadata packages. The CLI is an early (alpha) release; xmatix --version prints the version you have, and the pages in this section describe what that release does, including the places where it still falls short.

Before a CLI change, run xmatix doctor, pull the current tenant state, review the diff and preserve the server version or hash used for optimistic concurrency. After a push, verify the artifact's status and active version in its product workspace and inspect run history rather than assuming upload equals activation.

Install and first run

The CLI ships as a .NET global tool and runs anywhere the .NET 10 SDK does:

dotnet tool install -g xmatix.cli

xmatix init                       # scaffold the workspace in your repo root
xmatix login --tenant <tenant> \
  --api-base-url <api-url> --authority <authority-url> --client-id <client-id>
xmatix doctor                     # pre-flight checks
xmatix snapshot export --skip scripts,dashboards,reports
xmatix scripts pull --all         # scripts are pulled separately
git add xmatix/ && git commit -m "tenant snapshot"

init creates the .xmatix/ config directory and the folder tree; login runs a device-code sign-in and persists the connection settings (they are only needed once — see Authentication for where each value comes from); doctor verifies everything before you rely on it. The quickstart walks this first session end to end.

Command map

CommandWhat it doesReference
login / logout / whoamiDevice-code sign-in, cached-token cleanup, current identityAuthentication
init / doctorScaffold the workspace; run every pre-flight checkWorkspace layout
metadata pull / push / diffRound-trip tenant metadata seed-packsMetadata
scripts list / pull / push / run / logs, runs tailRound-trip automation scripts, test them, tail run historyScripts
rules list / pull / pushRound-trip business rules, one file per ruleBusiness rules
workflows list / pull / pushRound-trip workflow definitionsWorkflows
dashboards / reports list / pull / pushList analytics definitions (pull and push are refused by the server in the current release)Dashboards & reports
snapshot export / importPull or push every artifact kind in one commandSnapshots
migrate plan / applyDiff the repo against the live tenant; promote the reviewed stateMigrations
package init / build / validate / install / list / logs / uninstallAuthor, check, install, upgrade and remove metadata packages (manifest + seed-packs)Packages
watchAuto-push files as you save thembelow
completionsEmit a shell completion scriptbelow

Utilities

xmatix doctor

Runs every check the other commands assume: the workspace root resolves, config.json is readable and complete (authority, client id, scopes), the canonical folders exist (missing ones are noted as "created on first pull"), a token can be acquired silently, and a whoami round-trip against the API succeeds. Exit code 0 means healthy and 1 means at least one failure. In the current CLI release, two checks fail on a correct setup: api, because the CLI's identity call gets a 404, and scopes whenever scopes is left empty. So doctor exits 1 even when everything works. Read its token line rather than its exit code. Authentication explains both.

xmatix watch

Watches the round-trip folders and re-runs the matching push on every save — the tight loop for local development of scripts, rules and workflows:

xmatix watch                       # all artifact kinds
xmatix watch --no-rules --no-reports
xmatix watch --debounce 200

It watches .csx files under xmatix/automation/scripts/ and .json files under the rules, workflows, dashboards and reports folders, including subfolders. Each kind has a --<kind>/--no-<kind> switch (--no-scripts, --no-workflows, --no-dashboards, …) and all five are on by default. --debounce sets the quiet period in milliseconds — 400 by default, never less than 50 — so a burst of saves becomes one push per changed file. A folder that does not exist yet is listed as "not present, skipped"; if nothing is left to watch, the command stops with "Nothing to watch". Metadata files are not watched. Every save spawns a child xmatix … push process, so one failing push never tears the watcher down; child output is forwarded indented so the stream stays readable. Ctrl+C exits cleanly.

xmatix completions

Emits a static completion script for bash, zsh, fish or pwsh — for example xmatix completions zsh — which you redirect into your shell's completions location. The script is static, so completion never invokes the CLI at prompt time. Any other shell name is refused with "Unknown shell".

Permissions

The CLI acts as the signed-in user, so it can do only what that user can do in the product.

CommandsWhat the signed-in user needs
init, completions, package init, package buildNothing — they only touch local files
metadata …, package validate / install / list / logs / uninstall, and the metadata steps of snapshot and migrateThe Manage metadata packages capability (setup.metadata.packages.manage), the same one that opens Setup → Design Studio → Packages
scripts, rules, workflows, dashboards, reportsThe access each of those areas needs in the product — see its page

A refused call shows as a 403 in the command's failure message. Grant access through the user's security profile — see the security model.

Common questions

Is the CLI required to use automation scripts, rules or workflows?

No. Everything the CLI round-trips is fully authorable inside the product — the CLI's value is the representation: real files in a real repository, diffable in pull requests, promotable by pipeline, and editable in your own editor. Teams typically start in the product and adopt the CLI when a tenant's configuration becomes something they want to review and release like code.

What is safe to commit?

Everything the CLI writes except caches and tokens. The xmatix/ artifact tree and .xmatix/config.json are designed to be committed — the config file holds connection settings, never credentials. Sign-in tokens are cached per user in your home directory, encrypted by the operating system's credential store, and never land in the repository; init also writes a .gitignore inside .xmatix/ as a belt-and-braces guard.

Which platforms does it run on?

Anywhere the .NET 10 SDK runs — the token cache uses the platform's native secure storage on each OS (keychain on macOS, DPAPI on Windows, the keyring/secret service on Linux), so no platform needs special handling.