/rewst:rewst <command> [args] | install cli|mcpfrom rewst
Provides typed commands for Rewst entities (workflows, executions, variables, packs, triggers, forms) plus multi-org rollups for fleet health, ROI, drift, and coverage. Requires rewst-cli.
Ships in rewst. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill drives the rewst-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
bash <(curl -fsSL https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/rewst/install.sh)
iwr -useb https://raw.githubusercontent.com/Servosity/msp-skills/main/skills/rewst/install.ps1 | iex
rewst-cli --version~/.local/bin (macOS / Linux) or %LOCALAPPDATA%\Programs\msp-skills (Windows) is on $PATH.The installer downloads the rewst-cli and rewst-mcp binaries into ~/.local/bin
(macOS / Linux) or %LOCALAPPDATA%\Programs\msp-skills (Windows). It does not
register the skill with your agent and writes no MCP client config - see
mcp-install.md for that wire-up.
If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.
Rewst's only surface is a GraphQL gateway with no first-party CLI and no local state. This CLI mirrors organizations, workflows, executions, variables, packs, triggers, forms, and the rest as typed commands with --json/--select/--agent output, the api command that lists every GraphQL interface and method, and offline SQLite sync. On top of that it adds multi-org rollups - fleet execution health, failure triage, automation ROI, dormant-workflow detection, cross-org config drift, and pack coverage - that an MSP operator otherwise has to assemble by clicking through the web app one client at a time.
Use this CLI to operate and monitor Rewst from the terminal or an agent: check whether automation is healthy for a client, triage failed runs, report how much time automation saved, find dormant workflows, compare configuration between tenants, and read or run any Rewst entity. It is the right tool when you want scriptable, JSON-first access to Rewst across many client organizations rather than clicking through the web console one org at a time.
Do not use this CLI for:
health - One-call workflow execution health for an org: succeeded / failed / running / pending counts plus time saved, with a clear unhealthy verdict when failures are present.
Reach for this first to answer 'is automation healthy for this client right now' without paging through the web app org by org.
rewst-cli health --org 11111111-1111-1111-1111-111111111111 --since 24h --agent
failures - Recent failed workflow executions for an org, newest first, with workflow id, status, task counts, and age - the triage queue the API has no single endpoint for.
Use this when something broke overnight and you need the failed runs to investigate, not every run.
rewst-cli failures --org 11111111-1111-1111-1111-111111111111 --since 12h --limit 20 --agent
dormant - Workflows that have not executed in N days - dead or orphaned automation that is still installed but no longer running.
Use this to clean up or re-enable automation that quietly went idle after a trigger or integration broke.
rewst-cli dormant --org 11111111-1111-1111-1111-111111111111 --days 30 --agent
orgs - The token's own organization and every organization it manages (id, name, managing org, enabled), sorted by name: the ids health, failures, roi, dormant, drift and coverage take.
Run it first: every other rollup needs an --org or --parent id, and without it an operator copies ids out of the web console one client at a time.
rewst-cli orgs --agent
roi - Aggregates Rewst's humanSecondsSaved metric across an org's workflows into total hours/days saved and the top time-saving automations.
Reach for this to turn automation into a dollar/time story for a QBR or client report.
rewst-cli roi --org 11111111-1111-1111-1111-111111111111 --since 30d --agent
drift - Compares org variables and installed packs between two organizations and reports what one has that the other is missing.
Reach for this when an automation works in one tenant but not another and you suspect a missing variable or uninstalled pack.
rewst-cli drift --org 11111111-1111-1111-1111-111111111111 --against 22222222-2222-2222-2222-222222222222 --agent
coverage - Across a parent org's managed sub-orgs, shows which integration packs are installed where and flags orgs missing a pack - bounded by a scan cap.
Use this to confirm an integration is rolled out to every client tenant, or to find the ones it skipped.
rewst-cli coverage --parent 11111111-1111-1111-1111-111111111111 --pack microsoft --agent
Known limitation of this build: the typed entity commands below are generated as REST-shaped calls the Rewst GraphQL gateway refuses, so they fail with an HTTP 400 or a GraphQL error; a refused or errored answer is a failure, never empty data. The commands that reach Rewst are
orgs,health,failures,roi,dormant,drift,coverageanddoctor: use them.
action-options - Manage action-options
rewst-cli action-options create - Create a actionoptionrewst-cli action-options get - Get a single actionoptionactions - Manage actions
rewst-cli actions create - Create a actionrewst-cli actions get - Get a single actionactive-conversation-requests - Manage active-conversation-requests
rewst-cli active-conversation-requests - Get a single activeconversationrequestaffected-workflow-infos - Manage affected-workflow-infos
rewst-cli affected-workflow-infos - Get a single affectedworkflowinfoapi-client-lists - Manage api-client-lists
rewst-cli api-client-lists - Get a single apiclientlistapi-clients - Manage api-clients
rewst-cli api-clients <id> - Get a single apiclientapp-platform-reserved-domains - Manage app-platform-reserved-domains
rewst-cli app-platform-reserved-domains create - Create a appplatformreserveddomainrewst-cli app-platform-reserved-domains get - Get a single appplatformreserveddomainrewst-cli app-platform-reserved-domains update - Update a appplatformreserveddomaincommonly-used-actions - Manage commonly-used-actions
rewst-cli commonly-used-actions - Get a single commonlyusedactioncomponent-instances - Manage component-instances
rewst-cli component-instances create - Create a componentinstancerewst-cli component-instances get - Get a single componentinstancerewst-cli component-instances update - Update a componentinstancecomponent-trees - Manage component-trees
rewst-cli component-trees - Get a single componenttreecomponents - Manage components
rewst-cli components - Get a single componentconversation-message-votes - Manage conversation-message-votes
rewst-cli conversation-message-votes create - Create a conversationmessagevoterewst-cli conversation-message-votes get - Get a single conversationmessagevoterewst-cli conversation-message-votes update - Update a conversationmessagevoteconversation-messages - Manage conversation-messages
rewst-cli conversation-messages - Create a conversationmessageconversations - Manage conversations
rewst-cli conversations create - Create a conversationrewst-cli conversations get - Get a single conversationrewst-cli conversations update - Update a conversationcrate-override-options - Manage crate-override-options
rewst-cli crate-override-options create - Create a crateoverrideoptionrewst-cli crate-override-options update - Update a crateoverrideoptioncrate-overrides - Manage crate-overrides
rewst-cli crate-overrides create - Create a crateoverriderewst-cli crate-overrides update - Update a crateoverridecrate-unpacking-argument-sets - Manage crate-unpacking-argument-sets
rewst-cli crate-unpacking-argument-sets - Get a single crateunpackingargumentsetcrate-use-cases - Manage crate-use-cases
rewst-cli crate-use-cases - Get a single crateusecasecrates - Manage crates
rewst-cli crates create - Create a craterewst-cli crates get - Get a single craterewst-cli crates update - Update a cratedatabase-notification-errors - Manage database-notification-errors
rewst-cli database-notification-errors - Get a single databasenotificationerrordelete-org-interpreter-responses - Manage delete-org-interpreter-responses
rewst-cli delete-org-interpreter-responses <id> - Delete a deleteorginterpreterresponsedropdown-options - Manage dropdown-options
rewst-cli dropdown-options - Get a single dropdownoptionencoded-page-nodeses - Manage encoded-page-nodeses
rewst-cli encoded-page-nodeses <id> - Get a single encodedpagenodesfeature-preview-settings - Manage feature-preview-settings
rewst-cli feature-preview-settings create - Create a featurepreviewsettingrewst-cli feature-preview-settings get - Get a single featurepreviewsettingrewst-cli feature-preview-settings update - Update a featurepreviewsettingforeign-object-references - Manage foreign-object-references
rewst-cli foreign-object-references - Get a single foreignobjectreferenceform-audit-entries - Manage form-audit-entries
rewst-cli form-audit-entries - Get a single formauditentryform-permission-states - Manage form-permission-states
rewst-cli form-permission-states - Get a single formpermissionstateforms - Manage forms
rewst-cli forms create - Create a formrewst-cli forms get - Get a single formrewst-cli forms update - Update a formintegration-workflow-outputs - Manage integration-workflow-outputs
rewst-cli integration-workflow-outputs - Create a integrationworkflowoutputintegrations - Manage integrations
rewst-cli integrations - Get a single integrationinterpreter-versions - Manage interpreter-versions
rewst-cli interpreter-versions - Get a single interpreterversionjinja-render-sessions - Manage jinja-render-sessions
rewst-cli jinja-render-sessions <id> - Get a single jinjarendersessionjinja2-documentations - Manage jinja2-documentations
rewst-cli jinja2-documentations - Get a single jinja2documentationjob-requested-responses - Manage job-requested-responses
rewst-cli job-requested-responses - Create a jobrequestedresponselogins - Manage logins
rewst-cli logins - Get a single loginmessage-vote-statses - Manage message-vote-statses
rewst-cli message-vote-statses - Get a single messagevotestatsmicrosoft-c-s-p-customers - Manage microsoft-c-s-p-customers
rewst-cli microsoft-c-s-p-customers - Get a single microsoftcspcustomermonaco-completion-items - Manage monaco-completion-items
rewst-cli monaco-completion-items - Get a single monacocompletionitemonboarding-questionnaire-responses - Manage onboarding-questionnaire-responses
rewst-cli onboarding-questionnaire-responses create - Create a onboardingquestionnaireresponserewst-cli onboarding-questionnaire-responses get - Get a single onboardingquestionnaireresponseorg-breadcrumbs - Manage org-breadcrumbs
rewst-cli org-breadcrumbs - Get a single orgbreadcrumborg-form-field-instances - Manage org-form-field-instances
rewst-cli org-form-field-instances - Get a single orgformfieldinstanceorg-interpreter-settings - Manage org-interpreter-settings
rewst-cli org-interpreter-settings - Get a single orginterpretersettingorg-search-results - Manage org-search-results
rewst-cli org-search-results - Get a single orgsearchresultorg-support-accesses - Manage org-support-accesses
rewst-cli org-support-accesses - Create a orgsupportaccessorg-trigger-instances - Manage org-trigger-instances
rewst-cli org-trigger-instances get - Get a single orgtriggerinstancerewst-cli org-trigger-instances update - Update a orgtriggerinstanceorg-variables - Manage org-variables
rewst-cli org-variables create - Create a orgvariablerewst-cli org-variables get - Get a single orgvariablerewst-cli org-variables update - Update a orgvariableorganization-audit-entries - Manage organization-audit-entries
rewst-cli organization-audit-entries - Get a single organizationauditentryorganization-imports - Manage organization-imports
rewst-cli organization-imports - Get a single organizationimportorganization-onboarding-crate-requirements - Manage organization-onboarding-crate-requirements
rewst-cli organization-onboarding-crate-requirements - Get a single organizationonboardingcraterequirementorganization-onboarding-pack-requirements - Manage organization-onboarding-pack-requirements
rewst-cli organization-onboarding-pack-requirements - Get a single organizationonboardingpackrequirementorganization-onboarding-requirements - Manage organization-onboarding-requirements
rewst-cli organization-onboarding-requirements create - Create a organizationonboardingrequirementrewst-cli organization-onboarding-requirements get - Get a single organizationonboardingrequirementorganizations - Manage organizations
rewst-cli organizations create - Create a organizationrewst-cli organizations get - Get a single organizationrewst-cli organizations update - Update a organizationpack-action-options - Manage pack-action-options
rewst-cli pack-action-options - Get a single packactionoptionpack-bundles - Manage pack-bundles
rewst-cli pack-bundles - Get a single packbundlepack-configs - Manage pack-configs
rewst-cli pack-configs create - Create a packconfigrewst-cli pack-configs get - Get a single packconfigrewst-cli pack-configs update - Update a packconfigpack-delete-responses - Manage pack-delete-responses
rewst-cli pack-delete-responses - Delete a packdeleteresponsepack-resource-types-containers - Manage pack-resource-types-containers
rewst-cli pack-resource-types-containers - Get a single packresourcetypescontainerpacks - Manage packs
rewst-cli packs create - Create a packrewst-cli packs get - Get a single packrewst-cli packs update - Update a packpacks-and-bundles-by-installed-states - Manage packs-and-bundles-by-installed-states
rewst-cli packs-and-bundles-by-installed-states - Get a single packsandbundlesbyinstalledstatepage-nodes - Manage page-nodes
rewst-cli page-nodes - Get a single pagenodepages - Manage pages
rewst-cli pages create - Create a pagerewst-cli pages get - Get a single pagerewst-cli pages update - Update a pagepending-tasks-aggregates - Manage pending-tasks-aggregates
rewst-cli pending-tasks-aggregates - Get a single pendingtasksaggregatepermission-audit-log-lists - Manage permission-audit-log-lists
rewst-cli permission-audit-log-lists - Get a single permissionauditloglistpermissions - Manage permissions
rewst-cli permissions create - Create a permissionrewst-cli permissions get - Get a single permissionrewst-cli permissions update - Update a permissionpsa-filter-optionses - Manage psa-filter-optionses
rewst-cli psa-filter-optionses - Get a single psafilteroptionspsa-organizations - Manage psa-organizations
rewst-cli psa-organizations - Get a single psaorganizationpublic-crates - Manage public-crates
rewst-cli public-crates - Get a single publiccratereserved-organization-names - Manage reserved-organization-names
rewst-cli reserved-organization-names - Get a single reservedorganizationnamerobo-rewsty-config-values - Manage robo-rewsty-config-values
rewst-cli robo-rewsty-config-values - Get a single roborewstyconfigvaluerole-organization-counts - Manage role-organization-counts
rewst-cli role-organization-counts - Get a single roleorganizationcountrole-organization-rows - Manage role-organization-rows
rewst-cli role-organization-rows - Get a single roleorganizationrowrole-user-counts - Manage role-user-counts
rewst-cli role-user-counts - Get a single roleusercountroles - Manage roles
rewst-cli roles create - Create a rolerewst-cli roles get - Get a single rolerewst-cli roles update - Update a rolesensor-types - Manage sensor-types
rewst-cli sensor-types - Get a single sensortypesite-domain-valids - Manage site-domain-valids
rewst-cli site-domain-valids - Get a single sitedomainvalidsites - Manage sites
rewst-cli sites create - Create a siterewst-cli sites get - Get a single siterewst-cli sites update - Update a sitespice-d-b-check-results - Manage spice-d-b-check-results
rewst-cli spice-d-b-check-results - Get a single spicedbcheckresulttags - Manage tags
rewst-cli tags create - Create a tagrewst-cli tags get - Get a single tagrewst-cli tags update - Update a tagtask-count-by-dates - Manage task-count-by-dates
rewst-cli task-count-by-dates - Get a single taskcountbydatetask-count-by-hours - Manage task-count-by-hours
rewst-cli task-count-by-hours - Get a single taskcountbyhourtask-logs - Manage task-logs
rewst-cli task-logs create - Create a tasklogrewst-cli task-logs get - Get a single tasklogtemplates - Manage templates
rewst-cli templates create - Create a templaterewst-cli templates get - Get a single templaterewst-cli templates update - Update a templatetime-saved-by-dates - Manage time-saved-by-dates
rewst-cli time-saved-by-dates - Get a single timesavedbydatetime-saved-by-hours - Manage time-saved-by-hours
rewst-cli time-saved-by-hours - Get a single timesavedbyhourtime-saved-group-by-orgs - Manage time-saved-group-by-orgs
rewst-cli time-saved-group-by-orgs - Get a single timesavedgroupbyorgtime-saved-group-by-workflows - Manage time-saved-group-by-workflows
rewst-cli time-saved-group-by-workflows - Get a single timesavedgroupbyworkflowtrigger-types - Manage trigger-types
rewst-cli trigger-types - Get a single triggertypetriggers - Manage triggers
rewst-cli triggers create - Create a triggerrewst-cli triggers get - Get a single triggerrewst-cli triggers update - Update a triggeruser-delegated-accesses - Manage user-delegated-accesses
rewst-cli user-delegated-accesses - Get a single userdelegatedaccessuser-favorite-actions - Manage user-favorite-actions
rewst-cli user-favorite-actions create - Create a userfavoriteactionrewst-cli user-favorite-actions update - Update a userfavoriteactionuser-invites - Manage user-invites
rewst-cli user-invites create - Create a userinviterewst-cli user-invites get - Get a single userinviteuser-preferenceses - Manage user-preferenceses
rewst-cli user-preferenceses - Update a userpreferencesuser-robo-rewsty-preferenceses - Manage user-robo-rewsty-preferenceses
rewst-cli user-robo-rewsty-preferenceses get - Get a single userroborewstypreferencesrewst-cli user-robo-rewsty-preferenceses update - Update a userroborewstypreferencesusers - Manage users
rewst-cli users create - Create a userrewst-cli users get - Get a single userrewst-cli users update - Update a userworkflow-execution-statses - Manage workflow-execution-statses
rewst-cli workflow-execution-statses - Get a single workflowexecutionstatsworkflow-executions - Manage workflow-executions
rewst-cli workflow-executions - Get a single workflowexecutionworkflow-notes - Manage workflow-notes
rewst-cli workflow-notes - Get a single workflownoteworkflow-patches - Manage workflow-patches
rewst-cli workflow-patches - Get a single workflowpatchworkflow-stats-by-orgs - Manage workflow-stats-by-orgs
rewst-cli workflow-stats-by-orgs - Get a single workflowstatsbyorgworkflow-tasks - Manage workflow-tasks
rewst-cli workflow-tasks - Get a single workflowtaskworkflows - Manage workflows
rewst-cli workflows create - Create a workflowrewst-cli workflows get - Get a single workflowrewst-cli workflows update - Update a workflowcoverage
rewst-cli coverage - Across a parent org's managed sub-orgs, shows which integration packs are installed where and flags orgs missing a pack - bounded by a scan cap.dormant
rewst-cli dormant - Workflows that have not executed in N days - dead or orphaned automation that is still installed but no longer running.drift
rewst-cli drift - Compares org variables and installed packs between two organizations and reports what one has that the other is missing.failures
rewst-cli failures - Recent failed workflow executions for an org, newest first, with workflow id, status, task counts, and age - the triage queue the API has no single endpoint for.health
rewst-cli health - One-call workflow execution health for an org: succeeded / failed / running / pending counts plus time saved, with a clear unhealthy verdict when failures are present.roi
rewst-cli roi - Aggregates Rewst's humanSecondsSaved metric across an org's workflows into total hours/days saved and the top time-saving automations.When you know what you want to do but not which command does it, ask the CLI directly:
rewst-cli which "<capability in your own words>"
which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match - fall back to --help or use a narrower query. --json (and other machine formats) keep that exit-2 contract and write {"matches":[]} on stdout so agents can inspect the envelope without treating a miss as success.
rewst-cli health --org YOUR_ORG_ID --since 24h --agent
Single-call health verdict (succeeded/failed/running plus time saved) to start the day.
rewst-cli failures --org YOUR_ORG_ID --since 12h --limit 25 --agent
List just the failed executions, newest first, to investigate what broke.
rewst-cli orgs --agent --select managed_orgs.id,managed_orgs.name
One GraphQL read of the token's organization and every org it manages; feed the ids to --org (health, failures, roi, dormant, drift) or --parent (coverage).
rewst-cli roi --org YOUR_ORG_ID --since 30d --agent
Roll up humanSecondsSaved into hours/days saved and the top time-saving workflows for a client report.
rewst-cli drift --org TENANT_A --against TENANT_B --agent
Diff org variables and installed packs to explain why automation works in one tenant but not the other.
Rewst authenticates with a per-organization API client token sent as Authorization: Bearer <token>. Mint a token in the Rewst platform under Configuration > API Clients, then export it as REWST_API_TOKEN (or run rewst-cli auth set-token). The token is org-scoped, so most commands take an --org id for the tenant you are operating on.
Run rewst-cli doctor to verify setup.
Authorization: Bearer <REWST_API_TOKEN>) and every API request go only to the scheme, host and port of the configured base URL (https://api.rewst.io, or REWST_BASE_URL for the EU and AU regions; every operation is POST /graphql there). A redirect to any other host is refused, so the token never reaches it.REWST_API_TOKEN, the stored token, or a credential a response carries (an API client's auth0ClientSecret and auth0ClientId, a third-party login token, an integration secret inside a pack config) is replaced by [credkit: withheld from <where>: it carried a credential this program holds], in plain text and in the encodings the shared credential kit decodes. Responses are never cached on disk.--stdin body is held whole, so a write's answer that repeats part of the body prints that notice too.secret prints as Rewst returns it. Treat org-variables output as sensitive.credentials.toml (mode 0600) holds a credential; auth set-token reads the token from stdin, never from an argument.errors member is reported as a failure, never as empty data.--dry-run sends nothing. Over MCP, rewst_execute (every Rewst operation that changes something), import and jobs_prune return a preview and send only with confirm: true, and a tool argument can never name a file to read or write.Add --agent to any command. Expands to: --json --compact --no-input --no-color.
Global format flags share one contract on promoted, novel, sync, and --deliver paths:
--json - one JSON document on stdout (sync progress events go to stderr)
--compact - keep identity/status/timestamp fields; does not change the document vs stream shape
--csv / --plain - tabular rows (collection envelopes unwrap to the row array). --csv prefixes ' on a cell or header key that starts with =, +, -, @, tab, CR, or LF (fullwidth =+-@ too) so a spreadsheet does not run it as a formula; a plain signed number such as -5 or +2.5e3 is unchanged.
--quiet - one identity value per row, no envelope
Pipeable - JSON on stdout, errors on stderr
Filterable - --select keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
rewst-cli action-options get --agent --select actions,id,optionLabel
Previewable - --dry-run shows the request without sending
Offline-friendly - sync/search commands can use the local SQLite store when available
Non-interactive - never prompts, every input is a flag
Explicit confirmation - --agent does not imply --yes; pass --yes separately only after the target, arguments, and side effects are clear
Explicit retries - use --idempotent only when an already-existing create should count as success, and use --ignore-missing only when a missing delete target should count as success
Commands that read from the local store or the API wrap output in a provenance envelope:
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}
Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set - piped/agent consumers and explicit-format runs get pure JSON on stdout.
Agents should treat the CLI's path resolver as part of the runtime contract:
Use --home <dir> for one invocation, or set REWST_HOME=<dir> to relocate all four path kinds under one root.
Use per-kind env vars only when a specific kind must diverge: REWST_CONFIG_DIR, REWST_DATA_DIR, REWST_STATE_DIR, REWST_CACHE_DIR.
Resolution order is per-kind env var, --home, REWST_HOME, XDG (XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME), then platform defaults.
config contains settings like config.toml and profiles. data contains credentials.toml, data.db, cookies, and auth sidecars. state contains persisted queries, jobs, and teach.log. cache contains regenerable HTTP/cache files.
Stored secrets live in credentials.toml under the data dir. Existing legacy config.toml secrets are read for compatibility and leave config.toml on the first auth write.
Run rewst-cli doctor --fail-on warn to surface path and credential-location warnings. agent-context exposes a schema v4 paths block for agents that need the resolved dirs.
For MCP, pass relocation through the MCP host config. The MCP binary does not inherit CLI flags:
{
"mcpServers": {
"rewst": {
"command": "rewst-mcp",
"env": {
"REWST_HOME": "/srv/rewst"
}
}
}
}
Fleet precedence: an inherited per-kind env var overrides an explicit --home for that kind. Use REWST_HOME or per-kind vars as durable fleet levers, and use --home only for a single invocation. Relocation is not reversible by unsetting env vars; move files manually before clearing REWST_HOME, or doctor will not find credentials left under the former root.
Local data is unencrypted and relies on OS account permissions plus disk encryption. Reads in the default --data-source auto mode are written to the SQLite store; GET responses are never cached on disk. local-data purge previews what it would erase (store files, response cache, learn journal) and deletes only with --yes; it is not exposed over MCP. REWST_NO_LOCAL_DATA=1 disables the response cache and store writes, turns auto reads into live reads, and blocks sync and workflow archive; --data-source local still reads an existing store, and REWST_DATA_SOURCE sets the --data-source default.
This CLI ships a self-capturing learning loop. The CLI does its own bookkeeping: every invocation is journaled locally, a failed flag followed by a corrected retry auto-derives a flag_alias candidate, and a teach on a query family without a playbook auto-synthesizes a playbook_candidate from the session's journal. Your job is judgment only: recall first, act on surfaced candidates, teach the final answer, playbook amend when you observe a correction. You never record failures by hand.
recall before any discoveryBefore list/search/drill commands on a new user question, pass the question as an argv or MCP tool argument to recall --agent. Do not interpolate user-controlled text into a shell command line.
Quoted recall "<question>" breaks on an apostrophe, which is ordinary English. A quoted heredoc breaks when a body line equals the delimiter, and that delimiter is published in these docs. Write the question with a non-shell file-writing tool, then read it back as data:
# Write the question verbatim with your file-writing tool (no shell involved).
# Command substitution on a file only ever yields data - the shell never
# parses the file's bytes as syntax.
QUERY=$(cat /path/to/question.txt)
rewst-cli recall "$QUERY" --agent
Prefer MCP: pass the question as the tool's query argument. "$QUERY" after a file read is argv-safe; putting the question itself in the command text is not.
The response envelope:
{
"query": "...",
"normalized": "<normalized form>",
"query_entities": ["..."],
"found": true | false,
"match_score": 0.0,
"results": [
{ "resource_id": "...", "resource_type": "...", "venue": "...",
"confidence": 2, "entity_match": "exact|partial|unknown",
"source": "taught|preseed|pattern", "warnings": ["..."] }
],
"mismatches": [ /* only when --debug-mismatches */ ],
"warnings": [ /* top-level */ ],
"candidates": [
{ "id": 12, "class": "flag_alias | playbook_candidate",
"summary": "...", "sightings": 3, "last_seen": "...",
"rationale": "...",
"next_action": ["<trial command>", "rewst-cli learnings confirm 12"] }
],
"playbook": {
"query_family": "...",
"playbook": {
"steps": [ { "cmd": "<command with {slot} substitution>", "purpose": "..." } ],
"entity_slots": ["$ENTITY"],
"expected_tool_calls": 3
},
"slots_resolved": { "$ENTITY": { "token": "<live token>", "canonical": "<canonical>" } },
"notes": "<workarounds + gotchas for this query family>"
},
"notes": "<duplicate surface for non-playbook callers>"
}
Empty-store short-circuit: if the store has no learnings, playbooks, or candidates yet (recall finds nothing and learnings list and learnings candidates are both empty), skip recall for the rest of this session instead of taxing every query; resume recall-first once something has been taught.
Read candidates, playbook, notes, results[0], and warnings in that order:
if Candidates present (warnings include "candidates_present"):
-> candidates are try-then-confirm, never facts. Follow each candidate's
two-step next_action verbatim: run the trial command first, then run
`learnings confirm <id>` only after the trial verified the behavior.
Reject a wrong candidate with `learnings reject <id>`.
-> NEVER re-teach something recall surfaced as a candidate; confirm or
reject that candidate instead of teaching a duplicate.
-> candidates ride alongside playbooks and resource hits, not instead of
them; continue with the branches below after acting on them.
if Playbook present:
-> READ Playbook.notes verbatim FIRST (workarounds + gotchas the CLI surface doesn't expose)
-> replay Playbook.steps in order, substituting Playbook.slots_resolved entries
for the entity slot tokens. If a step's slot is unresolved, fall back to
discovery for that step only.
-> the Playbook's expected_tool_calls is a budget; if you find yourself running
materially more, record the divergence via `rewst-cli playbook amend`
at end-of-session.
elif Notes present (no Playbook):
-> read Notes verbatim before any discovery step; they carry known gotchas
for this query family even when no structured choreography exists yet.
elif Found AND Results[0].EntityMatch == "exact" AND Results[0].Confidence >= 2:
-> skip discovery; fetch live data for Results[*].ResourceID in parallel
elif Found AND Results[0].EntityMatch == "partial":
-> candidate hint, NOT a hit; read the resource title to validate before trusting
elif (any row in Mismatches[] when --debug-mismatches was passed):
-> treat as cold start; the stored learning is for a different entity
(different canonical resolved from query_entities)
else: // Found == false, no playbook, no notes
-> cold start; run discovery normally; teach the answer afterward (Step 4).
If the family has no playbook yet, that teach auto-synthesizes a
playbook candidate from this session's journal - you do not need to
record one by hand.
Playbook and Notes are orthogonal to the per-resource path. A recall response can carry both a Playbook AND a Results[] hit - use both: the Playbook tells you which choreography to run; the resource hits short-circuit specific steps. Default to skipping mismatches; pass --debug-mismatches only when investigating cold-start surprises.
Candidate judgment details: learnings confirm <id> prints the candidate's full payload before materializing it - check that the printed payload matches the behavior you verified. learnings reject <id> tombstones the derivation signature so the same candidate does not resurface. The envelope carries only the few candidates worth acting on now; rewst-cli learnings candidates lists the full open set.
Graceful degradation: if learnings confirm is an unknown command, you are driving an older binary - ignore the candidates guidance and follow the rest of the protocol.
warningslow_confidence: row exists at confidence<2. Treat as a hint, not a skip-discovery hit.resource_not_in_store: the local store doesn't have the resource the learning points at. The match validator couldn't classify entities - direct-fetch and re-evaluate.cross_alias_match (per-result): the row was taught under a different alias and matched the live query's canonical via entity_lookups (e.g., a "USA" teach satisfying a "United States" recall). Trust the resource_id.similar_shape_different_entity:<canonical> (top-level): a structurally matching row exists but its canonical entity differs from the live query's. Treated as cold start; the warning carries the conflicting canonical as a hint, but the row is NOT promoted into Results.ambiguous_alias (top-level): a single query entity resolved to multiple canonicals (e.g., "Cards" → Arizona Cardinals + St. Louis Cardinals). Surface the ambiguity from context before committing to a resource.candidates_present (top-level): the envelope carries a candidates section. Handle it via the candidates branch in Step 2 before anything else.lookup_refresh_available (top-level): an entity in the query has no lookup row yet, but synced data could provide one. Run rewst-cli sync to refresh entity lookups.no_learnings_for_query_family: the table had no rows above the Jaccard floor. Pure cold start.teach & after finalizing your response - alwaysTeaching is unconditional. After resolving a query the store could not answer, background-teach the final resource mapping - no call-count threshold, no judging whether it was "worth" learning. The teach is the anchor of the loop: it triggers playbook synthesis for a family without a playbook, and same-referent phrasings fold into one family so near-duplicate teaches do not fragment the store. Fire it after assembling your user-facing response but BEFORE emitting it, with a shell & so the call returns immediately. Pass the query the same way as recall - argv/MCP, or file-then-$QUERY. Do not splice the question into the command text:
QUERY=$(cat /path/to/question.txt)
rewst-cli teach --query "$QUERY" --resource-type <type> --resource <id1> --resource <id2>
# (append shell `&` to background it)
Silent on success. Errors only land in teach.log under the resolved state dir. Teach the most specific resource - if the user asked a broad question and you walked through parent records to find the specific answer, teach the leaf id, not the parent. The CLI uses seeded entity_lookups for cross-alias resolution at recall time, so a teach under one alias (e.g., "Niners") satisfies future queries under another alias (e.g., "49ers", "San Francisco") automatically.
PII rule: teach the structural question with identifiers stripped - never include names, emails, phone numbers, account ids, or other personal identifiers in taught queries or notes. The CLI scans teach queries for obvious email/phone shapes and warns, but does not block; strip before teaching rather than relying on the warning.
You do not need to decide whether a session "deserves" a playbook: a teach on a family without one auto-synthesizes a playbook_candidate from the session's journal, and the next session judges it via confirm/reject. Attach explicit playbook flags only when you already hold choreography worth recording verbatim - workarounds the CLI didn't surface (silently-dropped flags, undocumented params, pagination tricks, payload gotchas). Prefer the integrated one-call form - record the resource learning and the playbook in the same teach invocation:
# Common case: record both the resource learning AND the playbook in one call.
QUERY=$(cat /path/to/question.txt)
rewst-cli teach \
--query "$QUERY" \
--resource <id> \
--playbook-file ~/playbooks/<shape>.json \
--playbook-notes-file ~/playbooks/<shape>-notes.md
# (append shell `&` to background it)
# Alternate: playbook-only (no resource to record alongside).
QUERY=$(cat /path/to/question.txt)
rewst-cli teach-playbook \
--query "$QUERY" \
--playbook-file ~/playbooks/<shape>.json \
--notes-file ~/playbooks/<shape>-notes.md
Playbook files are JSON with steps, entity_slots, expected_tool_calls. Notes files are markdown carrying the gotchas verbatim. File-free callers (MCP-only agents) pass the same content inline: --playbook-json and --playbook-notes on the integrated teach form, --playbook-json and --notes on teach-playbook. On the integrated teach form, the playbook flags are optional - omit them entirely for a resource-only teach. On the standalone teach-playbook form, at least one of the playbook and notes flags must be set; both empty is rejected. Playbooks are keyed on the structural query family (entities stripped) so a recipe taught from one entity-shaped query applies to every other query of the same shape, with slots_resolved binding the live query's canonical at recall time.
When you DO find a playbook on a future recall, treat it as ground truth: replay the steps with slots_resolved substitutions, skip the discovery that the choreography already documents, and read notes before any step.
playbook amend & when your debug response identifies a correctionIf your debug-protocol response identifies a concrete correction the notes or playbook should know - a workaround, an undocumented endpoint shape, a stale field name, observed schema drift, an empty-payload fallback - fire playbook amend BEFORE emitting your user-facing response. Same fire-and-forget posture as teach. Pass the query and note as argv/MCP arguments, or write each with a non-shell file tool and read them back (QUERY=$(cat ...), NOTE=$(cat ...)). Do not interpolate either string into the command text:
QUERY=$(cat /path/to/question.txt)
NOTE=$(cat /path/to/note.txt)
rewst-cli playbook amend \
--query "$QUERY" \
--add-note "$NOTE"
# (append shell `&` to background it)
What counts as worth amending: a behavior you OBSERVED this session that future-you would benefit from knowing. Examples worth amending:
{meta, results}, payload nested two levels deeper than the docs claim).What does NOT belong in notes:
The amend command appends to the family's existing notes with a timestamped marker ([amend YYYY-MM-DDTHH:MMZ]: <text>). Multiple amends accumulate; the audit trail is visible. If no playbook exists yet for the family, amend creates a notes-only one (so cold-start corrections still land).
playbook amend notes are designed to potentially flow upstream as shared knowledge in future versions of the Printing Press. Keep them clean of user-identifying content so the upstream-contribution path stays open without retroactive scrubbing:
If a correction is only meaningful with user-specific context, it belongs in a personal note, not in the playbook amend.
rewst-cli learnings stats reports recall hit rate, teach-to-reuse, playbook resolution rate, and candidate confirm/reject counts from the local learn_events table. Rates are null until they have a denominator; everything stays on this machine. Use it to check whether the loop is earning its keep for this CLI.
--no-learn on a single command short-circuits both recall and the teach write path. Use for deterministic agent flows or tests that must not be affected by accumulated learnings.REWST_NO_LEARN=true in the environment globally disables the pipeline.When you (or the agent) notice something off about this CLI, record it:
rewst-cli feedback "the --since flag is inclusive but docs say exclusive"
rewst-cli feedback --stdin < notes.txt
rewst-cli feedback list --json --limit 10
Entries are stored locally as feedback.jsonl under the resolved data dir. They are never POSTed unless REWST_FEEDBACK_ENDPOINT is set AND either --send is passed or REWST_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.
Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
| Sink | Effect |
|---|---|
stdout | Default; write to stdout only |
file:<path> | Atomically write output to <path> as a private 0600 file (exclusive randomly named temp in the destination directory, then rename; a planted symlink is not followed). Binary-response commands write decoded payload bytes (not the base64 JSON envelope) and print a small JSON receipt on stdout; --json/--csv do not refuse when this sink is set. |
webhook:<url> | POST the output body to the URL (application/json). Redirects are not followed; a 3xx response fails the delivery and the body is not sent to the Location. |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures, including redirects, return non-zero and log the URL and HTTP status on stderr.
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled or recurring agent reuses the same saved flags while providing different input each run.
rewst-cli profile save briefing --json
rewst-cli --profile briefing action-options get
rewst-cli profile list --json
rewst-cli profile show briefing
rewst-cli profile delete briefing --yes
Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.
For endpoints that submit long-running work, the generator detects the submit-then-poll pattern (a job_id/task_id/operation_id field in the response plus a sibling status endpoint) and wires up three extra flags on the submitting command:
| Flag | Purpose |
|---|---|
--wait | Block until the job reaches a terminal status instead of returning the job ID immediately |
--wait-timeout | Maximum wait duration (default 10m, 0 means no timeout) |
--wait-interval | Initial poll interval (default 2s; grows with exponential backoff up to 30s) |
Use async submission without --wait when you want to fire-and-forget; use --wait when you want one command to return the finished artifact.
If --wait times out or polling fails after the job was accepted, the command exits 8 and prints the job ID plus a recovery command that fetches the result. The job may still be running and may already be billed, so run the recovery command instead of resubmitting.
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 6 | Partial failure |
| 7 | Rate limited (wait and retry) |
| 8 | Async job submitted but not finished (run the printed recovery command; do not resubmit) |
| 10 | Config error |
Parse $ARGUMENTS:
help, or --help → show rewst-cli --help outputinstall → ends with mcp → MCP installation; otherwise → see Prerequisites above--agent)claude mcp add rewst-mcp -- rewst-mcp
claude mcp listFor a remote host, rewst-mcp --transport http requires REWST_MCP_HTTP_TOKEN set to at least 32 characters (callers send Authorization: Bearer <token>; openssl rand -hex 32 prints 64 hex characters and meets that minimum), serves http://127.0.0.1:7777/mcp by default, and needs --tls-cert/--tls-key for any non-loopback --addr. Requests with no Origin header are accepted. Loopback origins are accepted; any other Origin is refused unless listed in REWST_MCP_HTTP_ALLOWED_ORIGINS (comma-separated scheme://host[:port] values). REWST_MCP_READ_ONLY=1 drops mirrored write commands (local-write commands that only touch the CLI's own learn store stay) and makes the raw execute tool refuse state-changing calls.
which rewst-cli
If not found, offer to install (see Prerequisites at the top of this skill).--agent flag:
rewst-cli <command> [subcommand] [args] --agent
rewst-cli <command> --help.AGENTS.md (opens in a new tab)CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)cli/LICENSE (opens in a new tab)cli/Makefile (opens in a new tab)cli/NOTICE (opens in a new tab)cli/cmd/rewst-cli/main.go (opens in a new tab)cli/cmd/rewst-mcp/http_auth_test.go (opens in a new tab)cli/cmd/rewst-mcp/main.go (opens in a new tab)cli/go.mod (opens in a new tab)cli/go.sum (opens in a new tab)cli/internal/cache/cache.go (opens in a new tab)cli/internal/cli/action-options.go (opens in a new tab)cli/internal/cli/action-options_create.go (opens in a new tab)cli/internal/cli/action-options_get.go (opens in a new tab)cli/internal/cli/actions.go (opens in a new tab)cli/internal/cli/actions_create.go (opens in a new tab)cli/internal/cli/actions_get.go (opens in a new tab)cli/internal/cli/agent_context.go (opens in a new tab)cli/internal/cli/analytics.go (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub servosity/msp-skills --plugin rewstOther plugins' skills for the same job