{"id":51408001,"url":"https://github.com/axelpaul/on-cli","last_synced_at":"2026-07-04T12:30:31.810Z","repository":{"id":362876615,"uuid":"1261123000","full_name":"axelpaul/on-cli","owner":"axelpaul","description":"CLI for the ON (Orka náttúrunnar) EV-charging app — sessions, vehicles, chargers, invoices, RFID keys. AI-agent friendly. Built with Bun.","archived":false,"fork":false,"pushed_at":"2026-06-06T09:41:11.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T11:19:05.779Z","etag":null,"topics":["agent-friendly","bun","cli","ev-charging","iceland","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axelpaul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-06T09:09:12.000Z","updated_at":"2026-06-06T09:41:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/axelpaul/on-cli","commit_stats":null,"previous_names":["axelpaul/on-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/axelpaul/on-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpaul%2Fon-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpaul%2Fon-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpaul%2Fon-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpaul%2Fon-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelpaul","download_url":"https://codeload.github.com/axelpaul/on-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelpaul%2Fon-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35122497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-friendly","bun","cli","ev-charging","iceland","typescript"],"created_at":"2026-07-04T12:30:30.888Z","updated_at":"2026-07-04T12:30:31.805Z","avatar_url":"https://github.com/axelpaul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# on-cli\n\nHeadless CLI for the **ON (Orka náttúrunnar)** EV-charging app — charging sessions,\nvehicles, chargers, invoices, and RFID keys without opening the mobile app.\n\nON is a white-label of Etrel's \"Thor\" app on the **Dusky** backend (`app.on.is`).\nAI-agent friendly: JSON output, stable shapes, `doctor` + `schema` commands.\n\n## Install\n\nNeeds [Bun](https://bun.sh/) ≥ 1.3.\n\n```sh\ngit clone \u003crepo\u003e on-cli \u0026\u0026 cd on-cli\nbun install\nbun link               # exposes `on` on your PATH\non login --email you@example.com\n```\n\nOr run without linking: `bun src/index.ts \u003ccommand\u003e`.\n\n## Auth\n\nPlain email + password (OAuth2 password grant). No browser, works over SSH.\n\n```sh\non login                       # interactive (prompts for email + password)\non login --email you@x.is      # prompts only for password\nON_USER=you@x.is ON_PW=secret on login   # fully non-interactive (CI / agents)\non whoami\non logout\n```\n\nThe session (access + refresh token) is cached at `~/.config/on/auth.json` (mode `0600`).\nAccess tokens last ~1h; the CLI **auto-refreshes** with the stored refresh token, so you\nrarely need to log in again. Re-run `on login` only if `doctor` reports the token was\nrejected.\n\n\u003e Electronic-ID (rafræn skilríki) login also exists in the app but is not implemented\n\u003e here — email/password is all the CLI needs. If your ON account has no password set,\n\u003e set one in the app first.\n\n## Commands\n\n```\non whoami                                  the logged-in user\non vehicles                                vehicles on your account\non sessions [--limit N] [--id \u003cid\u003e]        charging history (or one session in full)\non live                                     active sessions, reservations, counters\non stop [--force] [--yes]                   stop the active charging session (mutating)\non start --evse \u003ccode\u003e --connector \u003cid\u003e [--yes]   start charging (mutating)\non keys                                     your RFID charging keys/cards\non invoices [--limit N]                     your invoices\non locations [--lat] [--lng] [--radius KM] [--available] [--free] [--limit N]\n                                            find chargers near a point (public, no auth)\n```\n\n### Stopping / starting a charge\n\n`on stop` reads your active session from the API, so you don't pass any\narguments — it figures out the EVSE/connector itself:\n\n```sh\non stop                 # confirms, then stops the session you're charging on\non stop --yes           # no prompt (for scripts/agents)\non stop --force         # force-stop by connector (fallback / roaming sessions)\non stop --json          # → {\"stopped\":true,\"method\":\"remoteStop\",\"where\":\"…\",\"result_code\":0}\n```\n\nIf nothing is charging, `on stop` is a harmless no-op (`{\"stopped\":false,\"reason\":\"no_active_session\"}`).\n\n`on start` needs to identify the charger you're plugged into (you can't auto-detect\nthat), so pass its EvseCode + connector id:\n\n```sh\non start --evse \"IS*ONP00091-3253-1\" --connector 7890574 --yes\n```\n\nBoth are **mutating** and ask for confirmation unless `--yes`. Success is\n`ResultCode == 0`; on failure the CLI surfaces the server's error and (for stop)\nsuggests `--force`.\n\n### Global flags\n\n| Flag | Meaning |\n|---|---|\n| `--json` | Machine-readable output (always-on when stdout is piped). |\n| `--pretty` | Force human output even when piped. |\n| `--raw` | Dump the raw API response unchanged (debugging). |\n\n### Examples\n\n```sh\non sessions --limit 5                       # last 5 charging sessions\non sessions --id 26761589                   # one session, full detail\non locations --available                    # free-right-now chargers near Reykjavík\non locations --lat 65.68 --lng -18.09 --radius 50   # near Akureyri\non invoices --json | jq '.invoices[] | select(.paid==false)'\n```\n\n## Agent-friendly\n\nJSON is the primary interface. Stable shapes, predictable exit codes, and dedicated\ndiscovery commands:\n\n```sh\non doctor --json     # pre-flight: auth state, token expiry, server reachable\non schema --json     # response-shape catalog for all commands\non schema sessions   # shape for one command\non help --json       # command list\non version\n```\n\n| Exit code | Meaning |\n|---|---|\n| 0 | OK |\n| 1 | Runtime / network error |\n| 2 | Auth required or expired (run `on login`) |\n| 64 | Bad usage (missing/invalid flags) |\n\nA `SKILL.md` at the repo root documents the trigger conditions, data model, and command\nsurface for [OpenClaw](https://github.com/openclaw/openclaw) / agent use.\n\n## Environments\n\nDefaults to production (`https://app.on.is/DuskyWebApi`). Override with `ON_BASE_URL` or a\n`baseUrl` in `~/.config/on/config.json`.\n\n## Development\n\n```sh\nbun run check       # biome + tsc\nbun test            # unit tests for pure helpers\nbun run build       # standalone binary at ./on\n```\n\nThe API was reverse-engineered from `is.on.charge.android` v2025.7.5 via mitmproxy on an\nAndroid emulator. See `src/lib/api.ts` for the typed client and per-endpoint notes.\n\n## Not implemented (yet)\n\n- Payments / saved cards (`/api/creditCards` 404s on ON's deployment; payments flow\n  differently).\n- Electronic-ID (OIDC) login.\n- Favourite locations, coupons, helpdesk, reservations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelpaul%2Fon-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelpaul%2Fon-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelpaul%2Fon-cli/lists"}