Skip to content

Latest commit

 

History

History
321 lines (265 loc) · 24.6 KB

cli.md

File metadata and controls

321 lines (265 loc) · 24.6 KB

Command line

The command-line tool is flatpak run io.github.tomaszbojanowski.OpenExpress <command> in the Flatpak and openexpress <command> in the version from source (for example sync or maps); the two are separate installations, see The Flatpak and the version from source.

Command Description
openexpress info [--json] model, part number, software version, Unit ID, storage and free space, data types and components, Connect IQ limits; --json as JSON
openexpress files [--type FIT_TYPE_4] [--limit N] files on the device by data type from GarminDevice.xml; with --type (or openexpress -v files) each file, --limit N only the last N
openexpress activities [--limit N | --all] [--backups DIR] the activities of the connected device and of its backups, the newest first (details)
openexpress activities export NAME… [--dest DIR] [--backups DIR] [--apply] write activities as GPX 1.1 files, by default to Garmin/GPX in your Documents folder (details)
openexpress activities journal [--all] [--delete] [--apply] the activity journal of the connected device, or with --all of every device: how many activities, since when, the gaps, its size; --delete deletes it (details)
openexpress fit inspect FILE what a FIT file on this computer holds and whether it is whole (details)
openexpress report [--log] device report for GitHub, without serial numbers, Unit IDs or e-mail, with the device's last crashes (date, software version, error number) and its memory dumps; when no device can be opened, a report of what is connected over USB and of the system (exit code 0); --log prints the last 200 lines of the log instead, filtered, for the form's “Log” field
openexpress diagnostics [--crash-logs] [--dumps] [--free-space] [--apply] what the device logged as errors, the crashes that restarted it, its memory dumps and its log of connections; copies its diagnostic files, or frees up space on it (details)
openexpress status [--online] the sign-in, the Garmin devices connected (name, USB mode, whether they are on the account), the last sync of each with the activities it has to upload now, what the window's last check of its updates found, and for a device with satellite data (experimental) whether they are on and when they were last written; --online also asks Garmin Connect and Garmin's update server, or uses their answers from a moment ago (How long Garmin's answers are kept); without it nothing is asked of a server
openexpress devices [--forget N] [--discard-pending] [--backups] [--apply] the devices this installation has seen; --forget N forgets device number N of the list and what this installation keeps of it, as Forget Device does (what that is); files not uploaded yet go only with --discard-pending, its backups only with --backups; a connected device is not forgotten
openexpress setup --from-installer GarminExpress.exe one-time setup from the Garmin Express installer for Windows (only read, nothing installed); instead of it --from-dll Networking.dll [--utilities-dll Utilities.dll] or --key KEY --secret SECRET
openexpress setup [--ui-language en|cs|de|fr|pl|system] [--diagnostics-copy on|off] [--activity-journal on|off] [--locale LOCALE] [--environment production|china] settings: the program's language, the copy of the device's diagnostic files, the activity journal (on is your yes to it), the language to request from Garmin's servers (by default the program's), Garmin's servers; without options it shows the servers and that language
openexpress login [--manual] sign in on the Garmin SSO page (WebKitGTK window)
openexpress whoami [--check], logout account (its name masked: a user name as t…b, an e-mail address as t…@e…, as in every command's output), sign out (removes the local token)
openexpress upload-config [--json] what data is uploaded for this device and where (Garmin server)
openexpress sync [--all] [--upload-only] [--download-only] [--type TYPE]… [--include-diagnostics] [--apply] uploads new FIT files to Garmin Connect and writes the courses and workouts it has queued to the device (details)
openexpress baseline [--apply] marks current files as already uploaded (first run)
openexpress backup [--dest DIR] [--keep N] [--apply] local backup of the device's data (default Garmin/Backups in your Documents folder, or --dest; the newest 3 kept, or --keep N); a FIT file the device was still writing when it was connected is left out, and the summary says so
openexpress cache [--clear] [--only maps,updates] [--apply] size of the cache by part (maps, updates, pictures, answers, tiles, temp) and clearing it (see Cache)
openexpress updates [--reinstalls] the device's software updates (no login needed); --reinstalls also lists what can be installed again; a file the device already has with the same size and MD5 is listed as "already on the device" (details)
openexpress updates --install PART…|all [--apply] download with MD5 check and copy to the device, which installs the update once unplugged (details)
openexpress updates --install PART… --hidden-folder-trial [--apply] as --install, for updates whose folder a watch hides inside GARMIN, but the file it replaces is kept in hidden-folder-trial/ in openExpress's data folder (its SHA-256 printed) and the first refusal ends it; part numbers only, not all; the window does not offer it
openexpress maps [--all] installed maps and maps of your own; --all also those available for download (TopoActive, base maps, CourseView, Ski)
openexpress maps install NAME [--apply] install a map assigned to the device (download, activation, write)
openexpress maps install NAME --hidden-folder-trial [--apply] a trial: install a map whose files go to a folder the device hides from the file manager (a car navigator's .System), over a direct USB connection; see Maps on a car navigator
openexpress maps update [--apply], maps remove NAME [--apply] update and remove maps
openexpress maps add FILE.img [--name NAME] [--apply] copy a map of your own (e.g. made from OpenStreetMap data) to the device; never overwrites a file
openexpress maps remove --own NAME [--apply] remove a map of your own that was copied with maps add
openexpress apps [--builtin] Connect IQ apps on the device and in your Garmin account, available updates
openexpress apps install NAME [--allow-permissions] [--apply] install an app from your Garmin account; --allow-permissions allows the new permissions it asks for
openexpress apps update [--allow-permissions] [--apply] update every installed app that has an update
openexpress apps remove NAME [--forget] [--apply] remove an app; --forget also from your Garmin account's app list
openexpress apps enable|disable NAME [--type TYPE] [--apply] turn an app or a built-in activity on or off; --type (app, widget, watch-face, data-field, music-app, activity) picks the entry when two share a name
openexpress apps order [--from COPY] [--all] [--apply] put apps and widgets back in the order of a saved copy of the app list; without --from it lists the copies with how many apps each would move, --all lists every position that would change
openexpress primary [--wearable], primary set [--wearable] [--apply] the account's primary training device, with --wearable its primary wearable (steps and sleep); set makes the connected device the primary training device (the main source of performance and training data in Garmin Connect, as set says first), set --wearable the primary wearable
openexpress sensors the sensors on your Garmin account (a heart rate strap, a Varia, a power meter…) with their batteries and when each was last connected, low batteries first; no device needed, the account does not say which device a sensor is paired with (details)
openexpress solar [--days N] for each device of your Garmin account that charges from the sun: the activity time the sun added today, in the last N days (7 by default, at most 31) and day by day (details)
openexpress courses experimental: the courses on the connected device, the GPX files waiting to become courses and the saved locations (details)
openexpress courses add FILE.gpx [--name COURSE] [--apply] experimental: copy a GPX file to Garmin/NewFiles, where the device turns it into courses when it is unplugged (details)
openexpress courses remove NAME [--apply] experimental: remove one course or one GPX file waiting for the device (details)
openexpress register [--apply] experimental: add the connected device to the Garmin account you are signed in to (details)
openexpress music music, podcasts and audiobooks on the device, playlists, free space
openexpress music add PATH… [--as track|podcast|audiobook] [--playlist NAME] [--apply] copy files (music as Artist/Album, podcasts and audiobooks by album); --playlist also makes a playlist of them
openexpress music playlist FILE.m3u [--name NAME] [--apply], music remove TEXT… [--apply] write a playlist as .m3u8; remove files whose name, artist or album folder matches TEXT (at least 3 characters)
openexpress gui application window (GTK 4 + libadwaita): device, sync, updates, maps, apps, music, activities
openexpress watch background service: sync when a device is connected, with a notification
openexpress install-desktop [--remove] [--apply] the menu entry openExpress (source) and the systemd user service of the version from source (in the Flatpak it does nothing); first it removes what an older version from source wrote under the Flatpak's ID (only its own menu entries and the program's own icons); --remove removes them all

The NAME of an app is its name in the store or the one the device gives it (they can differ, as "My Bike Radar Traffic" and "MyBikeTraffic"), a part of either that only one app has, or its ID.

Options before the command:

  • --lang LANG: the language of this run;
  • -v: more detail;
  • --no-wait: fail at once instead of waiting for a device that is starting (see below);
  • --device-uri URI: one MTP device when several are connected;
  • --path DIR: a folder with a copy of a device's files instead of a device (diagnostics keeps what it copies of it apart from the device's own records);
  • --version.

