Repository navigation
Commands and Events
This is the reference for everything the UI can ask the backend, and everything the backend sends on its own. Every command is registered in src-tauri/src/lib.rs and has a typed wrapper in src/lib/api.ts. Return types are the DTOs in src/lib/types.ts. There are 167 commands today, so the tables are split over four pages:
| Page | Commands |
|---|---|
| Commands: Workspace and Changes | launch mode, workspace folders, status, staging, commits, diffs, conflicts, the mergetool, stashes, the shelf and .gitignore
|
| Commands: Branches and Remotes | branches, the Branches popup, the Merge and Rebase dialogs, interactive rebase, fetch, pull, push, remotes, clone, patches and tags |
| Commands: History and Extras | the log, blame, file and line history, reset, worktrees, submodules, Git LFS and the GitHub account |
| Commands: App and Tools | files, config, the memory log, Search Everywhere and Replace in Files, scripts, the terminal, the Git Console, the MCP server and the command line tool |
How to read the tables:
-
Wrapper is the
api.tsfunction with its camelCase arguments; the command is the same name in snake_case. - Kind: git2 reads in process, CLI runs your git binary (writes, and a few reads libgit2 cannot do), file touches the disk directly, app uses app state or another program, net calls the GitHub API.
- Every command can fail with
AppError { kind, message }. See Backend. -
OpOutcome { output, conflicts }comes back from anything that can stop on conflicts.conflicts: trueis a normal result, not an error.
flowchart LR
View["view or store"] --> Wrapper["api.getStatus(repoPath)"]
Wrapper -->|"invoke('get_status', { repoPath })"| Cmd["commands::status::get_status(repo_path)"]
Cmd --> Dto["RepoStatus (camelCase JSON)"]
Dto --> View
Cmd -. "events and channels" .-> View
The backend emits seven events. The api.ts helpers return an unlisten function.
| Event | Helper | Payload | Sent by |
|---|---|---|---|
repo-changed |
onRepoChanged |
RepoChangedEvent { repoPath, gitDir, workTree } |
watcher.rs, once per changed repository per 300 ms batch |
workspace-changed |
onWorkspaceChanged |
WorkspaceChangedEvent { workspaceRoot, reposChanged } |
watcher.rs, when visible files or a .git folder appear or vanish |
open-files-changed |
onOpenFilesChanged |
OpenFilesChangedEvent { filePaths } |
watcher.rs, when a file open in a tab changes while git ignores it |
git-progress |
onGitProgress |
GitProgressEvent { repoPath, line } |
each progress line of fetch, pull, push, Update and Push in the Branches popup, submodule update and LFS pull or fetch |
terminal-exited |
onTerminalExited |
TerminalExitedEvent { terminalId, exitCode } |
commands/terminal.rs and commands/scripts.rs, when a shell or a script run ends; exitCode is null when killed |
git-command |
onGitCommand |
GitCommandEntry |
commands/console.rs, when a git command starts and when it ends, only after git_console_entries was called once |
mcp-ui-request |
onMcpUiRequest |
McpUiRequest { requestId, tool, arguments } |
mcp/bridge.rs, for a tool the window runs; answer every one with mcp_ui_respond
|
mcp-open-folder |
onMcpOpenFolder |
McpOpenFolderRequest { folderPath, mode } |
mcp/tools/git_write.rs, when clone_repository should open the clone (window) or add it (workspace) |
mcp-activity |
onMcpActivity |
McpActivity { tool, at, durationMs, ok, error, client } |
mcp/mod.rs, after each MCP or command line tool call |
gitDir: true means HEAD, refs, the index or the operation state changed, so branches and the log need a reload too. workTree: true means only files changed. reposChanged: true asks the store to rescan. See Architecture for the refresh flow.
Streams that belong to one call use a Tauri Channel argument instead of a global event. Only the caller hears it, and it ends with the call or the session.
| Command | Channel argument | Messages |
|---|---|---|
terminal_spawn, run_script
|
output: Channel<ArrayBuffer> |
raw output bytes of the shell or script |
clone_repository |
progress: Channel<string> |
one line of git clone --progress
|
file_search_open |
progress: Channel<FileSearchProgress> |
files indexed so far, until the popup closes |
symbol_search_open |
progress: Channel<SymbolSearchProgress> |
files and symbols indexed so far |
text_search |
results: Channel<TextSearchBatch> |
matches in small batches; the last one has done: true
|
The dev-only IPC bridge relays channel messages too, so screenshots can show live terminal output and search progress (see Architecture).
A few calls go straight to Tauri APIs and plugins, allowed by src-tauri/capabilities/default.json: file pickers (open, save from @tauri-apps/plugin-dialog), openUrl and revealItemInDir (Reveal in Finder) from @tauri-apps/plugin-opener, getVersion from @tauri-apps/api/app, homeDir from @tauri-apps/api/path (the Clone dialog), the native menu bar from @tauri-apps/api/menu (built in src/lib/menu/appMenu.svelte.ts), and getCurrentWindow().setTitle and onCloseRequested in mergetool mode.
Follow the steps in Backend, then add a row to the right page. A command that streams gets a Channel argument; an event is only for news that any part of the UI may want, like a changed repository.
These pages are generated from docs/wiki. To correct something, open a pull request against the source file; edits made here are overwritten.
Using Nibtree
- Getting Started
- Welcome Screen
- Workspaces
- Files Panel
- File Operations
- File Icons
- Rounded Panels
- Editor and Tabs
- Pin Reorder and Wrap Tabs
- Single Tab Title
- Split Editor
- New File and Unsaved Changes
- Unload Hidden Tabs
- Editing Code
- Code Appearance
- Markdown Editor
- Image and PDF Preview
- Search Everywhere
- Recent Files
- Navigation Bar
- Find and Replace
- Changes and Commits
- Sign In Prompts
- Commit Box Layout
- Repository Actions
- Commit Options
- Ignoring Files
- Diffs
- Inline Diffs
- Staging View
- Revert a Change
- Resolving Conflicts
- Merge Tool
- Blame
- History and Log
- Merge Commits
- Branches and Tags
- Branches Popup
- Remotes
- Stashes
- Shelf
- Git Menu
- Git Dialogs
- Interactive Rebase
- Worktrees
- AI Agents
- AI Tasks
- AI Usage
- Keep Computer Awake
- Submodules
- Git LFS
- GitHub
- Git Console
- Terminal
- Terminal Features
- Scripts
- Navigation
- Menus
- Settings
- Settings Search
- Color Themes
- Settings Terminal and Automation
- Settings Files
- Updates
- Status Bar and Help
- Notifications
- Memory Use
- Clear Cache
- MCP and CLI
- Git Mergetool
- Keyboard Shortcuts
- Keyboard Shortcuts Editor
- Troubleshooting
- Troubleshooting Git
Developers
- Developer Guide
- Architecture
- Project Layout
- Backend
- How Folder Watching Works
- Folder Watching Bugs We Fixed
- How Workspace Files Work
- How the Preview Scheme Works
- Backend Services
- How Terminal Features Work
- Terminal Bugs We Fixed
- Frontend
- How the Rich Markdown Editor Works
- Rich Markdown Bugs We Fixed
- Git Menu Links
- Menu Keys and Routing
- Frontend Modules
- Blame Bugs We Fixed
- Project Color And Title Bar
- One Diff View
- Diff Bugs We Fixed
- Merge Tool Layouts
- Merge Tool Bugs We Fixed
- Color Theme Bugs We Fixed
- How the Connected Diff Works
- Rounded Panels Bugs We Fixed
- Update Bugs We Fixed
- Status Bar Bugs We Fixed
- MCP and CLI Bugs We Fixed
- Repository Actions Bugs We Fixed
- How the Changes Tab Works
- CodeMirror Patterns
- How the Cursor Works
- How Editor Features Work
- How the Path Bar Works
- Commands and Events
- Settings Reference
- Commands Workspace and Changes
- Commands Branches and Remotes
- Commands History and Extras
- Commands App and Tools
- Testing
- Test Suites
- Debugging
- Debugging with MCP
- Measuring Setting Memory
- How Terminal Memory Is Measured
- How Markdown Diagrams Work
- Releases and CI
- Publishing the Wiki
- Versioning and Changelog
- Browser Version Packages
- Browser Release Checks
- Docker Image
- Platforms and Signing
- Windows Support
- Windows Bugs We Fixed
- Windows MCP and CLI
- Docs and Screenshots
- UI Library
- UI Library MCP
- UI Library Bugs
- UI Library Migration
- Contributing
How features work
- Welcome screen
- Workspaces and folders
- Files panel
- File operations
- File icons
- Editor and tabs
- Pin, reorder and wrap tabs
- Single tab title
- Split editor
- New File and unsaved changes
- Unload hidden tabs
- Editing code
- Code appearance
- Markdown editor
- Image and PDF preview
- Search Everywhere
- Recent Files
- Navigation Bar
- Find and replace
- Changes and commits
- Sign-in prompts
- Commit box layout
- Repository actions
- Commit options
- Ignoring files
- Diffs
- Inline diffs
- Staging view
- Revert a change
- Resolving conflicts
- Merge tool
- Blame
- History and log
- Merge commits
- Commit tabs
- Branches and tags
- Branches popup
- Remotes
- Stashes
- Shelf
- Git menu
- Git dialogs
- Interactive rebase
- Worktrees
- AI agents
- AI usage
- Keep computer awake
- AI tasks
- Submodules
- Git LFS
- GitHub account
- Git Console
- Back and Forward
- Integrated terminal
- Scripts tool window
- Menu bar
- Settings
- Search in Settings
- Color themes
- Rounded panels
- Updates and release channels
- Status bar and help links
- Notifications
- Memory readout and memory log
- Clear Cache
- MCP server and command line tool
- git mergetool mode