1
1
mirror of https://github.com/ellie/atuin.git synced 2024-09-19 08:57:16 +03:00
atuin/docs/zh-CN
镜面王子 4375fa36e0
docs: Update sync.md (#1409)
Linux name correction
2023-11-22 08:42:52 +00:00
..
config.md Minor documentation updates (#767) 2023-03-08 20:20:39 +00:00
docker.md update zh-CN docs (#539) 2022-10-08 03:36:49 +00:00
import.md Add Chinese documentation translation & Fix spelling mistakes (#373) 2022-05-01 09:25:12 +01:00
k8s.md Move all references to the old repo (#1132) 2023-07-30 23:08:00 +01:00
key-binding.md update zh-CN docs (#539) 2022-10-08 03:36:49 +00:00
list.md docs: Remove human short flag from docs, duplicate of help -h (#663) 2023-01-11 21:36:51 +00:00
README.md docs: fix "From source" cd command (#937) 2023-05-06 14:35:24 +00:00
search.md docs: Remove human short flag from docs, duplicate of help -h (#663) 2023-01-11 21:36:51 +00:00
server.md update zh-CN docs (#539) 2022-10-08 03:36:49 +00:00
shell-completions.md Add Chinese documentation translation & Fix spelling mistakes (#373) 2022-05-01 09:25:12 +01:00
stats.md Add Chinese documentation translation & Fix spelling mistakes (#373) 2022-05-01 09:25:12 +01:00
sync.md docs: Update sync.md (#1409) 2023-11-22 08:42:52 +00:00

神奇的 shell 历史记录


English | 简体中文

Atuin 使用 SQLite 数据库取代了你现有的 shell 历史,并为你的命令记录了额外的内容。此外,它还通过 Atuin 服务器,在机器之间提供可选的、完全加密的历史记录同步功能。

animated

显示退出代码、命令持续时间、上次执行时间和执行的命令

除了搜索 UI它还可以执行以下操作

# 搜索昨天下午3点之后记录的所有成功的 `make` 命令
atuin search --exit 0 --after "yesterday 3pm" make

你可以使用我(ellie)托管的服务器,也可以使用你自己的服务器!或者干脆不使用 sync 功能。所有的历史记录同步都是加密,即使我想,也无法访问你的数据。且我真的不想。

功能

  • 重新绑定 upctrl-r 的全屏历史记录搜索UI界面
  • 使用 sqlite 数据库存储 shell 历史记录
  • 备份以及同步已加密的 shell 历史记录
  • 在不同的终端、不同的会话以及不同的机器上都有相同的历史记录
  • 记录退出代码、cwd、主机名、会话、命令持续时间等等。
  • 计算统计数据,如 "最常用的命令"。
  • 不替换旧的历史文件
  • 通过 Alt-<num> 快捷键快速跳转到之前的记录
  • 通过 ctrl-r 切换过滤模式;可以仅从当前会话、目录或全局来搜索历史记录

文档

支持的 Shells

  • zsh
  • bash
  • fish

社区

Atuin 有一个 Discord 社区, 可以在 这里 获得

快速开始

使用默认的同步服务器

这将为您注册由我托管的默认同步服务器。 一切都是端到端加密的,所以你的秘密是安全的!

阅读下面的更多信息,了解仅供离线使用或托管您自己的服务器。

bash <(curl https://raw.githubusercontent.com/ellie/atuin/main/install.sh)

atuin register -u <USERNAME> -e <EMAIL> -p <PASSWORD>
atuin import auto
atuin sync

使用活跃图

除了托管 Atuin 服务器外,还有一个服务可以用来生成你的 shell 历史记录使用活跃图!这个功能的灵感来自于 GitHub 的使用活跃图。

例如,这是我的:

如果你也想要,请在登陆你的同步服务器后,执行

curl https://api.atuin.sh/enable -d $(cat ~/.local/share/atuin/session)

执行结果为你的活跃图 URL 地址。可以共享或嵌入这个 URL 地址令牌token不是加密的,只是用来防止被枚举攻击。

仅离线 (不同步)

bash <(curl https://raw.githubusercontent.com/ellie/atuin/main/install.sh)
            
atuin import auto

安装

脚本 (推荐)

安装脚本将帮助您完成设置,确保您的 shell 正确配置。 它还将使用以下方法之一在可能的情况下首选系统包管理器pacman、homebrew 等)。

# 不要以root身份运行如果需要的话会要求root。
bash <(curl https://raw.githubusercontent.com/ellie/atuin/main/install.sh)

然后可直接看 Shell 插件

通过 cargo

最好使用 rustup 来设置 Rust 工具链,然后你就可以运行下面的命令:

cargo install atuin

然后可直接看 Shell 插件

Homebrew

brew install atuin

然后可直接看 Shell 插件

MacPorts

Atuin 也可以在 MacPorts 中找到

sudo port install atuin

然后可直接看 Shell 插件

Pacman

Atuin 在 Arch Linux 的 社区存储库 中可用。

pacman -S atuin

然后可直接看 Shell 插件

从源码编译安装

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

然后可直接看 Shell 插件

Shell 插件

安装二进制文件后,需要安装 shell 插件。 如果你使用的是脚本安装,那么这一切应该都会帮您完成!

zsh

echo 'eval "$(atuin init zsh)"' >> ~/.zshrc

或使用插件管理器:

zinit load ellie/atuin

bash

我们需要设置一些钩子hooks, 所以首先需要安装 bash-preexec :

curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc

然后设置 Atuin

echo 'eval "$(atuin init bash)"' >> ~/.bashrc

fish

添加

atuin init fish | source

~/.config/fish/config.fish 文件中的 is-interactive 块中

Fig

通过 Fig 可为 zsh bash 或 fish 一键安装 atuin 脚本插件。

...这个名字是什么意思?

Atuin 以 "The Great A'Tuin" 命名, 这是一只来自 Terry Pratchett 的 Discworld 系列书籍的巨龟。