> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-cloud/studio/command-templates/reference/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # Command reference > Rules, flags, severity levels, variables, and comparison operators for Command Templates in Itential Platform. A command template contains one or more commands, each with a set of rules that evaluate the device response. ## Pass logic ### Global command pass The dropdown at the top of the template controls whether all commands or just one command must pass. It applies the same pass logic as the per-command setting, but at the template level. | Option | Behavior | | :----------------------------------------- | :--------------------------------------------------- | | All commands must pass (default) | Every rule in every command must pass. | | All commands must pass (warn/info as pass) | No errors may be present in the template. | | One command must pass (default) | All rules in at least one command must pass. | | One command must pass (warn/info as pass) | At least one command with no errors must be present. | An optional **pass checkbox** ignores failures at warning or info severity. It is off by default. ![](/_fern-img/f02960d4a8fc72adc77ac05dd70894ec43209e7868a58eaf89eb9586792c61e4.webp) ### Global rules pass Each command has its own pass dropdown that applies pass logic at the command level. | Option | Behavior | | :------------------ | :------------------------------------------ | | All Rules must pass | Every rule in the command must pass. | | One Rule must pass | At least one rule in the command must pass. | ![](/_fern-img/ad1abda7002dcb39212dc79d2843943cca64f8ad9dfe0aff61d90bb40fbb07d4.webp) ## Rules ![](/_fern-img/3820a2819ce6ccb89c87a24c60a3892f5814e1fa2db791fe9700dfc17a5fc31e.webp) | Rule | Description | | :-----------: | :------------------------------------------------------------------------------------- | | `contains` | `true` if the device response contains the specified string. | | `!contains` | `true` if the device response does not contain the specified string. | | `contains1` | `true` if the device response contains exactly one occurrence of the specified string. | | `RegEx` | `true` if the device response matches the regular expression. | | `!RegEx` | `true` if the device response does not match the regular expression. | | `#comparison` | Compares two values, both of which may be extracted from the device response. | Every command may have one or more rules bound by a boolean **pass flag**: * Pass flag `true` (on) — AND logic: all rules must pass. * Pass flag `false` (off) — OR logic: at least one rule must pass. ## Flags ![](/_fern-img/9edad9a25883c301bccfab6b25a83419b55a68a9e2d8b337e0728f3e08241c85.webp) | Flag | Description | Supported by | | :--: | :------------------------------------------------------------------------- | :--------------------------------- | | `i` | Case-insensitive matching. | `contains`, `RegEx`, `#comparison` | | `g` | Global search; retains the index of the last match for iterative searches. | `RegEx`, `#comparison` | | `m` | Multi-line; `^` and `$` match the start and end of each line. | `RegEx`, `#comparison` | ![](/_fern-img/e1add22187654bc6ee6085b5c002d3264af4d27883263bc5193e9af2f0d58a27.webp)![](/_fern-img/6662ac3c2c5ff6e5cfcc3b2195846077f71786e7b56278953946238b22c198c5.webp) ## Severity Severity applies only when a rule has failed. The default is `error`. ![](/_fern-img/5a1c1a89b1365148140c121d15e5c86a4f1ec0a7c447e769e6af2519a441ea37.webp) | Level | Meaning | | :-------: | :--------------------------------------------------------------- | | `error` | Something is wrong; a specific action may need to be taken. | | `warning` | Something to be aware of that could potentially cause a problem. | | `info` | Informational; no action required. | ## Variables Use the following syntax to include a variable in a command: ``` ``` Supported types: string, number, boolean, array of strings, array of numbers, and array of booleans. When an array is passed, the command runs once per element. Arrays of objects are not supported. ## Comparison rules The `contains` and `RegEx` rules match (or exclude) a string or pattern in the device response. The `#comparison` rule extracts and compares two values. | Rule | Match type | Returns | Flags | | :------------ | :------------------: | :------------------------------------------------------ | :------------ | | `contains` | String | `true` if the response contains the value. | `i` | | `!contains` | String | `true` if the response does not contain the value. | `i` | | `contains1` | String | `true` if the response contains exactly one occurrence. | `i` | | `RegEx` | Regular expression | `true` if the response matches. | `i`, `g`, `m` | | `!RegEx` | Regular expression | `true` if the response does not match. | `i`, `g`, `m` | | `#comparison` | Two extracted values | Defined by the comparison operator. | — | ### Top operand The top operand uses a regular expression with a capture group to extract a value from the command output. * Surround the expression with `/` characters: `/Total System Memory:\s+(\d+) MB/` * The capture group (in parentheses) defines the value to compare. Only one capture group is supported. ### Bottom operand The bottom operand is one of: * A static value * A command template variable (e.g., ``) * A regular expression with a capture group matching part of the command output ### Comparison operators | Operator | Type | Returns | | :------: | :----: | :---------------------------------------------------------------------------------------------------- | | `=` | String | `true` if the operands are equal. | | `!=` | String | `true` if the operands are not equal. | | `<` | Number | `true` if the top operand is less than the bottom. | | `<=` | Number | `true` if the top operand is less than or equal to the bottom. | | `>` | Number | `true` if the top operand is greater than the bottom. | | `>=` | Number | `true` if the top operand is greater than or equal to the bottom. | | `%` | Number | Calculates `100 × (bottom / top)` and returns `true` if the result is ≤ the **Max accepted %** value. | > Rules, flags, severity levels, variables, and comparison operators for Command Templates in Itential Platform.