← All apps

SugarStash

🌿 SugarStash

Terminal git client

port of lazygit git tui porcelain force-command-friendly

Three-pane git TUI on the SugarCraft stack — status / branches / log laid out side-by-side, single-key stage / unstage, refresh. Shells out to git for every mutation so users keep their existing aliases, hooks, and signing config.

Install

composer require sugarcraft/sugar-stash

Quickstart

// Run from any git working tree:
sugar-stash

// Or wire your own driver in PHP:
use SugarCraft\Core\Program;
use SugarCraft\Core\ProgramOptions;
use SugarCraft\Stash\App;
use SugarCraft\Stash\Git;

$git = new Git(getcwd());
(new Program(App::start($git), new ProgramOptions(useAltScreen: true)))->run();

What's in the box

Status paneParses git status --porcelain=v1 -b with per-row index / work flags and a branch-summary header.
Branches panegit for-each-ref driven; current branch is highlighted + bold.
Log paneLast 20 commits with short SHA + subject + author + relative time.
Stage / unstages in the status pane toggles staging via git add / git restore --staged.
Pluggable driverGitDriver interface lets tests inject a fixture-backed driver without staging real repos.
Refresh on demandR reloads from disk; cursors are clamped if the row count shrinks.
InternationalizationAll user-facing strings use Lang::t() — key hints, error labels, empty-state messages, git error text.

Internationalization

User-facing strings use SugarCraft\Stash\Lang::t(). All keys are in lang/en.php under the stash namespace.

KeyDefaultParameters
git.spawn_failedgit: failed to spawn
git.errorgit: {stderr}{stderr}
cli.not_a_reposugar-stash: not a git repository (no .git in {cwd}){cwd}
ui.error_prefixerror:
status.cleanclean working tree
branches.empty(no branches)
log.empty(empty log)
help.keyhintstab switch pane · j/k move · s stage/unstage · R refresh · q quit

To localize, copy lang/en.php to lang/<code>.php and translate the values.

Source & demos

Try the quickstart →

Key Classes

ClassMethodDescription
Gitnew(cwd)Create git driver
Gitstatus()Get working tree status
Gitbranches()List branches
Gitlog()Get commit log
Gitstage(path)Stage file
Gitunstage(path)Unstage file
Appstart(git)Create app model

Demos.

VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.

Play

Play

Three-pane TUI — switch panes, move cursor, stage / unstage.
Stage

Staging workflow

s key stages and unstages files — watch the status update.