Listing Activities with activities

kent activities lists what a database actually recorded, one row per session: when it started, when it ended, and what sport it was.

It is read-only. Where info counts rows and files lists the imports, this answers the question a person usually has first, which is what is in here.

Synopsis

kent activities <dbfilename>

What it shows

$ kent activities mydata.sqlite
Database:  mydata.sqlite

#   Started              Ended                Sport    Sub-sport
1   2026-08-01T09:35:42  2026-08-01T10:05:46  Running  Generic
2   2026-08-03T08:26:57  2026-08-03T08:55:50  Running  Generic
3   2026-08-04T08:11:32  2026-08-04T08:40:54  Running  Generic
...
23  2026-08-27T09:28:00  2026-08-27T09:58:12  Running  Generic
24  2026-08-28T08:41:09  2026-08-28T09:10:30  Running  Generic
25  2026-08-29T09:37:23  2026-08-29T10:05:16  Running  Generic
ColumnWhat it is
#The session's number in this database, in the order the sessions are stored.
StartedWhen the session began.
EndedThe session's own recorded timestamp, which a device writes when the session stops. It is not calculated from the start time and a duration.
SportThe sport the device recorded, such as Running or Swimming.
Sub-sportThe narrower category, such as Generic or Lap Swimming. Devices vary in how specific they are.

One row per session, not per file. A single .FIT file can hold more than one session, and a multi-sport activity records one session per leg, so a database of ten files can list more than ten activities.

A database with no activities

A database created but never imported into prints a plain statement and succeeds. No activities is an answer, not a failure:

$ kent createdb mydata.sqlite
$ kent activities mydata.sqlite
Database:  mydata.sqlite

No activities recorded.
$ echo $?
0

In a script, test the exit code to find out whether Kent could read the database, not whether it found anything.

A path that does not exist is reported as missing and is not created:

$ kent activities nope.sqlite
kent activities: nope.sqlite does not exist
$ echo $?
1

An older database is refused

Like info, details and files, this reads specific named columns, so a database older than this build expects is refused with an explanation rather than a raw SQLite error:

$ kent activities old.sqlite
kent activities: this database reports schema version 1, older than the version 2 this build of cordelia expects. Use `kent sqldump` to export it instead
$ echo $?
1

What it is not

activities lists the sessions. It does not show the data inside them, and it has no filtering or sorting: it prints the whole list. To read the records themselves, see kent archive, or open the database in Cordelia. For the distinct sports alone, see kent sports.

See also