--no-wait, --device-uri and --path also go after a command that opens a device (openexpress sync --device-uri URI). openexpress without a command opens the window.

All commands that change anything run in dry-run mode by default: they show the plan and do nothing without --apply. The exceptions are setup, login and logout, which change only openExpress's own configuration and login token, at once.

A Garmin device needs a moment to start after it is plugged in. Commands wait for it (up to 45 seconds) and the window shows that the device is starting; --no-wait makes a command fail at once instead.

While a sync, a backup or a write is running, the window shows Do not unplug the device and the command-line tool prints the same warning when it starts such an operation.

Long tasks (a sync, updates, maps, apps, music, a backup, diagnostic files) say how far they are in one line that updates in place, and the window in its bar at the bottom: what is done and to what (an update, a map, an app, a type of data), never a file name or a song, for example Copying music · 3 of 25 · 120.0 MB of 1.2 GB.

Command details

activities

openexpress activities [--limit N | --all] [--backups DIR] lists the activities of the connected device (also one connected as a USB drive) and of its backups. Nothing is written.

  • Each with its date, sport, time (pauses left out), distance, ascent, source (the device, or the backup of a date) and file name, the newest first.
  • Activities only in a backup come after the device's; one the device still has is read from the device.
  • The newest 30 by default, --limit N the newest N, --all every one.
  • Backups are read from Garmin/Backups in your Documents folder, or from --backups DIR.
  • A file the device was still writing, a damaged file and one that cannot be read say so.
  • The page of an activity (its map, charts, laps, zones and details) is in the window only.

