Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,014 changes: 990 additions & 24 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@ chrono = "0.4.45"
clap = { version = "4.6.6", features = ["derive"] }
crossterm = "0.29.0"
dirs = "7.0.0"
flate2 = "1.1.9"
gethostname = "1.1.0"
memchr = "2.8.3"
portable-pty = "0.9.0"
ratatui = "0.30.2"
regex = "1.13.1"
reqwest = { version = "0.12.28", default-features = false, features = ["blocking", "json", "rustls-tls-native-roots"] }
rusqlite = { version = "0.40.2", features = ["bundled"] }
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
strip-ansi-escapes = "0.2.1"
sha2 = "0.10.9"
tar = "0.4.44"
toml = "1.1.5"
ulid = { version = "3.0.0", features = ["serde"] }
unicode-width = "0.2.2"
zstd = "0.14.0"
zip = { version = "8.2.0", default-features = false, features = ["deflate"] }

[target.'cfg(unix)'.dependencies]
libc = "0.2.182"
signal-hook = "0.4.4"

[target."cfg(windows)".dependencies]
sysinfo = { version = "0.39.6", default-features = false, features = ["system"] }
sysinfo = { version = "=0.38.0", default-features = false, features = ["system"] }
windows-sys = { version = "0.60", features = ["Win32_Foundation", "Win32_System_Console"] }
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ install -Dm755 target/release/recall ~/.local/bin/recall # Linux/macOS
On Windows the binary is `target\release\recall.exe`; copy it somewhere on
`PATH`. Make sure the install directory is on `PATH`.

### Update

```sh
recall update
```

`recall update` downloads the latest stable GitHub Release for the current
platform, shows download progress, verifies its SHA-256 checksum, and replaces
the running binary. Use `recall update --check` to check without installing.
The history TUI checks for stable updates at most once every 24 hours and shows
an available update in its status bar.

### Uninstall

```sh
Expand Down
10 changes: 10 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ install -Dm755 target/release/recall ~/.local/bin/recall # Linux/macOS

Windows 上二进制为 `target\release\recall.exe`,把它复制到 `PATH` 中的目录即可。

### 更新

```sh
recall update
```

`recall update` 会下载当前平台的最新稳定版 GitHub Release,展示下载进度、校验
SHA-256,然后替换正在运行的二进制。使用 `recall update --check` 仅检查更新。
历史 TUI 每 24 小时最多检查一次稳定版更新,并在状态栏显示更新提示。

### 卸载

```sh
Expand Down
9 changes: 9 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub enum Command {
Doctor,
/// Drop stored output older than the retention window.
Prune,
/// Download and install the latest stable release.
Update(UpdateArgs),
/// Show or locate the configuration file.
Config(ConfigArgs),
/// Print a fresh recall id.
Expand Down Expand Up @@ -125,6 +127,13 @@ pub struct ConfigArgs {
pub action: ConfigAction,
}

#[derive(Debug, Args)]
pub struct UpdateArgs {
/// Check for an update without downloading it.
#[arg(long)]
pub check: bool,
}

#[derive(Debug, Subcommand)]
pub enum ConfigAction {
/// Print the configuration file path.
Expand Down
10 changes: 9 additions & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod init;
mod proxy;
mod record;
mod shell;
mod update;

use anyhow::Result;

Expand All @@ -26,6 +27,7 @@ pub fn run(cli: Cli) -> Result<()> {
Some(Command::Import(args)) => import::run(args),
Some(Command::Doctor) => doctor::run(),
Some(Command::Prune) => prune(),
Some(Command::Update(args)) => update::run(args),
Some(Command::Config(args)) => config(args),
Some(Command::Uuid) => {
println!("{}", new_id());
Expand Down Expand Up @@ -69,7 +71,13 @@ fn prune() -> Result<()> {

fn search(args: SearchArgs) -> Result<()> {
let config = Config::load()?;
let code = crate::tui::run(args, config)?;
let update_check = update::startup_check();
let code = crate::tui::run(
args,
config,
update_check.initial_notice,
update_check.refreshed_notice,
)?;
if code != 0 {
std::process::exit(code);
}
Expand Down
Loading
Loading