trepo is a terminal workspace for Android Repo clients and Git repositories. It discovers projects, scans Git status concurrently, renders the complete all-refs commit graph, and provides guarded Git repository and Repo batch workflows.
See the user guide and operation flowcharts, the design, implementation roadmap, and Agent guide.
- Rust 1.81 or newer
- Git with porcelain v2 support
- Google/Android
repofor Repo workspace mode - Linux, macOS, or Windows terminal (native Windows supports Git mode; Repo mode depends on an available
repotool)
cargo build --release
cargo run -- /path/to/repo-client # English (default)
cargo run -- -zh /path/to/repo-client # Chinese
cargo run -- --en /path/to/repo-client # explicit English
cargo run -- doctor /path/to/workspaceStarting from a subdirectory is supported. If no .repo directory is found, trepo opens the containing Git repository.
Linux x86_64 (the script also selects supported macOS assets):
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Trigger-CN/trepo/raw/main/install.sh | shWindows x86_64 PowerShell:
irm https://github.com/Trigger-CN/trepo/raw/main/install.ps1 | iexBoth installers select the versioned asset listed in SHA256SUMS, verify SHA-256, and install into a user-writable directory. Override it with TREPO_INSTALL_DIR. Check or install a newer release with trepo update --check or trepo update; self-update verifies the same checksum before replacing the executable.
Pushing a tag that exactly matches v<version> from Cargo.toml creates a GitHub Release. The workflow builds and attaches:
trepo-v<version>-linux-x86_64.tar.gztrepo-v<version>-macos-x86_64.tar.gztrepo-v<version>-macos-aarch64.tar.gztrepo-v<version>-windows-x86_64.zipSHA256SUMS
Each release message includes download and usage instructions, a comparison link to the previous reachable v* tag, and the intervening non-merge commits. A mismatched tag fails before any artifact is built.
Release procedure:
# Update the package version and lock file first.
cargo check
git add Cargo.toml Cargo.lock
git commit
git tag v0.5.0
git push origin v0.5.0| Key | Action |
|---|---|
j / k, arrows |
Move selection; move the active menu selection |
g / G |
First / last item |
Enter |
Open selected repository graph; select active overlay item; insert a newline in the Changes commit editor |
Left / Right |
Move by one Unicode character in the Changes commit editor |
Up / Down |
Move between lines in the Changes commit editor while preserving the character column when possible |
Home / End |
Move to the start / end of the current commit-message line |
Backspace / Delete |
Delete the character before / at the commit-message cursor |
Ctrl-Enter / Ctrl-S |
Submit the multiline Changes commit message |
Space |
Select/unselect a Workspace repository or a file in Changes; toggle an option in forms |
A |
Select/unselect all repositories in the current Workspace filter or all files in Changes |
S / Z / D |
Workspace: confirm Stage / Stash / complete Discard for the repository under the cursor, or only the explicit Space / A selection when non-empty |
E |
Changes: export the repository changes as a patch; exports the selected files, or every change when none is selected, after listing them for confirmation |
a |
Workspace: open Repo batch actions; Changes: Amend current HEAD; Repository: open fixed actions |
c |
Open Changes; cancel a running Repo task from its task view |
f |
Graph: open structured Branch/Query/Author/Since/Until filters; Range history: reopen the range filter form; Repo task: retry only failed projects |
Tab |
Cycle file / hunk / line mode in Changes; switch tabs or form fields |
z |
Changes: confirm stashing the selected files, including untracked files |
s / u |
Stage / unstage selected Changes files, or the active file, hunk, or line when no file selection exists |
d |
Workspace: cycle the data scope through all projects → changed projects → changed projects with files → repositories diverged from their upstream (commits to push or pull); Changes: confirm complete Discard for selected files or discard the active file/hunk/line |
t |
Workspace: toggle List / Tree layout for the current scope; each scope remembers its own layout; Changes: edit the repository-local commit message template |
m / a / w |
Changes: open Commit / Amend HEAD / Reword HEAD directly; Amend and Reword preload the current message, and a key pressed during Stage refresh opens the editor as soon as loading finishes |
p |
Workspace: open a prefilled Push refspec form for the cursor repository after a fresh snapshot — Remote defaults to origin or the first remote, Refspec to HEAD:refs/for/<current-branch> (master when detached) — then confirm git push <remote> <refspec> |
H |
Workspace: open the cross-repository commit range search page (Since/Until window with optional Author and message Query), scanning every repository in scope concurrently |
F |
Workspace: open the cross-repository file search page (one case-insensitive path query), scanning every repository in scope concurrently |
! |
Workspace: run a shell command you type in every targeted repository (the explicit Space / A selection, or the repository under the cursor when nothing is selected); the command runs as $SHELL -c <command> with each repository directory as the working directory, and starts only after a confirmation that lists the targets and warns that trepo performs no rollback |
Enter |
Range history: open the selected commit's detail and diff; file search: open the selected file's commit history (and a history entry's commit detail); other pages: open graph, object menu, or insert a newline |
l |
Range history / file history: jump to the owning repository's Graph page with that commit selected |
Ctrl-A / Ctrl-U / Ctrl-G |
Toggle Commit/Amend compatibility mode / sign-off / signing in the Changes commit dialog |
o |
Open Repository management from Workspace, Graph, or Changes |
PageUp / PageDown |
Scroll the selected diff |
/ |
Workspace: search projects; Graph: open filters focused on commit Query |
r |
Refresh current page |
x |
Workspace/Changes: abort the displayed active Git operation after fresh-state validation and confirmation; Graph: clear all commit filters |
Esc |
Close overlay, back, clear search, or exit |
q |
Exit from Workspace |
? |
Toggle contextual help |
Every page's bottom hint line lists the keys that page actually binds at that moment and always uses two rows: the first row of Workspace, Changes, and Repository also carries task status or errors. The hints are laid out to stay within 120 terminal columns per row, and the full list remains available in Help (?).
Implemented:
- Repo and single-Git workspace discovery
- Concurrent porcelain v2 status scanning
- staged, unstaged, untracked, conflict, HEAD, ahead/behind, and active merge/rebase/cherry-pick/revert state captured during status scans
- searchable responsive Workspace page where
dcycles all projects, changed projects, changed projects with files, and repositories diverged from their upstream (commits ahead of or behind the tracked branch), whiletindependently switches each scope between List and Tree; the first two scopes can render repository path trees, the third can render a change tree or flat full-path file list, and repository selection remains bound to stable project identity - complete all-refs commit graph covering local branches, remote branches, tags, HEAD, and every stash entry, ordered with commit-date order (newest first, parents always after their children) and showing UTC calendar dates
- compact pipe-based topology lanes with left-shifting continuations, solid split/merge connectors, explicit
~Nhidden-lane markers, and◉missing-parent boundaries - responsive Graph columns preserve topology, wrapped subject text, and important refs first; rows use their real visual height, commit body keeps original line breaks, and dense remote/tag badges fold into
R:+N/T:+Nwhile Inspector/object menus retain every ref - in-memory Graph filtering by local/remote branch history, commit OID/subject/body/ref text, author, and inclusive UTC date range; conditions combine with AND while selection remains bound to commit OID
- cross-repository commit range search from Workspace
H, presented as a dedicated page that mirrors the Graph commit list without lanes and supportsj/k,g/G,PageUp/PageDown,fto reopen the filter,rto rerun, andEscto return: aYYYY-MM-DDSince/Until window (lower bound via--since-as-filterso out-of-order commits are not dropped) plus optional Author and message Query, loading every repository in scope concurrently with per-repository error reporting and grouping the hits by repository in workspace order, each group headed by a two-line header that shows the full repository name and the full directory path on a line of its own; commits inside a group stay newest first (same timestamp by OID) - the range search caps every repository at 500 newest matches (a title note counts capped repositories, each capped group is also marked at its header) and renders only the rows inside the viewport, so an unfiltered query over a large workspace stays responsive
Enteron a range-search row opens that commit's detail page: metadata, the full message, and thegit show --stat --patch -m --first-parentdiffstat plus colour-coded patch (merges show their diff against the first parent instead of nothing), scrollable and with explicit empty text when a commit changes nothinglon a range-search row jumps to the owning repository's Graph page with that commit selected; a Graph filter that hides it is cleared and reported, and a commit that is no longer reachable reports an error instead of moving the selection- cross-repository file search from Workspace
F, presented as the same grouped page shape as the range search: a single case-insensitive string matched as a substring against every repository-relative path and, for a query containing/, against the repository directory joined with it (a bare file name, a path fragment, and a full pasted path all work), so tracked files and non-ignored untracked files are found across the workspace concurrently; results are grouped by repository in workspace order with the same two-line group header (full repository name and full directory), andEnteron a match opens that file's commit history (git log --follow, newest first, showing the rename's recorded path and--name-statusletter,llocates a history entry in the owning Graph, andEnteragain opens the commit's detail and diff) - Graph two-level object menu: select a commit node, choose its commit/HEAD/local branch/remote branch/tag/stash object, then choose a fixed contextual action
- Graph
View commit changeson a commit or HEAD object opens that commit's diff inside the Graph page itself — the same metadata, full message, diffstat and colour-codedgit show --stat --patch -m --first-parentpatch the range and file pages show, scrollable withj/k/PageUp/PageDownand closed withEsc— so viewing a historical commit no longer depends on the working-tree Changes page, which is empty for a clean tree - Graph
Checkout this commiton a commit or HEAD object runsgit switch --detach -- <oid>through the same protected RepositoryAction/OperationRunner workflow, so a commit can be inspected in place and the branch restored afterwards - Graph
Create patch fileon a commit or HEAD object writes that commit's patch tocommit-<short-oid>.patchin the repository root after a confirmation that lists the commit and the exact path; the content is the samegit show --stat --patch -m --first-parenttext the in-page diff shows, so a merge reports its diff against the first parent instead of producing nothing - Graph contextual Commit/Amend actions route into the same multiline Changes editor instead of a separate empty-message form; Amend remains limited to the current HEAD object and preloads its message
- Graph repository forms and confirmations reuse the protected RepositoryAction/OperationRunner workflow; local branches expose separate Push and force-with-lease actions while remote branches expose only valid local operations
- stable project multi-selection and name/path filtering in Workspace
- selected-repository Workspace Git Stash/Discard with frozen per-repository change counts, full-batch path/token/index-lock preflight, and per-repository pending/running/success/failure results; cross-repository execution makes no rollback claim
- fixed Repo batch actions for
sync/start/checkout/abandon/prune/rebase/upload/downloadand pinned manifest export; Sync runs once asrepo sync -c -j8when no project is selected, orrepo sync -c -j8 -- <projects...>for the frozen selection - complete scope, target, and argv review before execution; whole-workspace Sync always requires explicit confirmation and destructive actions are visually distinguished
- workspace-exclusive execution coordinated with project Git locks and lock-time path/index checks
- workspace or per-project pending/running/success/failure/cancelled display with bounded, credential-redacted stdout/stderr logs; aggregated Sync uses only its command exit status for the participating scope
- process-group cancellation without rollback claims, automatic real-state rescan, and retry-failed-scope
- background upload uses the explicitly reviewed
--current-branch --yesmode; interactive authentication and advanced upload parameters wait for M5 PTY takeover - shared directory-tree rendering for changed files in Workspace main-list expansion, Workspace Inspector, and Changes, while operations remain bound to exact repository/file identities; Changes keeps
XYvisible and colors file names by staged, unstaged, mixed, untracked, or conflicted state - stable Changes file multi-selection with all-token-preflight batch Stage/Unstage, confirmed selected-path Stash, and confirmed complete Discard of tracked index/worktree plus untracked paths
- Changes patch export with
E: writes the selected files, or every change when nothing is selected, tochanges.patchin the repository root; the confirmation lists every file and the destination first, tracked and untracked changes are combined into one applicable patch (git diff --binary HEADplus per-file--no-indexfor untracked, with the empty tree as the base whenHEADis unborn) - guarded file-, hunk-, and changed-line stage, unstage, and discard with lock-time patch reconstruction
git apply --check, stale token/fingerprint rejection, destructive confirmation, and failure-state preservation- multiline Commit/Amend/Reword input and paste directly from Changes, with both an explicit
Ctrl-Vclipboard read and bracketed paste delivered to whichever editor or form currently has focus (commit template, commit dialog, Graph filter/action, Repository, Repo batch, Workspace search), always-visible commit shortcuts at supported terminal widths, queued editor entry during Stage refresh, current-message preload for Amend/Reword, sign-off, signing, hook output, and message recovery; Reword uses--amend --onlyso staged changes remain staged - Workspace and Changes expose active merge/rebase/cherry-pick/revert state and guarded abort through a fresh repository snapshot, destructive confirmation, project lock, and snapshot token
- Repository page with Status, Stashes, Branches & Tags, and Remotes tabs
- structured Stash workflows for include-untracked, keep-index, staged-only, apply/pop index restore, branch creation, drop, and clear; staged-only rejects incompatible modes before execution
- separate Push, Push refspec, and Force Push entries in Repository and Graph; force updates always use
--force-with-lease, with exact refspec/OID-range preview and explicit remote-history warning; the refspec entry runsgit push <remote> <refspec>with strict single-argument validation - repository-local commit message template stored as
trepo.commitTemplatein the repository Git config, editable from Changes throught, clearing on an empty draft orCtrl-D, seeding only a brand-new Commit draft while Amend/Reword keep the currentHEADmessage - Workspace
preloads a fresh repository snapshot and opens an editable Push refspec form prefilled with theoriginremote (or the first configured remote) andHEAD:refs/for/<current-branch>(masterwhen HEAD is detached), so the target can be retyped before the existing remote-write confirmation, project lock, and snapshot token - project locks, worktree-aware index-lock checks, snapshot tokens, generation checks, and automatic scoped refresh
doctordiagnostics and parser/real Git/TestBackend-focused tests- English UI by default, with instance-scoped Chinese/English selection through exact
-zh/-encompatibility flags or standard--zh/--enflags - terminal-column-aware sanitization, wrapping, and truncation for Git output and paths; control characters are rendered visibly and long diff source lines never auto-wrap across panel borders
Planned next: command palette and PTY takeover (M5), including interactive authentication and external mergetool/editor handoff.