Standalone Rust CLI for querying the reverse-engineered MOBIE API.
- Rust toolchain
cargo buildAfter the first tagged GitHub release is published, install from the tap:
brew tap jvm/tap
brew install mobieUpgrade later with:
brew update
brew upgrade mobieRequired for authenticated commands:
MOBIE_EMAILMOBIE_PASSWORD
Optional:
MOBIE_BASE_URL(default:https://pgm.mobie.pt)
You can provide credentials in any of these ways:
--emailplusMOBIE_PASSWORD- Exported environment variables
dotenvx run -- ...- A stored OS keychain session created with
mobie auth login
Precedence for authenticated commands:
- explicit
--emailand/or environment-provided credentials - exported env vars or
dotenvx - stored keychain session
mobie auth login prompts for credentials when they are not already provided and stores the refreshable session in the platform secret backend:
- macOS Keychain
- Linux Secret Service
- Windows Credential Manager
The password is used only for the login request and is not persisted by the CLI. For local safety, mobie rejects --password on argv; use MOBIE_PASSWORD, dotenvx, or the interactive prompt instead.
mobie reads standard process environment variables, so it works with dotenvx without any extra integration layer.
Example .env:
MOBIE_EMAIL=user@example.com
MOBIE_PASSWORD=super-secret
MOBIE_BASE_URL=https://pgm.mobie.ptRun the CLI through dotenvx:
dotenvx run -- cargo run -p mobie -- auth check
dotenvx run -- cargo run -p mobie -- --json sessions list --location MOBI-XXX-00000If you use the compiled binary directly:
dotenvx run -- ./target/debug/mobie auth checkHuman-readable output:
cargo run -p mobie -- auth check
cargo run -p mobie -- auth login
cargo run -p mobie -- auth status
cargo run -p mobie -- auth logout
cargo run -p mobie -- locations list
cargo run -p mobie -- locations get --location MOBI-XXX-00000
cargo run -p mobie -- sessions list --location MOBI-XXX-00000 --limit 200
cargo run -p mobie -- sessions list --location MOBI-XXX-00000 --from 2026-03-02 --to 2026-03-08
cargo run -p mobie -- tokens list --limit 200
cargo run -p mobie -- logs list --limit 200 --error-only
cargo run -p mobie -- logs list --location MOBI-LSB-00693 --message-type Heartbeat --from 2026-03-01 --to 2026-03-07Structured output for agents:
cargo run -p mobie -- --json auth check
cargo run -p mobie -- --json auth status
cargo run -p mobie -- --json locations list
cargo run -p mobie -- --json sessions list --location MOBI-XXX-00000sessions list --from/--to maps to the MOBIE API's dateFrom / dateTo query params. Date-only values include the full day.
logs list targets the richer OCPP log surface used by the portal search form. It supports optional --location, --message-type, --from, and --to.
Default OCPP log window behavior:
- if
--tois omitted,mobieuses the end of today - if both
--fromand--toare omitted,mobieuses the last 7 days - if both are provided,
mobierejects ranges longer than 7 days
Date-only values for logs list include the full day.
mobie uses a hybrid local SQLite cache.
sessions listand OCPPlogs listare canonical-record-backed.tokens list,logs ocpi,locations analytics, andlocations geojsonremain response-cache-backed.locations listandlocations getstill use the simpler snapshot cache path.
For canonical resources:
- full raw API documents are stored locally alongside indexed columns for querying
sessions listreads from canonical session rows after refresh- OCPP
logs listreads from canonical log rows after refresh - OCPP log cache scopes are keyed by location, message type, error filter, and requested time window
--jsonand--tooninclude structured freshness metadata- terminal and Markdown output show a concise freshness line when available
OCPP logs do not expose a durable per-entry id in the API payload, so the cache uses a synthetic local fingerprint for identity plus a deterministic sort key for ordered reads.
Existing cache databases are migrated in place on open. Legacy cache_entries rows are backfilled into canonical tables when possible.
Homebrew releases are driven by Git tags:
- Update
apps/mobie/Cargo.tomlto the release version. - Commit the change and push it.
- Create and push a matching tag like
v0.2.0.
That tag triggers GitHub Actions to:
- build macOS Apple Silicon and Intel release archives
- create a GitHub release in
jvm/mobie-cli - dispatch release metadata to
jvm/homebrew-tap - update
Formula/mobie.rbin the tap with the new asset URLs and SHA-256 values
Required repository secrets:
- In
jvm/mobie-cli:HOMEBREW_TAP_DISPATCH_TOKEN
The token only needs permission to dispatch workflows to jvm/homebrew-tap and push commits there.