-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimize output & bump version to v0.4.1
- Loading branch information
Showing
7 changed files
with
65 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
demo.* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,67 @@ | ||
<p align="right"> | ||
<a href="./README.md">English</a> / 简体中文 | ||
# cmd-wrapped | ||
|
||
<p> | ||
<img alt="Stars" src="https://img.shields.io/github/stars/YiNNx/cmd-wrapped?style=flat-square&color=68BDB7&labelColor=444B5A"> | ||
| ||
<img alt="Release" src="https://img.shields.io/github/v/release/YiNNx/cmd-wrapped?style=flat-square&color=93AF63&labelColor=444B5A"> | ||
| ||
<img alt="Release" src="https://img.shields.io/crates/v/cmd-wrapped.svg?style=flat-square&color=C5AB81&labelColor=444B5A"> | ||
| ||
</p> | ||
<div align="center"> | ||
<h1>cmd-wrapped</h1> | ||
<p>👩💻 Rust-Based Unix Shell History Analyzer<br/><p/> | ||
<div> | ||
<img alt="Stars" src="https://img.shields.io/github/stars/YiNNx/cmd-wrapped?style=flat-square&color=87e3dd&labelColor=444B5A"> | ||
| ||
<img alt="Release" src="https://img.shields.io/github/v/release/YiNNx/cmd-wrapped?style=flat-square&color=87e3dd&labelColor=444B5A"> | ||
</div> | ||
</div> | ||
|
||
一个用于查看 shell 历史记录统计信息的 CLI,支持 zsh、bash、fish 和 atuin。 | ||
|
||
## Features | ||
<img src="https://github.com/user-attachments/assets/fa34598f-3b8c-4f90-8569-7724df787b1c" height="750" /> | ||
|
||
- 生成过去一年中的命令行活跃分布,如每日最活跃时段,以及常用命令统计。 | ||
- 类 Github 的年度命令分布图 | ||
- 支持: | ||
- zsh | ||
- bash | ||
- fish | ||
- atuin | ||
## 安装 | ||
|
||
## 如何使用 | ||
|
||
### 安装 | ||
|
||
- #### 使用 [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) 安装 | ||
- **使用 [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)** | ||
|
||
```shell | ||
cargo install cmd-wrapped | ||
``` | ||
|
||
- #### 从 [Release](https://github.com/YiNNx/cmd-wrapped/releases/latest) 下载 | ||
- **从 [Release](https://github.com/YiNNx/cmd-wrapped/releases/latest) 下载** | ||
|
||
下载对应包并解压,在命令行中运行(可能需要 chmod) | ||
解压,赋予执行权限,然后在终端中运行二进制文件。 | ||
|
||
- #### Nix❄️ | ||
- **Archlinux** | ||
|
||
```nix | ||
nix run nixpkgs#cmd-wrapped | ||
```shell | ||
yay -S cmd-wrapped | ||
``` | ||
|
||
- #### Arch | ||
- **Nix❄️** | ||
|
||
```shell | ||
yay -S cmd-wrapped | ||
```nix | ||
nix run nixpkgs#cmd-wrapped | ||
``` | ||
|
||
### 参数 | ||
## 使用 | ||
|
||
```shell | ||
# fetch current stats | ||
```sh | ||
# 获取当前统计数据 | ||
cmd-wrapped | ||
|
||
# fetch annual shell history stats for a specific year | ||
# 获取特定年份的年度 shell 历史统计数据 | ||
cmd-wrapped 2024 | ||
|
||
# specify the target shell | ||
# 指定目标 shell | ||
cmd-wrapped -s <shell> | ||
``` | ||
|
||
所支持的 `<shell>` 选项:`zsh`, `bash`, `fish`, `atuin`. | ||
对 `<shell>` 支持的选项:`zsh`、`bash`、`fish`、`atuin`。 | ||
|
||
> [!NOTE] | ||
> | ||
> 对于某些命令行环境,可能无法输出正确的数据 (比如 [所有数据都为 0](https://github.com/YiNNx/cmd-wrapped/issues/3) ). 这是因为 Zsh / Bash 只有配置了对应的选项后,才会记录下你每一条命令对应的时间: | ||
> 在某些情况下,cmd-wrapped 可能无法输出正确的数据(例如 [所有输出均为 0](https://github.com/YiNNx/cmd-wrapped/issues/3))。这是因为它依赖于每个命令的时间戳记录,有时需要额外配置特定选项: | ||
> | ||
> - Zsh - [EXTENDED_HISTORY](https://zsh.sourceforge.io/Doc/Release/Options.html#History) (oh-my-zsh 则会默认开启此选项) | ||
> - Bash - [HISTTIMEFORMAT](https://www.gnu.org/software/bash/manual/bash.html#index-HISTTIMEFORMAT) | ||
> - 对于 Zsh - [EXTENDED_HISTORY](https://zsh.sourceforge.io/Doc/Release/Options.html#History)(oh-my-zsh 默认启用) | ||
> - 对于 Bash - [HISTTIMEFORMAT](https://www.gnu.org/software/bash/manual/bash.html#index-HISTTIMEFORMAT) | ||
> | ||
> 在没有配置选项前的命令,对应的命令时间不会被持久化记录,因此 cmd-wrapped 也无法获取并生成对应的数据分析。如果运行 cmd-wrapped 发现无法输出正确的数据,也许只能现在配置好选项等待明年来用了 :P | ||
> **在配置选项之前执行的命令将不会记录时间戳,这将影响 cmd-wrapped 的统计数据**。 | ||
## 致谢 & 开源协议 | ||
## 致谢与许可证 | ||
|
||
- 感谢 [@jyi2ya](https://github.com/jyi2ya) 的绝妙想法! | ||
- 开源协议: [MIT](https://github.com/YiNNx/cmd-wrapped/blob/master/LICENSE) | ||
- 特别感谢 [@jyi2ya](https://github.com/jyi2ya) 的绝妙想法! | ||
- 许可证:[MIT](https://github.com/YiNNx/cmd-wrapped/blob/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters