Using the walkerOS CLI
Overview
The walkerOS CLI (walkeros) validates, simulates, tests and bundles event
collection flows. It does not run them: a built server flow runs with
runneros start from @walkeros/runner (the walkeros/flow image).
Core workflow:
- Configure - Write Flow.Json JSON config
- Validate -
walkeros validate flow.json - Test - Simulate events (mocked) or push (real)
- Bundle -
walkeros bundle flow.json -o dist/ - Run -
runneros start dist/flow.mjs, or deploy through the app
Quick Start
# Install (Node.js 22.12 or later)
npm install -g @walkeros/cli
# Bundle a flow into dist/
walkeros bundle flow.json -o dist/
# Test with simulated event
walkeros push flow.json -e '{"name":"page view"}' --simulate destination.demo
# Push real event
walkeros push flow.json -e '{"name":"page view"}'
An event needs name ("entity action"). One written as entity and action
only is rejected as invalid: a simulation prints
mapping: none (skipped before mapping) and no calls, a real push sends
nothing, and both still print success: true.
Commands Overview
| Command | Purpose | Safe? |
| ------------- | ------------------------------------------------------------------------------------------------ | ----- |
| bundle | Generate JS bundle from config | ✅ |
| push | Push an event: real API calls on a server flow, recorded on a web flow; --simulate mocks steps | ⚠️ |
| setup | Run a component's setup() to provision external resources | ⚠️ |
| validate | Validate configs/events | ✅ |
| cache | Manage caching | ✅ |
| login | Sign a person in with the walkerOS app in a browser; logout revokes it | ✅ |
| auth | Check who the credential belongs to and where it comes from | ✅ |
| api | Call the walkerOS app API, or list its operations | ⚠️ |
| diagnostics | Show the CLI version, the app URL, and whether the app answers | ✅ |
| telemetry | Show, enable or disable anonymous usage telemetry | ✅ |
For detailed command reference, see
Common Workflows
Development Workflow
1. Write flow.json config
2. Bundle: walkeros bundle flow.json
3. Simulate: walkeros push flow.json -e event.json --simulate destination.demo
4. Fix issues, repeat 2-3
5. Push test: walkeros push flow.json -e event.json
6. Deploy: in the walkerOS app, or
walkeros api POST /api/projects/{projectId}/flows/<flowId>/deploy
(see the CI recipe in the CLI docs)
Multi-Flow Development
# Bundle specific flow
walkeros bundle flow.json --flow myFlow
# Bundle all flows (--all needs an output directory)
walkeros bundle flow.json --all -o dist/
# Test specific flow
walkeros push flow.json --flow myFlow -e event.json --simulate destination.demo
Local Development Server
# Build, then start the artifact with the runtime (a separate package)
walkeros bundle flow.json -o dist/
npx --package=@walkeros/runner runneros start dist/flow.mjs --port 3000
Server port note: Under runneros the runtime owns the port: it listens on
--port (or PORT, default 8080), serves /health and /ready, and hands
every other request to the flow's HTTP handler. A source's own port setting is
not used there.
Flow.Json Configuration
Minimal Config
{
"version": 4,
"flows": {
"default": {
"config": {
"platform": "web",
"bundle": {
"packages": {
"@walkeros/web-destination-gtag": { "version": "^4" }
}
}
},
"destinations": {
"gtag": {
"package": "@walkeros/web-destination-gtag",
"config": {
"loadScript": true,
"settings": { "ga4": { "measurementId": "G-XXXXXX" } }
}
}
}
}
}
}
Without "loadScript": true walkerOS does not load gtag.js: unless the page
loads it itself, events go nowhere while the push still reports them as done.
Config Structure
{
"version": 4,
"flows": {
"<flowName>": {
"config": {
"platform": "web" | "server", // Platform (required)
"url": "", // Optional: public URL, read by $flow.<name>.url
"settings": {}, // Platform-specific settings (optional)
"bundle": {
"packages": {}, // NPM packages pacote will install
"overrides": {}, // Transitive dep version pins (npm-style)
"traceInclude": [], // Optional: nft escape hatch (paths/globs)
"flows": {} // Server flows only: web flow key -> file path in the output folder
}
},
"sources": {}, // Event sources
"destinations": {}, // Event destinations (each with its own mapping)
"transformers": {}, // Transformer chain (optional)
"stores": {}, // Key-value stores (optional)
"collector": {}, // Collector configuration
"variables": {} // Flow-level $var values (optional)
}
}
}
You do NOT need npm install for step packages. flow.json's
config.bundle.packages is the single source of truth. Pacote installs them
transparently when you run walkeros bundle. Only @walkeros/cli belongs in
your project's package.json (as a devDependency).
config.bundle.overrides pins transitive dependency versions. Use it when a
vendor SDK's declared peer/dep range conflicts with another required version in
the same tree. Example: {"@amplitude/analytics-types": "2.11.1"} forces that
exact version everywhere in the install graph. Direct packages specs always
win over overrides; overrides only substitute transitive resolution.
Schema version stays at 4. Build-time fields live under
flow.<name>.config.bundle.{packages, overrides, traceInclude, env, flows}. A
config.bundle.external field fails walkeros validate (Unrecognized key);
the bundle only warns and builds, so remove it.
collector.observe starts the reporter. A server flow reads
"collector": { "observe": { "usage": { "url", "token", "interval" }, "preview": { "url", "token" } } }
from its own config, with the token from a $secret; usage is counters and
issues every 10 to 300 seconds, preview is one row per event. A production web
bundle carries no reporter: a web flow's own collector.observe block ships in
the bundle bytes, token included, and is not used (the page logs
observe: not in this build, config ignored), so never put a token there. Only
a browser wrap given observe: { preview: { url, token } } (a preview build;
usage, a node wrap or observe beside preview activation is refused) carries
the reporter. walkeros push and every simulate drop the block, so they report
nothing. See the
For detailed configuration options, see
Testing with Step Examples
Simulate with `--step`
Target a specific step and provide input as SourceInput
({ content, trigger? }):
# Simulate a source step with trigger metadata (a click needs its selector)
walkeros push flow.json --simulate source.browser --event '{"content":"<button data-elb=\"cta\" data-elbaction=\"click\">Sign up</button>","trigger":{"type":"click","options":"button"}}'
# Simulate a destination step with an event
walkeros push flow.json --simulate destination.gtag -e '{"name":"order complete","data":{"value":149.97}}'
A click trigger without options finds no element
(Trigger: element not found for selector "undefined") and the source emits
no events. Example output of the destination command (a destination step
prints its matched mapping key and every recorded vendor call, arguments as
compact JSON cut at 300 chars):
success: true
destination.gtag
mapping: none
call window.gtag("config","G-XXXXXX",{})
call window.gtag("event","order_complete",{"send_to":"G-XXXXXX"})
Duration: 467ms
mapping: <key>when a rule matched,mapping: nonewhen the destination
pushed without a rule, mapping: none (skipped before mapping) plus
no calls when nothing was sent. Then why, when consent is the reason:
pending: waits for consent (require) (never started; names the unmet
require entries) or
skipped: consent (requires marketing; granted functional) (started, event
denied by its consent check; after mapping: <key> it is that rule's own
consent). Source, transformer and collector steps print their recorded
calls, then event <json> or no events; a failed step prints
error: <message>. A source step records the walker commands the source
issues itself as elb calls in its own call shape, e.g.
call elb("walker consent",{"functional":true,"marketing":true}) for a CMP,
call elb("user",...) and call elb("session",...) for the session source.
Not recorded: the collector's own commands (starting consent, globals, custom,
shutdown) and the wiring commands on, hook, destination.
--jsonputs the same data undersimulations(one
{ step, name, events, calls: [{ fn, args, ts }], mappingKey?, skipped?, error? }
per simulated step, in order; skipped is { reason: 'pending', require } or
{ reason: 'consent', required, granted }; a multi-destination simulate stops
at the first failure). stdout is pure JSON, logs go to stderr, so | jq works
without --silent. Values pass through toPrintable (@walkeros/core/node):
Error to { name, message }, Buffer to UTF-8, bigint to string,
Map/Set to arrays, cycles to "[Circular]".
- Text and JSON output (and MCP
flow_simulateandflow_push) are scrubbed
with scrubSecrets, the same redactor the loggers use: service accounts, PEM
keys, Authorization, access_token, credential-named fields and
high-entropy runs show as ***. The values of every $secret.NAME the flow
references (set in the env, 6+ chars) are masked exactly, raw, JSON-escaped
and URL-encoded. The step still receives the real values. With --json, a
number whose printed form contains a known value becomes "***", so the JSON
still parses. Simulate and a real push of a flow config route the flow's own
logs through the masking CLI logger, so flow DEBUG lines need --verbose; the
run's own CLI lines mask the known values too. The runner masks every value
the flow declares through $secret or $env (6+ chars), whether the app, an
--env-file or the container env supplied it.
- Only the target starts. Destination simulate keeps only the target
destination (no source, no other destination initializes); the flow's
transformers still start, and a store without a mock env runs for real. Source
simulate keeps only the simulated source (no browser page view or CMP decision
from another source); captured events stop at the collector. A source package
that declares examples.env.simulation (SQS, Pub/Sub pull) runs on its mock
client with those calls recorded.
- No real vendor calls (destinations only). A package destination whose
export has no mock env (examples.env.push) is refused before the flow starts
(an inline code step has no package and runs as given):
No mock env for <package> export <exportName>: simulate would call the real vendor. Add examples.env.push to the package's dev examples.
A named export of a package version without exportExamples is refused with
...: this package version predates export-keyed examples; use a version with exportExamples or a local path.
A store whose package ships a mock env runs on it; a store without one runs
for real. Sheets and GCS still need a real-format service-account key, since
they sign their token request before the mocked fetch answers (see the CLI
docs, "Secrets in simulate").
--ingest <json|file|url>supplies the request context (a JSON object,
e.g. {"ip":"203.0.113.7","userAgent":"Mozilla/5.0"}) for transformer.*,
collector.* and destination.* simulation. It reaches the destination
before chain and context.ingest (or collector.next); the CLI always sets
_meta. Rejected for source.* and a real push:
--ingest applies to transformer, collector and destination simulation only.
A programmatic pushCommand({ ingest }) on a real push or source simulate
errors the same way; simulateTransformer, simulateCollector and
simulateDestination take ingest directly.
--consent <json|file|url>(a JSON object of booleans) is the collector
consent any simulated step starts from, sources included (programmatic
consent; MCP and collector: state.consent). startFlow applies it before
the flow runs, as a consent command only the simulated step hears: a
require: ["consent"] destination starts, its consent check sees the granted
keys, and a Consent Mode (como) target records its
gtag('consent','update',...). A consent-gated source (the session source
with settings.consent) starts from it; without it, no events. The starting
consent is never recorded as a source call. Rejected for a real push only:
--consent sets the collector's starting consent for a simulation; a real push uses the flow's own consent.
--command <config|consent|user|run>makes a destination simulation run
collector.command(name, event) instead of a push (a step example's
command); the event is the command's data and its calls are recorded.
Starting consent applies first, then the command. Elsewhere:
--command applies to destination simulation only.
--page-url <url>sets the page of a simulated web source (absolute
http/https only). Precedence: --page-url, then the input trigger's
options.url, then http://localhost. Elsewhere:
--page-url sets the page of a simulated web source; for request context use --ingest.
Consent mental model (what decides whether a destination receives an event):
| Setting | Effect | In simulate |
| ------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------- |
| require: ["consent"] | Destination stays pending until the collector has ANY consent state | --consent starts it; else pending: waits for consent |
| config.consent: { marketing } | Each event checked against collector consent plus event.consent; denied = skipped | grant via --consent or the event; else skipped |
| event.consent | Per event, counted on top of collector consent | part of the -e event |
- Clients built in
init. Simulate injects the mock env beforeinit, so
clients built in init (BigQuery writer, Pub/Sub client) are recorded.
Same flow via MCP (`flow_simulate`)
From an AI assistant the equivalent tool is flow_simulate. A few specifics:
stepis required. Pass the target as"type.name", e.g.
"source.browser", "collector.default", "destination.gtag", or
"transformer.router". There is no all-steps mode.
- Four step types:
source,collector,transformer,destination.
Source-step event shape is { content, trigger? }, where content is the
walkerOS event { name, data } and trigger is optional
{ type?, options? }. There is no env field. Destination and transformer
steps take a plain walkerOS event { name, data, consent? }.
collectoris the enrichment step plus the collector chain. It takes a
post-next partial event plus an optional state snapshot
{ consent?, user?, globals?, timing? }, applies the collector's enrichment,
then runs collector.next, and returns every event the destinations would
receive (none when a stop drops it, several when many forks it).
- **
transformer,collectoranddestinationsteps accept an optional
ingest** (a raw ingest without _meta). Supply it to test a request decoder
standalone (a GA4 decoder reading ctx.ingest.url: pass
ingest: { url: "..." }), or to see the client IP and user agent a
conversion-API destination sends (ingest: { ip, userAgent }). The result is
scrubbed of credentials like the CLI output.
- Sources are simulatable as a step, including the
@walkeros/source-demo
demo source.
configPathis a file path, an http(s) URL or inline JSON.- A flow saved in the walkerOS app runs locally through a config link: the
hosted walkerOS MCP server's flow_manage (action: "config_url") returns a
URL that lasts about ten minutes, and flow_simulate, flow_bundle,
flow_push and flow_load take it as their config input.
flow_load loads a flow from a local path, URL or inline JSON. In a returned
config, package names, platform, versions and IDs come back literally; every
other string value comes back wrapped, for example
"title": "<user_data>Home</user_data>". Remove the wrapper from each value
before writing the config back, or it becomes part of the value.
From a terminal, walkeros diagnostics (or --json) reports the CLI version,
the app URL and where it comes from, and whether the app answers its health
route:
cli 4.x.y
app https://app.walkeros.io (default)
health reachable, status ok, app 3f2a91c
Validate flow config
Validate every flow and every step in one run:
walkeros validate flow.json
What validate guarantees:
- Everything by default: schema, references (resolved per flow with the
runtime resolver; an unknown $var, a missing store, an unresolvable $flow
or a cycle is an error), routes, the root contract, the bundle preflight,
cross-step example compatibility, the examples of
@walkeros/transformer-validate steps against their linked contract, and each
step's settings against its package schema (an unknown key is an error where
the package closes its schema, other findings are warnings; --offline skips
the fetch).
- Narrowing is explicit:
--flow <name>narrows per-flow checks (file-level
checks still run); --path <section.key> checks one entry in every flow that
has it, or only in --flow.
- Every skip is reported in
details.skippedand the text output, with a
code. A step that imports a named export (step import, else
bundle.packages[pkg].imports[0]) is checked against that export's entry in
the package's exportSchemas; a single-export package uses settings. The
bundler runs the step's import, else the default export, never an imports
entry, so set import on the step to check and run the same export. A
multi-export package version without exportSchemas, or one that does not
list its exports, is a skip (NO_SETTINGS_SCHEMA).
- The result states its scope: a
Scope:line anddetails.scope. --strictfails on warnings and skips (exit 2;validate()and
flow_validate return valid: false) and makes contract example
disagreements errors (exit 1). It never changes what runs.
- Stable codes: every error and warning has a
code; branch on it, never on
the message.
- Not checked, also under
--strict: an unknown key at the file root, on a
flow or in its config is dropped without a message (a misspelt
"destinaitons" passes), and a mapping rule's settings are not checked. A
passing validate is a first filter; simulate before you bundle.
For full details on writing and testing with step examples, see
$code: Prefix (Inline JavaScript)
Embed JavaScript functions in JSON configs:
{
"fn": "$code:(event) => event.data.price * 100",
"condition": "$code:(event) => event.data?.value > 100"
}
Important: The CLI bundler converts $code: strings to actual JavaScript
functions during build. This is essential for mappings in JSON configs.
For mapping patterns, see
Quick Reference
Bundle Command
walkeros bundle <config> [options]
Options:
-o, --output <path> Write to a file or directory (a server flow also to a .tar.gz/.tgz archive)
-f, --flow <name> Bundle one flow of a multi-flow config
--all Bundle all flows (needs -o)
--stats Show bundle statistics
--json JSON statistics (implies --stats); with -o the JSON replaces the bundle at that path
--no-cache Disable the package and build caches
--release <id> Stamp a config release id on event.source.release
--manifest [source] Build from a manifest (see "Manifest builds")
-v, --verbose Verbose output
-s, --silent Silent mode
Output:
- Web:
dist/walker.js(single self-contained IIFE). Every browser entry (this
bundle, managed wraps, walker.js) calls the Tag Mode loader moin() from
@walkeros/web-core first; it stays idle unless the page was opened with
?elbMoin.
- Server:
dist/{flow.mjs, package.json, node_modules/}(always a directory;
nft-traced)
- Server archive:
flow.tar.gz/flow.tgz(the server bundle directory packed
into a single gzip file)
- Served web flows: a server flow that lists web flows in
config.bundle.flows
also gets each one at its path in the directory or archive
(Served flow casamoda: casamoda/walker.js). Stdout and URL outputs carry the
server file alone and warn Served flows left out (stdout): ....
Use -o ./dist/walker.js for web, -o ./dist/ for a server directory, or
-o ./flow.tar.gz for a server archive. Web single-file bundles do not support
archive output. Without -o the bundle is written to stdout, which for a server
flow is flow.mjs alone, without its node_modules/.
Also: --release <id> stamps a config release id on event.source.release (it
beats an authored collector.release; the default is a 12-hex content id of
config, resolved packages and CLI version, so the same input gives the same
release; env and secret values are not inputs, only their names);
--manifest [url|path] builds from a manifest (see "Manifest builds" below).
Push Command
walkeros push <config> [options]
Options:
-e, --event <json|file|url> Event to process (required; a mistyped file path is read as an event name)
-f, --flow <name> Flow to use
-p, --platform <web|server> Platform override
--simulate <step> Simulate a step (repeatable for destination.*). Format: source.NAME | destination.NAME | transformer.NAME | collector.NAME
--mock <step=value> Mock a step with a specific return value (repeatable); chain members via destination.NAME.before.ID or collector.next.ID
--ingest <json|file|url> Request context for transformer/collector/destination simulate
--consent <json|file|url> Starting collector consent for a simulation, any step
--command <name> Destination simulate runs this command (config|consent|user|run) instead of a push
--page-url <url> Page URL of a simulated web source (http/https)
--snapshot <source> JS file to eval before execution (sets global state)
-o, --output <path> Write the result to a file
--json JSON on stdout (incl. simulations); logs to stderr
-v, --verbose / -s, --silent Verbose or silent output
On a real push, a destination that writes to the console still prints there:
with @walkeros/destination-demo, push --json puts the demo's lines on stdout
before the JSON, so the output does not parse with jq.
Push takes a flow config. A file walkeros bundle wrote fails as push input
(see the CLI docs, "Input types").
Validate Command
walkeros validate <input> [options]
Options:
-t, --type <type> Validation type (default: flow). Also: event, mapping, contract
--path <path> Check one entry in every flow that has it (e.g. destinations.snowplow, stores.cache)
-f, --flow <name> Narrow per-flow checks to one flow
--strict Fail on warnings and skipped checks
--offline Do not fetch package schemas (settings not checked)
--json JSON output
-o, --output <path> Write the result to a file
Exit codes:
0 = Valid (skips alone do not change it)
1 = Errors found (contract violations count as errors under --strict)
2 = No errors, but warnings or skipped checks found (with --strict only)
3 = Validation could not run (missing file, invalid JSON, option that does not apply)
Running a built flow (`runneros`, not the CLI)
The CLI has no run command. The runtime is a separate package,
@walkeros/runner, with the binary runneros:
runneros start [artifact] [options]
Options:
-p, --port <number> Port (default: 8080)
--env-file <path> Load a dotenv file first (existing env wins; a group- or other-readable file is refused)
--json JSON output
-v, --verbose Verbose output
-s, --silent Silent mode
[artifact] (or BUNDLE, or flow.mjs in the working directory) is a
.mjs/.js/.cjs entry, a .tar.gz/.tgz archive holding flow.mjs, or an
http(s) URL to either. The runtime does not bundle: it has no bundler
installed; a local flow config is refused and one fed by URL or stdin fails at
import. Never generate a container or command that hands flow.json to the
runtime; bundle first. The full reference is "Deploying a server flow" below.
runneros remote --cache <dir> is the other mode: a self-hosted runner that
takes its server flow releases from the walkerOS app instead of a built
artifact. It reads WALKEROS_CREDENTIAL only (the credential of a paired
deployment), takes no --env-file, checks each release before it runs and swaps
to it with no image rebuild. Options: --no-heartbeat, --heap <MB>,
-p, --port, --json, -v, -s. See
https://www.walkeros.io/docs/apps/remote.
Setup Command
# Provision external resources for one component (explicit only, never
# triggered by push, real or simulated, a deployment, or the runtime)
walkeros setup <kind>.<name> [-c ./flow.json] [-f <flow>] [--json] [--verbose] [--silent]
The target uses the same <kind>.<name> syntax as walkeros push --simulate
(source, destination, or store). Package resolution follows the flow's
pins exactly like bundle: the version from config.bundle.packages (or inline
@scope/pkg@x.y.z, bundle pin wins) is downloaded through the shared pacote
pipeline and cache, then imported from the extracted tree. Setup works via npx
without a local install; path: entries in config.bundle.packages support
local development with a built package directory. Today it cannot load the AWS
(SQS) or GCP (Pub/Sub) source, nor the GCS or Sheets store: it exits 1 and
creates nothing (see the CLI docs, "Setup command").
Bundler Gotchas
- Circular copies: Never include the output directory itself (e.g.,
include: ["./dist"] when output is dist/). The CLI detects this and
errors.
includeis server-only: rootinclude(default./sharedwhen that
folder exists) is copied next to server bundles only. A web build copies
nothing and logs
include is ignored for web builds: a browser bundle cannot read local folders.
A server build served from the build cache copies include too. A manifest
(hosted) build refuses include only on a server flow; on a web flow it is
accepted and ignored.
- Caches and temp dirs: caches live in
$TMPDIR/cache/(os.tmpdir(); on
Linux TMPDIR is often unset, read $TMPDIR/... in output as /tmp/...).
Package entries are written to a temp sibling and renamed in once complete; a
failed write warns
Package cache write failed for <name>@<version>: <message>. The build continues without caching it.
Entries from an older CLI miss once. walkeros cache clear also removes
interrupted writes. Build cache keys cover a local package's (path) built
contents and the CLI version, so a rebuild needs no cache clear;
cache clear --builds removes both build caches. Each run works in
$TMPDIR/walkeros/<kind>/<6 chars> (push, build, bundle, wrap,
archive, setup).
- Runtime paths:
runnerossets CWD to the bundle directory. File paths in
settings resolve relative to the bundle, not the project root.
- Component names: Source, transformer, destination, and store names must be
valid JavaScript identifiers (camelCase). Validate refuses a hyphenated name
such as gtag-wrapper (INVALID_COMPONENT_NAME); use gtagWrapper.
- Range conflicts: When two transitive consumers declare incompatible ranges
for the same dep (e.g., arrify@^3.0.0 vs arrify@^2.0.0), the bundler
resolves the chosen range to a concrete version and nests non-satisfying specs
under their consumer. If a post-install warning surfaces declared-vs-installed
mismatches, pin the dep in config.bundle.overrides. Set
BUNDLER_STRICT_RANGES=0 to bypass strict range validation when the npm
registry is unreachable.