---
slug: "pi-git-status-line"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/qualiti/pi-git-status-line@main/README.md"
repo: "https://github.com/qualiti/pi-git-status-line"
source_file: "README.md"
branch: "main"
---
# pi-git-status-line

A standalone [Pi](https://github.com/badlogic/pi-mono) package that extends Pi's status line below the input with git information for the current working tree:

- current branch name
- amount of uncommitted files
- commits to be pushed (`↑`)
- commits to be pulled (`↓`)

It keeps Pi's existing footer/status line and adds a git summary via `ctx.ui.setStatus(...)`.

## Preview

![Pi status line with git branch, uncommitted changes, and push/pull counts](https://github.com/qualiti/pi-git-status-line/raw/HEAD/assets/git-status-line-preview.png)

## Install

### From npm

```bash
pi install npm:pi-git-status-line
```

### From git

```bash
pi install git:github.com/qualiti/pi-git-status-line
```

### From a local checkout

```bash
pi install /absolute/path/to/pi-git-status-line
```

## Usage

After installation, reload Pi or start a new session.

When you are inside a git repository, the footer will show a summary like:

```text
 main · 2 uncommitted · ↑1 ↓0
```

If the repo is clean:

```text
 main · ✓ clean · ↑0 ↓0
```

If the branch has no upstream yet:

```text
 feature/new-branch · 1 uncommitted · no upstream
```

## Notes

- works only when the current working directory is inside a git repository
- refreshes on session start, after turns, and after `bash`, `write`, or `edit` tool executions
- if Pi is not in a git repo, the extension hides its status text

## Requirements

- `git` must be available on `PATH`

## Package structure

This package follows Pi package guidelines:

- it declares a `pi` manifest in `package.json`
- it exposes the extension through `./extensions`
- it ships TypeScript directly so Pi can load it through jiti

## Local development

Run the unit tests:

```bash
npm test
```

Run a local package install into Pi:

```bash
pi install /absolute/path/to/pi-git-status-line
```

Or load the extension file directly for quick testing:

```bash
pi -e /absolute/path/to/pi-git-status-line/extensions/git-status-line.ts
```

## Files

- `package.json` — Pi package manifest for npm and git installs
- `extensions/git-status-line.ts` — the extension entry point
- `tests/git-status-line.test.ts` — helper tests