activities export

openexpress activities export NAME… [--dest DIR] [--backups DIR] [--apply] writes activities as GPX 1.1 files.

  • NAME is the file name the list shows (from the device, or from a backup when only a backup has it).
  • Each point has its position, elevation and time in UTC, nothing else: no heart rate, no device, no serial number.
  • The file is named YYYY-MM-DD HH.MM Sport.gpx (the start in local time) and goes to Garmin/GPX in your Documents folder or to --dest DIR. In the Flatpak --dest must be within Garmin in your Documents folder.
  • A dry run names the files; --apply writes them. A file that is there is never overwritten.
  • Nothing is written unless every activity named can be: an activity without GPS positions, one the device was still writing, a name not found or a file that is already there makes the command stop with exit code 1 and say which.

activities journal

openexpress activities journal [--all] [--delete] [--apply] shows the activity journal of the connected device: what this computer keeps of each of its activities, so that the Activities page can show them after the device deleted their files (an Edge 1050 keeps about 200 and deletes the oldest). See The activity journal for what it holds.

  • It is kept only after your yes: the card on the Activities page, the switch Keep an Activity Journal in Preferences or openexpress setup --activity-journal on (off stops it; what it holds stays until you delete it).
  • It is written when a device is opened in the window, after a background sync and after openexpress sync --apply; never by this command, info, status or activities. A device on another Garmin Connect account than yours gets none.
  • It says how many activities it holds, since when, its size, and its gaps: spans whose activities the device may have deleted before the journal read them.
  • --all: the journal of every device on this computer, the device connected or not.
  • --delete names what it would delete; with --apply it deletes it (with --all every journal). The activities the device no longer keeps cannot be read again.

