1
1
mirror of https://github.com/ellie/atuin.git synced 2024-09-11 21:18:22 +03:00
atuin/README.md

130 lines
3.2 KiB
Markdown
Raw Normal View History

2021-02-13 15:55:53 +03:00
<h1 align="center">
A'tuin
</h1>
<blockquote align="center">
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.
</blockquote>
2021-02-14 19:23:08 +03:00
<p align="center">
<a href="https://github.com/ellie/atuin/actions?query=workflow%3ARust"><img src="https://img.shields.io/github/workflow/status/ellie/atuin/Rust?style=flat-square" /></a>
<a href="https://crates.io/crates/atuin"><img src="https://img.shields.io/crates/v/atuin.svg?style=flat-square" /></a>
<a href="https://crates.io/crates/atuin"><img src="https://img.shields.io/crates/d/atuin.svg?style=flat-square" /></a>
<a href="https://github.com/ellie/atuin/blob/main/LICENSE"><img src="https://img.shields.io/crates/l/atuin.svg?style=flat-square" /></a>
</p>
2021-02-13 15:55:53 +03:00
2021-02-14 00:21:00 +03:00
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.
2021-02-13 23:21:49 +03:00
2021-02-14 00:21:00 +03:00
As well as the expected command, A'tuin stores
2021-02-13 23:21:49 +03:00
- duration
- exit code
- working directory
- hostname
- time
- a unique session ID
2021-02-13 23:54:35 +03:00
## Install
2021-02-15 02:33:14 +03:00
### AUR
A'tuin is available on the [AUR](https://aur.archlinux.org/packages/atuin/)
```
yay -S atuin # or your AUR helper of choice
```
### With cargo
2021-02-14 21:20:18 +03:00
`atuin` needs a nightly version of Rust + Cargo! It's best to use
2021-02-14 00:21:00 +03:00
[rustup](https://rustup.rs/) for getting set up there.
2021-02-13 23:54:35 +03:00
2021-02-14 21:20:18 +03:00
```
rustup default nightly
2021-02-15 02:33:14 +03:00
cargo install atuin
2021-02-14 21:20:18 +03:00
```
2021-02-15 02:33:14 +03:00
### From source
2021-02-13 23:54:35 +03:00
```
2021-02-15 02:33:14 +03:00
rustup default nightly
git clone https://github.com/ellie/atuin.git
cd atuin
cargo install --path .
2021-02-13 23:54:35 +03:00
```
2021-02-15 02:33:14 +03:00
### Shell plugin
2021-02-14 00:21:00 +03:00
Once the binary is installed, the shell plugin requires installing:
2021-02-13 23:54:35 +03:00
2021-02-14 00:21:00 +03:00
zplug:
2021-02-13 23:54:35 +03:00
2021-02-14 00:21:00 +03:00
```
2021-02-14 02:06:59 +03:00
zplug "ellie/atuin", at:main
2021-02-14 00:21:00 +03:00
```
2021-02-13 23:54:35 +03:00
2021-02-14 02:22:58 +03:00
otherwise, clone the repo and `source /path/to/repo/atuin.plugin.zsh` in your `.zshrc`
2021-02-13 23:54:35 +03:00
## Usage
By default A'tuin will rebind ctrl-r to use fzf to fuzzy search your history. You
can specify a different fuzzy tool by changing the value of `ATUIN_FUZZY`:
```
export ATUIN_FUZZY=fzy
```
2021-02-13 23:54:35 +03:00
### Import history
```
atuin import auto # detect shell, then import
or
2021-02-13 23:54:35 +03:00
atuin import zsh # specify shell
```
### List history
```
atuin history list
```
2021-02-14 00:21:00 +03:00
2021-02-15 01:47:22 +03:00
### 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 |
+---------------------+-------+
```
2021-02-14 00:21:00 +03:00
## ...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.