pikpaktui
A TUI and CLI client for PikPak cloud storage, written in pure Rust with no external runtime dependencies.
| main | setting |
|---|---|
![]() |
![]() |
Features
Interactive TUI
- Three-column Miller layout — Parent / current / preview panes (Yazi-style), with optional two-column mode
- Thumbnail preview — Media files display thumbnail images directly in the terminal via native image protocols (Kitty, iTerm2, Sixel) using ratatui-image. Fallback modes: colored half-block rendering and grayscale ASCII art. Per-terminal protocol auto-detection with manual override
- Text preview — Syntax-highlighted code/text preview powered by syntect (base16-ocean.dark theme), supporting 50+ languages with line numbers
- Folder preview — Instant children listing in the preview pane; cached entries are reused when opening folders (zero extra API calls)
- File operations — Move, copy, rename, delete (trash or permanent), create folder, star/unstar
- Folder picker — Visual two-pane picker for move/copy destinations, with tab-completion text input as alternative
- Cart & batch download — Add files to cart, batch download with pause/resume/cancel, HTTP Range resume for interrupted transfers, download state persisted across sessions
- Download dashboard — Collapsed popup or expanded full-screen view with braille-character network activity graph, per-file progress, speed, ETA
- Offline download — Submit URLs/magnets for PikPak cloud download, view and manage tasks
- Sorting — eza-style
--sortsupport (name, size, created, type, extension, none) with--reverse; TUI keybindingsS/Rto cycle sort field and toggle order, persisted in config - Interactive settings — In-app settings editor (
,), custom RGB colors per file category, per-terminal image protocol configuration, sort settings - Mouse support — Click to select, double-click to open, scroll wheel navigation
CLI
- 20 subcommands —
ls,mv,cp,rename,rm,mkdir,download,upload,share,offline,tasks,star,unstar,starred,events,quota,vip,completions,help,version - Colored output —
lswith multi-column grid layout (eza-style),--sort/--reverseflags, Nerd Font icons support - Resumable transfer — Upload: dedup-aware instant upload on hash match, multipart resumable with 10 MB chunks via OSS. Download: HTTP Range resume for interrupted transfers
- Shell completions — Zsh completion with dynamic cloud path completion (like
scp)
General
- Pure Rust — Built with
ratatui+crossterm+reqwest(rustls-tls), no OpenSSL or C dependencies - Persistent sessions — Login once, session auto-refreshes via token refresh
- Cross-platform — Linux (x86_64 musl static), macOS Intel, macOS Apple Silicon
Install
Homebrew (macOS / Linux)
Cargo
From source
GitHub Releases
Pre-built binaries for Linux (x86_64, static musl), macOS Intel, and macOS Apple Silicon are available on the Releases page.
Shell Completions
Zsh
Supports dynamic cloud path completion — press Tab to list remote files/folders, like scp. Works with fzf-tab.
# Option 1: Add to .zshrc
# Option 2: Save to fpath
# Then in .zshrc: fpath=(~/.zfunc $fpath); autoload -Uz compinit; compinit
# Option 3: Oh My Zsh
What gets completed:
| Context | Completion |
|---|---|
pikpaktui <Tab> |
Subcommands with descriptions |
pikpaktui ls /<Tab> |
Remote directory listing |
pikpaktui ls -<Tab> |
-l, --long, -s, --sort, -r, --reverse |
pikpaktui ls --sort <Tab> |
name, size, created, type, extension, none |
pikpaktui mv /src<Tab> /dst<Tab> |
Cloud paths for both arguments |
pikpaktui download /cloud<Tab> ./<Tab> |
Cloud path, then local path |
pikpaktui upload ./<Tab> /<Tab> |
Local path, then cloud path |
pikpaktui tasks <Tab> |
list, retry, delete subcommands |
pikpaktui rm -<Tab> |
-f flag |
Usage
TUI mode
Run without arguments to launch the interactive file browser:
If no valid session exists, a login form will appear. After login, credentials are saved to ~/.config/pikpaktui/login.yaml and the session is persisted to ~/.config/pikpaktui/session.json.
Press , to open the settings editor. Press h for the help sheet.
CLI mode
# File management
# Transfer
# Offline / cloud download
# Star & activity
# Account
CLI mode requires login: it checks for a valid session first, then falls back to login.yaml credentials. If neither exists, run pikpaktui (TUI) to login.
TUI Keybindings
File Browser
| Key | Action |
|---|---|
j / k / ↑ / ↓ |
Navigate |
Enter |
Open folder |
Backspace |
Go back to parent |
r |
Refresh |
m |
Move |
c |
Copy |
n |
Rename |
d |
Delete (trash / permanent) |
f |
New folder |
s |
Star / unstar |
a |
Toggle in cart |
S |
Cycle sort field (name → size → created → type → extension → none) |
R |
Toggle reverse sort order |
A |
View cart |
D |
Downloads view |
o |
Offline download (URL/magnet) |
O |
Offline tasks |
Space |
Preview / file info |
p |
Text content preview |
l |
Toggle log overlay |
, |
Settings |
h |
Help sheet |
q |
Quit |
Folder Picker (Move / Copy)
| Key | Action |
|---|---|
j / k |
Navigate |
Enter |
Open folder |
Backspace |
Go back |
Space |
Confirm destination |
/ |
Switch to text input |
Esc |
Cancel |
Text Input (Move / Copy)
| Key | Action |
|---|---|
Tab |
Autocomplete cloud path |
Enter |
Select candidate / confirm |
Ctrl+B |
Switch to picker |
Esc |
Close candidates / cancel |
Cart View
| Key | Action |
|---|---|
j / k |
Navigate |
x / d |
Remove from cart |
a |
Clear all |
Enter |
Download all |
Esc |
Close |
Download View
| Key | Action |
|---|---|
j / k |
Navigate tasks |
Enter |
Toggle collapsed / expanded view |
p |
Pause / resume |
x |
Cancel task |
r |
Retry failed task |
Esc |
Close (or collapse) |
Settings
| Key | Action |
|---|---|
j / k |
Navigate items |
Space / Enter |
Edit setting |
Left / Right |
Cycle value |
s |
Save to config.toml |
Esc |
Discard and close |
Mouse
- Click — Select entry in parent or current pane
- Double-click — Open folder
- Scroll wheel — Navigate entries or scroll preview
Configuration
All configuration files live under ~/.config/pikpaktui/.
Credentials — login.yaml
username: "you@example.com"
password: "your-password"
TUI Settings — config.toml
[]
= false # Nerd Font icons in TUI
= false # Nerd Font icons in CLI output
= "picker" # "picker" (two-pane) or "input" (text input)
= true # Bottom help bar
= "thick" # "rounded" | "thick" | "thick-rounded" | "double"
= "vibrant" # "vibrant" | "classic" | "custom"
= true # Three-column layout (false = two-column)
= false # Auto-load preview on cursor move
= 65536 # Max bytes for text preview (default 64 KB)
= "auto" # "auto" | "off" | "force-color" | "force-grayscale"
= "name" # "name" | "size" | "created" | "type" | "extension" | "none"
= false # Reverse sort direction
# Per-terminal image protocol configuration
# Detected via $TERM_PROGRAM environment variable
[]
= "kitty"
= "iterm2"
= "auto" # "auto" | "kitty" | "iterm2" | "sixel"
# Custom colors (only used when color_scheme = "custom")
[]
= [92, 176, 255]
= [255, 102, 102]
= [255, 102, 255]
= [102, 255, 255]
= [0, 255, 255]
= [102, 255, 102]
= [255, 255, 102]
= [255, 255, 255]
Session — session.json
Auto-managed. Stores access/refresh tokens. No manual editing needed.
Download State — downloads.json
Auto-managed. Persists incomplete download tasks (pending / paused / failed) across sessions.
Environment Variables
| Variable | Description |
|---|---|
PIKPAK_DRIVE_BASE_URL |
Override PikPak drive API endpoint |
PIKPAK_AUTH_BASE_URL |
Override PikPak auth API endpoint |
PIKPAK_CLIENT_ID |
Override OAuth client ID |
PIKPAK_CLIENT_SECRET |
Override OAuth client secret |
PIKPAK_CAPTCHA_TOKEN |
Provide CAPTCHA token for login |
Project Structure
src/
main.rs Entry point, CLI dispatch or TUI launch
config.rs Credentials (login.yaml), TUI settings (config.toml)
pikpak.rs PikPak REST API client (auth, drive ops, upload, offline, VIP)
theme.rs File categorization, icons, color schemes
cmd/
mod.rs Shared CLI helpers (client init, path resolution)
help.rs Colored ASCII-art help banner
ls.rs ls — colored grid / long format
mv.rs mv — move files
cp.rs cp — copy files
rename.rs rename — rename files
rm.rs rm — trash / permanent delete
mkdir.rs mkdir — create folder
download.rs download — download to local
upload.rs upload — resumable dedup-aware upload
share.rs share — generate PikPak:// share links
quota.rs quota — storage usage
offline.rs offline — submit URL/magnet download
tasks.rs tasks — manage offline tasks
star.rs star — star files
unstar.rs unstar — unstar files
starred.rs starred — list starred files
events.rs events — recent activity
vip.rs vip — VIP status and invite code
completions.rs completions — shell completion script generator
complete_path.rs __complete_path — internal dynamic path completion helper
tui/
mod.rs App state, event loop, Miller columns, syntax highlighting
draw.rs All rendering (login, 3-column layout, overlays, settings)
handler.rs Keyboard and mouse input handling
completion.rs Remote cloud path tab-completion (for move/copy input)
local_completion.rs Local filesystem path tab-completion (for download destination)
download.rs Download manager (task queue, workers, pause/resume, persistence)
download_view.rs Download UI (collapsed popup / expanded full-screen with network graph)

