Chet is a friendly big brother

See what is slowing you down by measuring your commands.

What does it do?

Chet times how long your command run that prefix with chet. It then stores how long the command took to run along with some other info such as your OS, git repo info, and if you're running the command in a container. Chet stores the info in SQLite DB so you can find places to speed up your workflow.

How do I get started?

Just Download Chet , add it to your path, and give it a try!

What if I have any issues?

Please let us know by creating an issue or check out the repo and open a PR

You can also hop on Discord for any questions.

How to use it?

When you prefix a command with chet, it will time how long it takes to run it and store it in a local SQLite database. In addition to the timing and the command, chet will grab some extra information depending if you are running it in a git repo. Here is what chet will record.

Column Description
label The label is a shortened version of the full command. For example, pytest path/to/test_foo.py::TestClass::test_method would become pytest.
cmd The full command
duration The amount of time in milliseconds
repo The URL of the git repo when it exists
branch The current branch when it exists
username The git user's email
os The operating system based on the Go GOOS
container A boolean to describe if the command was run in a container

Be aware that chet records the command, including whatever flags and arguments! If there are any secrets you want to avoid being stored in the chet database, don't pass them as flags or arguments!

Querying the Database

The database file is .chet.db and is in your home directory. You can connect with the sqlite3 command if you prefer. Chet also has a report command that will output a simple report with some aggregations.

Chet has two query commands, query and sql.

The query command uses a simple gmail like syntax to select the records that you want to see. The format is:

$ chet column:match [order by column asc|desc]
Adding more than one column acts as an AND in SQL terms.

The sql command allows running SQL directly on your local ~/.chet.db. For example:

$ chet sql "select count(*) from records where branch != 'refs/heads/main'"

That sounds handy dandy! Can my whole team use it?

Yes! You can signup/login to get a client id and secret you use with your chet cli app.

$ chet config --client-id $CHET_CLIENT_ID --client-secret $CHET_CLIENT_SECRET

Just share your client id/secret with your team and all the command recordings will be available on the chet.monster.

The API is really simple, so it is easy enough to make your own endpoint to meet your needs.

Why did you write this?

Over the years with the growth of cloud, containers, and the normalization of CI/CD, we've noticed that engineers pay less attention to optimizing their local development. The result is that we've seen developers wasting time waiting for builds, tests, etc. using containers and CI/CD. The hope is that chet might help contextualize where things could be sped up locally, to help make the local feedback loop that much faster and help identify when it is a good time to optimize the CI/CD systems.