Skip to content

About

CLI for the VMflow vending fleet

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

vmflow-cli

npm downloads node license last commit

CLI for the VMflow vending machine fleet — auth, device RPC over MQTT, sales, and telemetry.

Install

npm install -g vmflow-cli

Auth

vmflow-cli auth login    # opens the browser to sign in, no tokens to copy/paste
vmflow-cli auth status
vmflow-cli auth logout
vmflow-cli auth token    # print a valid access token, for scripting

Login runs a tiny local login page on localhost; email/password never leave your machine except over HTTPS straight to Supabase. Credentials are stored in ~/.config/vmflow-cli/credentials.json (refreshed automatically).

Devices

vmflow-cli device list
vmflow-cli device info <subdomain>       # live snapshot: state, last sale, heap, uptime
vmflow-cli device echo <subdomain>       # liveness / round-trip probe
vmflow-cli device credit <subdomain> <amount>   # 0.01 .. 655.34, up to 2 decimals
vmflow-cli device buzzer <subdomain>     # physically locate a machine
vmflow-cli device ota <subdomain> [tag]
vmflow-cli device dex <subdomain>
vmflow-cli device oos <subdomain>
vmflow-cli device restart <subdomain>
vmflow-cli device health                 # parallel info-sweep, shows MDB state, flags anomalies

info/ota/dex/oos/buzzer/restart sign and publish an MQTT RPC directly to the device (the device passkey is fetched over the authenticated Supabase REST API, never entered manually). Add -w/--wait to any of the fire-and-forget commands to wait for the device's confirmation.

info adds machine_state_name (INACTIVE, DISABLED, ENABLED, IDLE, VEND) next to the numeric machine_state the firmware reports. health flags devices whose reader is INACTIVE/DISABLED (VMC never enabled it).

Sales & metrics

vmflow-cli sales list        # date, device, seq, item, price, channel, status
vmflow-cli metrics paxcounter

list, info, health, sales list and metrics paxcounter print a table; add --json for raw JSON. -n/--limit takes 1..1000 (default 20). vmflow-cli -v (or --version) prints the installed version.

Configuration

All defaults point at the public VMflow endpoints; override via env vars if you run your own instance:

Variable Default
VMFLOW_SUPABASE_URL https://supabase.vmflow.xyz
VMFLOW_ANON_KEY (public anon key)
VMFLOW_MQTT_URL mqtt://mqtt.vmflow.xyz

Related

License

ISC

About

CLI for the VMflow vending fleet

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages