Magical shell history
Go to file
Ellie Huxtable d63b0110ea Bump to 0.6.1
Includes latest bugfixes and performance improvements

atuin@0.6.1
atuin-client@0.6.1
atuin-common@0.6.1
atuin-server@0.6.1
2021-04-21 21:28:10 +01:00
.github Switch to Warp + SQLx, use async, switch to Rust stable (#36) 2021-04-20 16:07:11 +00:00
atuin-client Bump to 0.6.1 2021-04-21 21:28:10 +01:00
atuin-common Bump to 0.6.1 2021-04-21 21:28:10 +01:00
atuin-server Bump to 0.6.1 2021-04-21 21:28:10 +01:00
migrations Add history sync, resolves #13 (#31) 2021-04-13 19:14:07 +01:00
src Bugfixes, show time ago, perf improvements 2021-04-21 21:26:44 +01:00
.dockerignore Optimise docker (#34) 2021-04-14 17:40:50 +00:00
.gitignore Use cargo workspaces (#37) 2021-04-20 20:53:07 +00:00
Cargo.lock Bump to 0.6.1 2021-04-21 21:28:10 +01:00
Cargo.toml Bump to 0.6.1 2021-04-21 21:28:10 +01:00
diesel.toml Implement server (#23) 2021-03-21 20:04:39 +00:00
Dockerfile Bugfixes, show time ago, perf improvements 2021-04-21 21:26:44 +01:00
LICENSE Create LICENSE 2021-02-14 16:22:25 +00:00
README.md Optimise docker (#34) 2021-04-14 17:40:50 +00:00

A'Tuin

Through the fathomless deeps of space swims the star turtle Great ATuin, bearing on its back the four giant elephants who carry on their shoulders the mass of the Discworld.

A'Tuin manages and synchronizes your shell history! Instead of storing everything in a text file (such as ~/.history), A'Tuin uses a sqlite database. While being a little more complex, this allows for more functionality.

As well as the expected command, A'Tuin stores

  • duration
  • exit code
  • working directory
  • hostname
  • time
  • a unique session ID

Supported Shells

  • zsh

Install

AUR

A'Tuin is available on the AUR

yay -S atuin # or your AUR helper of choice

With cargo

atuin needs a nightly version of Rust + Cargo! It's best to use rustup for getting set up there.

rustup default nightly

cargo install atuin

From source

rustup default nightly
git clone https://github.com/ellie/atuin.git
cd atuin
cargo install --path .

Shell plugin

Once the binary is installed, the shell plugin requires installing. Add

eval "$(atuin init)"

to your .zshrc/.bashrc/whatever your shell uses.

Usage

By default A'Tuin will rebind ctrl-r and the up arrow to search your history.

You can prevent this by putting

export ATUIN_BINDKEYS="false"

into your shell config.

Import history

atuin import auto # detect shell, then import

or

atuin import zsh  # specify shell

List history

List all history

atuin history list

List history for the current directory

atuin history list --cwd

atuin h l -c # alternative, shorter version

List history for the current session

atuin history list --session

atuin h l -s # similarly short

Stats

A'Tuin can calculate statistics for a single day, and accepts "natural language" style date input, as well as absolute dates:

$ atuin stats day last friday

+---------------------+------------+
| Statistic           | Value      |
+---------------------+------------+
| Most used command   | git status |
+---------------------+------------+
| Commands ran        |        450 |
+---------------------+------------+
| Unique commands ran |        213 |
+---------------------+------------+

$ atuin stats day 01/01/21 # also accepts absolute dates

It can also calculate statistics for all of known history:

$ atuin stats all

+---------------------+-------+
| Statistic           | Value |
+---------------------+-------+
| Most used command   |    ls |
+---------------------+-------+
| Commands ran        |  8190 |
+---------------------+-------+
| Unique commands ran |  2996 |
+---------------------+-------+

Config

A'Tuin is configurable via TOML. The file lives at ~/.config/atuin/config.toml, and looks like this:

[local]
dialect = "uk" # or us. sets the date format used by stats
server_address = "https://atuin.elliehuxtable.com/" # the server to sync with

[local.db]
path = "~/.local/share/atuin/history.db" # the local database for history

...what's with the name?

A'Tuin is named after "The Great A'Tuin", a giant turtle from Terry Pratchett's Discworld series of books.