Getting Help and Version Information

Kent answers two questions without touching a database at all: what can it do, and what version is it.

kent help and kent --help

Both list every command and flag with a one-line description, and the output is identical either way. Type whichever comes more naturally.

$ kent help
kent works with Cordelia databases from the command line.

Usage:

    kent <command> [arguments]

The commands are:

    help
        print this message
    createdb <dbfilename>
        create an empty database, stamped with the schema version this build expects
    info <dbfilename>
        report the schema version and a row count for each table that holds rows
    details <dbfilename>
        as info, plus the tables it leaves out and the file's own attributes
    files <dbfilename>
        list the .FIT files the database was built from
    activities <dbfilename>
        list each recorded activity with its dates and sport
    sports <dbfilename>
        list the distinct sports and sub-sports present in the database
    verify <dbfilename>
        check the database's structure against the schema this build creates
    sqldump --in <dbfilename> [--out <outfile>] [--schema-only]
        write the database out as SQL that recreates it when replayed
    archive --in <dbfilename> --out <archive>
        write the database to a .kent archive, for other tools to read
    restore --in <archive> --out <dbfilename>
        rebuild a database from a .kent archive

The flags are:

    --version
        print kent's version, and the version of each library it was built against
    --devinfo
        the same, with each build's commit hash; quote this in a defect report
    --help
        print this message
    --license
        print the licence kent is distributed under
    --privacy
        print kent's privacy policy

See "man kent" for the full description of any command.

That listing is everything Kent can do. See Error Messages and Exit Codes for what happens when you try one, and the Product Roadmap for what may be added later.

It is also the listing to trust over this page. Kent generates it from its own command table, so it cannot describe a command Kent doesn't have.

kent --version

Prints Kent's own version, then one line for each library built into it. Kent uses Cordelia's database code, a shared SQLite layer, the archive library its .kent files use, and a shared base library. Two of those include outside libraries, and each one is listed right after the library that includes it: SQLite after the SQLite layer, and the two compression libraries after the archive library.

$ kent --version
kent version 1.3.4 uses
    cordelia 1.3.3
    curan 1.0.0
    SQLite 3.53.4
    regan 1.1.0
    zlib-ng 2.3.3
    minizip-ng 4.2.2
    goneril 1.4.1

Each number comes from that component's own build, so they move independently. A Kent built against a newer Cordelia reports the newer Cordelia version without Kent's own changing.

kent --devinfo

Prints the same list with a build identifier after each version, which pins down exactly which build of each component you have. The outside libraries show the same versions as above, because each is a fixed release.

$ kent --devinfo
kent version 1.3.4-d9c6caf76b uses
    cordelia 1.3.3-1f754c95d6
    curan 1.0.0-200cf6264e
    SQLite 3.53.4
    regan 1.1.0-4b4934c37f
    zlib-ng 2.3.3
    minizip-ng 4.2.2
    goneril 1.4.1-06a94fe891

This is the output to quote when reporting a problem. See Bug Reports and Feature Requests.

kent --license and kent --privacy

These two print a document and exit. --license prints the terms Kent is distributed under; --privacy prints its privacy policy, which in short is that Kent makes no network connections, collects nothing, and reads and writes only the paths you name on its own command line.

$ kent --license | less
$ kent --privacy | less

Both texts are compiled into the program from the same files the project publishes, so the copy Kent prints cannot drift from the copy on this site. See the License and the Privacy Policy.

Their text goes to standard output rather than standard error, because it is the output you asked for rather than a diagnostic. That is what makes the pipe into less above work.

Where the output goes

Most Kent commands print everything on standard output, error messages included, so redirecting standard output to a file captures a complete transcript:

$ kent info mydata.sqlite > report.txt

sqldump and archive are different, deliberately: everything they print, errors and advisories alike, goes to standard error instead. For sqldump that is essential, because with --out omitted the exported script itself occupies standard output, and a message printed there would be silently interleaved into it.

$ kent sqldump --in old.sqlite > old.sql   # only the script lands in the file
$ kent sqldump --in old.sqlite 2> errors.txt   # only the messages land here

An unhandled internal error also goes to standard error, from any command. Adding 2>&1 catches everything at once, which is worth doing when you're capturing output to attach to a bug report.

See also