fobs stm rules
fobs stm rules <action> [target] [options]
| Action | Description |
|---|---|
list | List rules (sorted by priority ASC, created_at DESC by default) |
show <id> | Show one rule with conditions and actions |
preview <id> | Dry-run — see which transactions a rule would match, without applying it |
rules list
fobs stm rules list
fobs stm rules list --enabled true
fobs stm rules list --enabled false
fobs stm rules list --name salary
fobs stm rules list --condition-op equals,contains
fobs stm rules list --condition-field particulars,category
fobs stm rules list --action-field category
fobs stm rules list --sort-by name --sort-order desc
fobs stm rules list --fields id,name,priority,enabled,match_count,last_matched_at
fobs stm rules list --totals # count + enabled + disabled
# Export — auto-paginates up to 15000 rows.
# conditions/actions JSONB get JSON.stringify'd into CSV cells.
fobs stm rules list --format csv --output rules.csv
fobs stm rules list --format json --output rules.json
Flags
| Flag | Default | Description |
|---|---|---|
--enabled <bool> | — | true or false |
--name <text> | — | Case-insensitive substring match on rule name |
--condition-op <list> | — | Comma-separated operator names, OR-combined (e.g. equals,contains) |
--condition-field <list> | — | Comma-separated field names, OR-combined |
--action-field <list> | — | Comma-separated field names, OR-combined |
--sort-by <col> | priority | priority, name, or created_at |
--sort-order <dir> | ASC | ASC or DESC |
--fields <list> | default columns | Comma-separated field names |
--totals | — | Print total / enabled / disabled counts |
--page <n> / --limit <n> | 1 / 100 | Table paging only |
--format <fmt> / --output <path> | table / stdout | Export to CSV / JSON file |
JSONB filter combining. --condition-field and --action-field are each OR-combined internally; if you pass both together, the two groups are AND-combined with each other. --condition-op/--condition-field/--action-field values must be letters, numbers, or underscores only — matches List Rules API validation.
Default Columns
ID, NAME, PRIORITY, ENABLED, #COND, #ACT, MATCHES.
Available Fields
id, name, description, rationale, priority, enabled, conditions, actions, conditions_count, actions_count, match_count, last_matched_at, created_at, updated_at, cache.
Derived Columns
The CLI surfaces a few values computed from JSONB fields so you don't have to dig:
conditions_count/actions_count—r.conditions.length/r.actions.length.match_count/last_matched_at— pulled fromr.cache.match_count/r.cache.last_matched_at(the API maintains a per-rule match cache).
conditions and actions are available as columns too, but they're unwieldy in a table view. For the full JSONB shapes, use --format json or rules show.
rules show <id>
fobs stm rules show rule123
Pretty-prints the rule including conditions and actions as readable JSON.
rules preview <id>
fobs stm rules preview rule123 # Default: type='unknown' only, same scope as run
fobs stm rules preview rule123 --force-all # Preview against all matching transactions
fobs stm rules preview rule123 --page 2 --limit 50
Shows which transactions the rule would match — same matching logic as run, but read-only: no actions are applied and nothing is persisted. Sanity-check a rule before running it for real. Matches Preview Rule.
Related
- Rule Object — conditions, actions, operator reference
- Rules API — REST endpoints
- Categorization Rules guide — product-side overview
- Common Flags — flags that work across commands