A high-performance terminal cockpit uniting WezTerm, Starship, and custom WSL automation.
A live configuration repository: configs are consumed through symlinks, never copied.
Windows: %USERPROFILE%\.config\wezterm\wezterm.lua → wezterm/wezterm.lua
%USERPROFILE%\.config\wezterm\fonts → wezterm/fonts
%USERPROFILE%\.config\wezterm\cockpit → wezterm/cockpit
WSL: ~/.config/starship.toml → starship/starship.toml
~/.local/bin/ck* → scripts/ck*
WezTerm (UI layer) Starship (prompt layer)
LEADER+P action palette git branch/status + ☸ k8s context/ns
right status bar (file read only) (kubeconfig only: no API calls)
│ SendString / InputSelector
▼
scripts/ck* (bash inside WSL, timeout-guarded and cached — also
usable directly from any shell)
├── git → git CLI
├── k8s → kubectl (k3s)
├── ci → gh / glab when installed; public API (curl) for
│ public GitHub repos; detected from repo files
├── argocd → argocd CLI with a session, or read-only kubectl
└── status → writes ~/.cache/terminal-cockpit/state
▲
scripts/shell-hook.sh (bash): OSC 7 (cwd) + per-prompt status refresh
- The shell stays the shell: The palette types plain commands into the active pane (history included). Nothing is replaced by a heavy monolithic app.
- Nothing hangs: Every
kubectl/argocd/curlcall is wrapped intimeoutwith asynchronous caching. The WezTerm status bar only reads a local file written by the shell—it never spawns synchronous processes, meaning a down cluster can never freeze your UI. - Context-aware gating: Palette sections are strictly gated on real environment detection: installed tools (
ck doctor), current repository and its provider, CI configs (.github/workflows/.gitlab-ci.yml), and ArgoCD status. - Zero duplication: Git context lives cleanly in Starship; cluster health lives in the WezTerm status bar.
| Shortcut | Action |
|---|---|
CTRL+P |
Cockpit fuzzy palette (handled by WezTerm before Zellij) |
LEADER then P |
Cockpit fuzzy palette (Git / Repo / K8s / Argo / CI / PR) |
F9 |
Same palette, no leader needed (alternative trigger) |
CTRL+H |
Updated Cockpit help overlay with current palette actions |
| All other shortcuts | Unchanged (tmux-style, LEADER + 1..9, etc.) |
Leader timing: press
Ctrl+A, release it, then presspwithin the 1-second leader timeout. HoldingCtrlwhile pressingpsendsCTRL+Pto the palette directly. If in doubt, useF9.
Launcher: the
+button is always visible beside the tabs. Left-click creates a tab; right-click opens the WezTerm launcher menu, including the WSL, PowerShell and Zellij entries.
Tab titles: the shell hook publishes the current directory and the last command, so a tab appears as
~ > lsorproject > gitinstead ofwslhost.exe. Reload the shell hook after installing or updating it.
- Split mode: long-running operations have
(split)variants (pods → logs (-f, split),rollout status (split),Argo app sync/logs (split)) that run in an automatic side-by-side split pane (likeCTRL+SHIFT+D); close it withCTRL+SHIFT+W. - Pull requests: on GitHub repos with
ghinstalled:PR: list / create (title + body) / checks (current branch) / merge (editable flags). - ArgoCD health at a glance: the status bar shows
⎈ 9✓in green, or⎈ 8✓1✗in red when an app is not Healthy/Synced. | - Desktop app overlay: the Cockpit palette can list visible Windows
applications and attach one as a reversible overlay over the WezTerm window.
Use
Cockpit: attach desktop app (overlay)and release it withCockpit: detach desktop app. Exact pane-level placement is not available in WezTerm20240203yet; the current implementation intentionally uses the full WezTerm window instead of guessing pane coordinates. - Help stays current:
CTRL+Hdocuments the current layout, focus mode, notification and desktop-overlay actions.
ck doctor # Check what is installed in WSL
ck status [--force] # Refresh k8s/argo state (also feeds WezTerm)
ck git info | branches | url repo|pulls|ci
ck k8s contexts|namespaces|pods|deployments|services|events [--names] [ns]
ck ci detect|runs|failed|ids|view <id>|rerun <id>|page
ck argocd detect|apps|names|get|sync|refresh|history|logs <app>- Set up the symlinks shown above (Windows:
New-Item -ItemType SymbolicLink; WSL:ln -s). - Hook into your shell by adding this line at the end of
~/.bashrc(WSL Debian):source /mnt/c/dev/dotfiles/scripts/shell-hook.sh - Ensure line endings (LF): Scripts must keep LF endings (
.gitattributesenforces this; note that on/mnt/c, CRLF breaks bash scripts). - Session layer (Zellij): download the
zellij-x86_64-unknown-linux-muslrelease into~/.local/bin/zellijand symlink~/.config/zellijto this repo'szellij/directory.
wezterm/wezterm.lua— Base configuration + guarded (pcall) cockpit loading.wezterm/cockpit/— Modular UI components:init(wiring),config(constants),wsl(WezTerm⇄WSL bridge),util(send/split/pickers),status,palette, and domain entries (git,k8s,argocd,ci,pr).scripts/— Theckcommand dispatcher + specialized scripts (ck-git,ck-k8s,ck-ci,ck-argocd,ck-status),shell-hook.sh,termdeck-windows.ps1, andlib/common.sh.starship/starship.toml— Prompt layout with integratedkubernetesmodule.zellij/— Zellij session layer (config.kdl, deployed via symlink to~/.config/zellij).wezterm/fonts/— JetBrainsMono Nerd Font, licensed under the SIL Open Font License 1.1 (seewezterm/fonts/OFL.txt).
- Tested on WezTerm
20240203, WSL2 Debian, usingkubectlbound to thek3sbinary. - Graceful Degradation:
ghis installed (PR entries plus full CI read/write on GitHub repos); ifglabor theargocdCLI are missing, those palette sections stay hidden until installed. - Zellij session layer: open or re-attach the
cockpitsession from the palette (Cockpit: zellij session) or the launcher; its bottom bar shows contextual shortcuts and sessions survive closing WezTerm. - Resilience: If the k3s API drops, the status bar safely displays
☸ ctx · nswith a red indicator, and K8s pickers report "no results" instead of locking up the terminal.