Project: pygitweb

e497568 # pgt TUI
PyGitTools terminal UI for browsing a local git repository.
90ea48d ## Modes
Navigation is arrow-key based by default. Press `/` to open the command prompt, then type a command and **Enter**.
- **/help** — open this help page
- **/actions** — open the actions page
- **/quit** — quit
- **/commit** — edit the commit message
- **/status** **/log** **/tasks** **/worktrees** — switch home tabs
- **/projects** — open the projects table
- **/branch** — open the branch picker
- **/vim** — enable vim-style **H**/**J**/**K**/**L** navigation
- **/novim** (or **/arrows**) — restore arrow-only navigation (default)
**Esc** cancels the command prompt. **Q** or **Ctrl-C** still quits from navigation.
e497568 ## Home page
2a910f8 The top line shows the project name followed by **Status**, **Log**, **Tasks**, and **Worktrees** tabs. The active tab is highlighted in yellow.
97c4910
90ea48d - **Left** / **Right** — previous or next tab (anywhere except while typing a commit message or slash command)
- **Up** — move selection up (from the changes list, to the actions row, then the branch row, then the project row)
- **Down** — move selection down
97c4910 - **Project row** — **Enter** opens the projects table (PyGitWeb `PROJECTROOT`)
2a910f8 - **Branch row** — **Enter** opens a filterable list of local branches to check out. On **Tasks**, **Enter** syncs the current board with the default remote. On **Worktrees**, **Enter** opens the add-worktree form.
966394d - **Actions row** — always on **Status**. **Enter** opens the actions page when the project has action sets; otherwise the row reads **No Action Groups**
90ea48d - **Commit row** — **Enter** opens the multiline commit editor (in **/vim** mode, **i** also works). **/commit** does the same. In the editor, **Enter** inserts a newline; **Tab** / **↓** move to the **[ Commit ]** and **[ Commit (amend) ]** buttons; **Enter** on a button creates or amends the commit (runs git hooks). **Esc** returns to navigation.
97c4910 - **Space** — collapse or expand a section header
e497568 - **Enter** on a section header — stage or unstage every file in that section (on **Staged**, Enter stages all unstaged and untracked files when nothing is staged)
- **Enter** on a file — stage (unstaged / untracked) or unstage (staged)
90ea48d - **Log tab** — **Up** / **Down** scroll the commit history (newest first)
2a910f8 - **Q** or **Ctrl-C** — quit
e497568
Commit or hook failures appear in the status bar.
053f925 ## Actions page
966394d Lists project actions from ``pyproject.toml`` and a top-level ``actions.toml``.
9f80683 When ``mise`` is on ``PATH``, a ``mise`` set is appended from ``mise tasks ls``.
966394d ``[tool.pgt].actions`` is the ``default`` set (rename it with ``[tool.pgt].name``).
More sets live in ``[tool.pgt.sets.<name>]`` or as tables in ``actions.toml``.
8ac8a11 Each action is ``{ name = "...", script = "..." }`` and may include
``args``, ``description``, ``depends``, and ``hide``.
9f80683 pgt scripts run inside the project's ``.venv``; mise entries run via ``mise run``.
8ac8a11 When any action uses ``depends``, action names must be unique across sets.
Hidden actions stay out of the list but remain runnable as dependencies.
9f80683 An ``actions.toml`` set looks like this:
966394d
[quality]
actions = [
8ac8a11 { name = "lint", script = "scripts/lint.py", description = "ruff/mypy" },
966394d ]
053f925
90ea48d - **Up** / **Down** — move selection
- **Left** / **Right** — previous or next action set
966394d - **Tab** / **Shift-Tab** — next or previous action set
053f925 - **Enter** — run the selected action (or **Run all**)
966394d - **A** — run all actions in the current set, stopping at the first failure
053f925 - **Esc** / **Q** — return to the home page
While an action runs, its row shows an animated spinner. Completed actions use the
staged (success) or unstaged (failure) theme colors.
e497568 ## Branch picker
- **Type** — filter branches by name
90ea48d - **Up** / **Down** — move selection
e497568 - **Enter** — check out the selected branch (`*` marks current), or create a new branch from the current branch when the filter matches nothing
- **Esc** / **Q** — return to the home page
Checkout failures appear in the status bar.
## Projects page
Lists git repositories under the PyGitWeb project directory. Settings are read from
`~/.pygitweb/settings.json` and `PYGITWEB_*` environment variables (same as PyGitWeb):
`PYGITWEB_PROJECTROOT`, `PYGITWEB_PROJECTS_LIST`, `PYGITWEB_PROJECT_MAXDEPTH`, and
`PYGITWEB_LIST_ALL`.
90ea48d - **Up** / **Down** — move selection
e497568 - **Enter** — open the selected project and return to the home page
- **Esc** / **Q** — return without switching
2a910f8 ## Tasks tab
Lists boards stored in the repository. The board row shows the current board and its task count. Each status is a collapsible section with a **(+ New Task)** row.
90ea48d - **Up** / **Down** — move the selection
- **Left** / **Right** on the board row — switch boards
2a910f8 - **Enter** on a status header, or **Space** — collapse or expand that status
- **Enter** on **(+ New Task)** — open the task editor for a new task
- **Enter** on a task — open the task editor
- **Branch row** + **Enter** — sync the current board with the default remote (`origin` when it exists)
## Worktrees tab
Lists linked worktrees. The active worktree is marked with `*`.
90ea48d - **Up** / **Down** — move the selection
2a910f8 - **Enter** on **(+ Add worktree)**, or **Enter** on the branch row — open the add-worktree form
- **Enter** on another worktree — switch the TUI to that worktree
- **D** — remove the selected worktree. The active worktree cannot be removed.
## Add worktree
- **Type** — path, then an optional branch. Leave the branch empty and git creates a new branch named after the directory, based on `HEAD`. An existing local branch is checked out as-is; an unknown name is created with `-b`.
90ea48d - **Up** / **Down** — switch between the path and branch fields
2a910f8 - **Enter** — create the worktree. A relative path is resolved from the current worktree.
- **Esc** / **Q** — return to the home page
e497568 ## Help page
90ea48d - **Up** / **Down** — scroll
e497568 - **Q** / **Esc** — return to the previous page
## Command line
Run `pgt` with no arguments to start the TUI from the current directory.
Use `pgt --repo PATH` to open a specific repository.
Run `pgt --help` for full CLI options.