$ show atuinsh/atuin
Atuin is a multi-crate Rust workspace implementing a shell history replacement tool with encrypted sync, a background daemon, a self-hosted server, and an AI assistant. The system replaces the default shell history with a SQLite database that records additional context (exit codes, working directories, session IDs, command durations) and provides fast, fuzzy search via a TUI. History is captured through shell hooks (bash, zsh, fish, nushell, xonsh, PowerShell) and optionally via a PTY proxy that captures command output for full-text search. A background daemon (atuin-daemon) manages history journaling, output capture persistence (Fjall blob store + SQLite FTS5 index), AI session capture from coding agents (Claude Code, Codex, opencode, Pi), and encrypted record sync with the server. The server (atuin-server) is an Axum HTTP application supporting SQLite, Postgres, and MySQL backends, providing user authentication, record sync endpoints, and capability negotiation. The AI subsystem (atuin-ai) includes a TUI chat interface, inline command mode, MCP server, skills system, and permissions framework for safe tool execution. Key entry points include the CLI binary (crates/atuin/src/main.rs), daemon boot (crates/atuin-daemon/src/daemon.rs), server launch (crates/atuin-server/src/bin/main.rs), and AI inline command (crates/atuin-ai/src/commands/inline.rs). External dependencies include SQLite, tokio, tonic (gRPC), Axum, serde, paseto, and various shell-specific integrations.
The LLM identified 4 files worth highlighting for reuse:
Provides a capped thread pool for offloading blocking operations in async contexts, with graceful shutdown and task cancellation. Reusable in any async Rust application needing to run blocking code without starving the async runtime.
Implements a sharded mutex that distributes lock contention across multiple internal mutexes based on a hash of the key, reducing lock contention in high-concurrency scenarios. Reusable for any concurrent data structure requiring fine-grained locking.
Provides configurable retry with exponential backoff and jitter, supporting async, sync, and blocking modes. Includes retry_forever for unbounded retries. Reusable for any operation that needs resilient retry logic.
Generic clamped integer type with compile-time min/max bounds and a default value, with serde support and JSON schema generation. Reusable for configuration values that must be within a specific range.