fit inspect

openexpress fit inspect FILE shows what a FIT file on this computer holds.

  • Its data type, manufacturer, product and creation time, its messages and how many of each, and whether it has developer data.
  • Whether it is whole: for a file cut short, how many bytes were read and how many its header declares. The exit code is 0 only for a whole FIT file.
  • Never the device's serial number.
  • In the Flatpak it reaches only Garmin in your Documents folder and, to read, Downloads and Music.

diagnostics

openexpress diagnostics [--crash-logs] [--dumps] [--free-space] [--apply] shows:

  • what the device logged as errors (the "Assert" entries an Edge writes at each start as their number; each of them with -v);
  • the crashes that restarted it, each once, from its error logs, its boot log, the copies on this computer and its log of connections; for a watch that hides its crash logs, a line saying they may hold more crashes until they are copied (--crash-logs --apply);
  • its memory dumps and the copies of its diagnostic files kept on this computer;
  • its log of connections: the newest five, and the storage by kind of file at the last.

--apply copies the files it shows now; with it, --crash-logs also reads its hidden crash logs over a direct USB connection (the device disappears from the file manager for a moment) and --dumps also copies its memory dumps.

--free-space is an action of its own (not with --crash-logs or --dumps): it shows only what can be freed on the device, the list of Free Up Space on the Device Status page (what it holds). With --apply it removes exactly those, each looked at again first, and does nothing else; what it removed is told also when it stops half-way (Ctrl+C).

What is read, copied and kept, and that nothing is sent: Diagnostics.

sync

openexpress sync uploads new FIT files to Garmin Connect and writes the courses and workouts Garmin Connect has queued to the device.

  • --all uploads everything on the first sync.
  • --upload-only and --download-only do one direction.
  • --type TYPE (repeatable) uploads only the data types named; files from Garmin Connect are still written.
  • --include-diagnostics also uploads the device's diagnostics (see Diagnostics).
  • A device connected as a USB drive is synced the same way when it can be (otherwise the command says why); its Connect IQ apps are left in Garmin Connect's queue, and the drive is ejected after a sync that wrote to it.
  • For a device whose Satellite Data are on (experimental, turned on on its device page in the window), a line says whether Garmin's current satellite data file was written, was already on the device or was not written and why; the dry run says whether it would be written. --upload-only leaves them out.

updates

openexpress updates [--reinstalls] lists the software updates Garmin's update server offers the connected device; --install PART…|all [--apply] downloads them, checks each by its MD5 and copies it to the device. After it is unplugged, the device may ask whether to install the update now or later, then restarts.

  • A file the device already has with the same size and MD5 is not counted as an update, only listed as "already on the device".
  • --reinstalls also lists what can be installed again. A component offered at a lower version than the device lists is installed again only when its file is the one offered, and the list says so.
  • An update whose folder a watch hides inside GARMIN from the file manager (on a fēnix 8: Prompts, ASR, KBD, ExtData) is written there over a direct USB connection, in the Flatpak with its USB permission; the file it replaces is copied to this computer first and put back when the new one is not written whole (Files on the device). Without that connection such an update is refused before anything is downloaded, and the others are installed.
  • On such a watch the check also reads, over a direct USB connection, the folder of each offered file the file manager does not show, once (as does status --online); a component found there with the name and size offered is listed as "already on the device".
  • On a car navigator that hides its .System folder from the file manager, that folder is read once over a direct USB connection (names and sizes); every command that opens such a device reads it once too, as does status --online, so that they count and compare what the window does. The updates that go there (and with --reinstalls the components installed again) are written as Garmin Express writes them: the old file of that name deleted first, the new one checked by its size and read back whole against its MD5. The device's other updates go first, its own software last, and the first failure stops the rest, saying what is on the device.

courses

