# **ducktrace-tui**
A terminal user interface for browsing logs and managing services β aiming to provide both good UX as well as DX.
## **Features**
- **π Browse local log files** *(default ~/.config/duckTrace/)*
- **π Secure network support - using SSH**
- **βοΈ List and view logs of system and user services** *(via journalctl)*
- **π Scroll through logs with arrow keys, PageUp/Down**
- **ποΈ Follow logs in realβtime** *(tail)*
- **π οΈ Start, stop, restart services**
- **π¦ Works seamlessly with:**
- [ducktrace-loggger](https://github.com/quackhack-mcblindy/ducktrace-logger) *(Rust apps)*
- [ducktrace-python](https://github.com/quackhack-mcblindy/ducktrace-python) *(Python apps)*
- [ducktrace-sh](https://github.com/quackhack-mcblindy/ducktrace-sh) *(Bash scripts)*
- [sytemd](https://github.com/systemd/systemd) *(System & User service management)*
<br>
## **Installation**
#### **NixOS (using flakes)**
Add the flake input and overlay to your configuration:
```nix
{
inputs.ducktrace-tui.url = "github:QuackHack-McBlindy/ducktrace-tui";
outputs = { self, nixpkgs, ducktrace-tui, ... }: {
nixosConfigurations.myMachine = nixpkgs.lib.nixosSystem {
modules = [
{
environment.systemPackages = [
ducktrace-tui.packages.${system}.default
];
}
];
};
};}
```
#### **Build from source**
```bash
$ git clone https://github.com/QuackHack-McBlindy/ducktrace-tui
$ cd ducktrace-tui
$ cargo build --release
# Run the binary
./target/release/ducktrace-tui
```
## **Configuration**
The TUI respects these environment variables (they override defaults):
`$DT_LOG_PATH` β directory containing log files *(default: ~/.config/duckTrace/)*
`$DT_SSH_HOST` - hostname of the machine to browse logs on
`$DT_SSH_USER` - username to connect to
`DT_SSH_PORT` - SSH port to connect on *(default: 22)*
No other configuration is required β log files with the .log extension are automatically discovered.
## **Usage**
Run `ducktrace-tui` in your terminal.
#### **Keybindings**
| `Tab` | Switch focus between left (sources) and right (log) panels |
| `β` / `β` | Navigate sources or scroll log |
| `PageUp`/`PageDown` | Scroll log by page |
| `Enter` | Load selected source (file or service log) |
| `f` | Toggle follow mode (tail log) β right panel only |
| `a` | Show service actions (start/stop/restart) β left panel only |
| `s` / `t` / `r` | In action menu: start, stop, restart |
| `Esc` | Close popup (error or action menu) |
| `q` | Quit |
<br><br>
## **License**
**MIT**