Terminal git client
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.
composer require sugarcraft/sugar-stash
// 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();
git status --porcelain=v1 -b with per-row index / work flags and a branch-summary header.git for-each-ref driven; current branch is highlighted + bold.s in the status pane toggles staging via git add / git restore --staged.GitDriver interface lets tests inject a fixture-backed driver without staging real repos.R reloads from disk; cursors are clamped if the row count shrinks.Lang::t() — key hints, error labels, empty-state messages, git error text.User-facing strings use SugarCraft\Stash\Lang::t(). All keys are in lang/en.php under the stash namespace.
| Key | Default | Parameters |
|---|---|---|
| git.spawn_failed | git: failed to spawn | — |
| git.error | git: {stderr} | {stderr} |
| cli.not_a_repo | sugar-stash: not a git repository (no .git in {cwd}) | {cwd} |
| ui.error_prefix | error: | — |
| status.clean | clean working tree | — |
| branches.empty | (no branches) | — |
| log.empty | (empty log) | — |
| help.keyhints | tab 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.
| Class | Method | Description |
|---|---|---|
| Git | new(cwd) | Create git driver |
| Git | status() | Get working tree status |
| Git | branches() | List branches |
| Git | log() | Get commit log |
| Git | stage(path) | Stage file |
| Git | unstage(path) | Unstage file |
| App | start(git) | Create app model |
VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.