openexpress courses (experimental) works only for a device that takes GPX files in Garmin/NewFiles. Nothing is written. It lists:

  • the courses on the connected device, each with its name, where it came from (openExpress or Garmin Connect, when that is known), its distance and ascent, and the day its file was made (for a course from Garmin Connect, the day Garmin Connect made the file when it sent the course, not the day the course was created there);
  • the GPX files copied to it that it has not turned into courses yet (it does when it is unplugged);
  • how many saved locations it keeps.

courses add

openexpress courses add FILE.gpx [--name COURSE] [--apply] (experimental) copies a GPX file to Garmin/NewFiles. When the device is unplugged, it turns each track and route of the file into a course and its waypoints into saved locations.

  • The dry run says the course's name, the file's name on the device, what the file holds, what the device does with it (a route's points are joined with straight lines, not roads) and the space; --apply copies it.
  • --name names the course, only for a file with one track or route: the name is written into the copy, nothing else of the file changes.
  • A file on the device is never overwritten.
  • In the Flatpak FILE must be in Downloads or in Garmin in your Documents folder.

courses remove

openexpress courses remove NAME [--apply] (experimental) removes one course or one GPX file waiting for the device.

  • NAME is its name or its file's, or a part of it that only one has; when several match, they are listed and nothing is removed.
  • The dry run says what is lost: the device keeps no other copy of a course; Garmin Connect can send its own again.

register

openexpress register [--apply] (experimental) adds the connected device to the Garmin account you are signed in to, as an active device, as Garmin Express adds one: for a device the account does not list, for example one registered only as a product on garmin.com.

  • The dry run says what would be sent (its GarminDevice.xml, which holds its Unit ID) and to which account (its name masked, as every command shows it).
  • --apply sends it, makes active a device Garmin keeps as retired, and reads the account's list again to check.
  • Nothing is written to the device, and the device's own Garmin Connect credentials in Garmin's answer are not kept.
  • A device is removed from an account only in Garmin Connect.

sensors and solar

Both only read your Garmin Connect account (signing in is needed; no device), one request each, kept a while (sensors 30 minutes, solar charging an hour; a sync asks anew), never asked again after an error or HTTP 429.

$ openexpress sensors
3 sensors on the Garmin account · 1 with a low battery
  Varia RTL515: Battery low · last connected 2 days ago
  HRM-Pro Plus: Battery 80% · last connected 3 h ago
  Speed Sensor 2: Battery good · last connected yesterday, 18:05
  • A sensor's battery is its percentage when the account gives one, else its state (good, new, OK, low, critical, charging).
  • A device charges from the sun when its entry on the account says so, or, for an entry that does not say, when its model's name says Solar. A day the account does not name gained 0.
$ openexpress solar
fēnix 8 Solar
  Activity time gained: today 35 min · last 7 days 4 h 10 min

Then a line for each day, the newest first: its date in the format of the language (YYYY-MM-DD in English) and the time gained. When the days asked gained under a minute in all (a winter week), one line says so instead:

$ openexpress solar
fēnix 8 Solar
  Activity time gained: under a minute in the last 7 days

Exit codes

Code Meaning
0 done (also a dry run)
1 an error or a refusal: the device, the account, a server or the network, or a value the command checks itself (e.g. an unknown part in cache --only); the message says why; for fit inspect, a file that is not a whole FIT file (cut short, damaged, not FIT) or cannot be read; for diagnostics --free-space --apply, a file the device kept, a copy that failed, files changed since they were listed, or the update server not asked again before an update file was removed (then none of those is removed)
2 a wrong command line: an unknown command or option, a value that is not one of the choices or not a number (e.g. setup --environment, devices --forget), --key without --secret, diagnostics --free-space with --crash-logs or --dumps, updates --hidden-folder-trial with --install all, or a missing argument
3 the first sync with this program waits for a choice: openexpress baseline --apply or openexpress sync --apply --all
130 interrupted (Ctrl+C); not while sync waits for TrueUp, which Ctrl+C only stops (the sync then ends as usual)