Add ctx context manager, installer, and auto-detect Claude path

- ctx: SQLite-based cross-session context manager for Claude Code
- install.sh: automated installer (deps, files, symlinks, DB, .desktop)
- bterminal.py: replace hardcoded CLAUDE_PATH with auto-detection
- README.md: rewrite in English, document ctx and installation
- .gitignore: add CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
DexterFromLab 2026-03-05 11:54:24 +01:00
parent edc13e2d27
commit 4268ead6a4
5 changed files with 640 additions and 34 deletions

105
README.md
View file

@ -1,59 +1,98 @@
# BTerminal
Terminal z panelem sesji w stylu MobaXterm, zbudowany w GTK 3 + VTE. Catppuccin Mocha theme.
Terminal with session panel (MobaXterm-style), built with GTK 3 + VTE. Catppuccin Mocha theme.
![BTerminal](screenshot.png)
## Funkcje
## Features
- **Sesje SSH** — zapisywane konfiguracje (host, port, user, klucz, folder, kolor), CRUD z panelem bocznym
- **Claude Code** — zapisywane konfiguracje Claude Code z opcjami sudo, resume, skip-permissions i initial prompt
- **Makra SSH** — wielokrokowe makra (text, key, delay) przypisane do sesji, uruchamiane z sidebara
- **Zakładki** — wiele terminali w tabach, Ctrl+T nowy, Ctrl+Shift+W zamknij, Ctrl+PageUp/Down przełączaj
- **Sudo askpass** — Claude Code z sudo: hasło podawane raz, tymczasowy askpass helper, automatyczne czyszczenie
- **Grupowanie folderami** — sesje SSH i Claude Code mogą być grupowane w foldery na sidebarze
- **Catppuccin Mocha** — pełny theme: terminal, sidebar, taby, kolory sesji
- **SSH sessions** — saved configs (host, port, user, key, folder, color), CRUD with side panel
- **Claude Code sessions** — saved Claude Code configs with sudo, resume, skip-permissions and initial prompt
- **SSH macros** — multi-step macros (text, key, delay) assigned to sessions, run from sidebar
- **Tabs** — multiple terminals in tabs, Ctrl+T new, Ctrl+Shift+W close, Ctrl+PageUp/Down switch
- **Sudo askpass** — Claude Code with sudo: password entered once, temporary askpass helper, auto-cleanup
- **Folder grouping** — SSH and Claude Code sessions can be grouped in folders on the sidebar
- **ctx — Context manager** — SQLite-based cross-session context database for Claude Code projects
- **Catppuccin Mocha** — full theme: terminal, sidebar, tabs, session colors
## Wymagania
## Installation
```
python3 >= 3.8
python3-gi
gir1.2-gtk-3.0
gir1.2-vte-2.91
```bash
git clone https://github.com/DexterFromLab/BTerminal.git
cd BTerminal
./install.sh
```
### Instalacja zależności (Debian/Ubuntu/Pop!_OS)
The installer will:
1. Install system dependencies (python3-gi, GTK3, VTE)
2. Copy files to `~/.local/share/bterminal/`
3. Create symlinks: `bterminal` and `ctx` in `~/.local/bin/`
4. Initialize context database at `~/.claude-context/context.db`
5. Add desktop entry to application menu
### Manual dependency install (Debian/Ubuntu/Pop!_OS)
```bash
sudo apt install python3-gi gir1.2-gtk-3.0 gir1.2-vte-2.91
```
## Uruchomienie
## Usage
```bash
python3 bterminal.py
bterminal
```
## Konfiguracja
## Context Manager (ctx)
Pliki konfiguracyjne w `~/.config/bterminal/`:
`ctx` is a SQLite-based tool for managing persistent context across Claude Code sessions.
| Plik | Opis |
|------|------|
| `sessions.json` | Zapisane sesje SSH + makra |
| `claude_sessions.json` | Zapisane konfiguracje Claude Code |
```bash
ctx init myproject "Project description" /path/to/project
ctx get myproject # Load full context (shared + project)
ctx set myproject key "value" # Save a context entry
ctx shared set preferences "value" # Save shared context (available in all projects)
ctx summary myproject "What was done" # Save session summary
ctx search "query" # Full-text search across everything
ctx list # List all projects
ctx history myproject # Show session history
ctx --help # All commands
```
## Skróty klawiszowe
### Integration with Claude Code
| Skrót | Akcja |
|-------|-------|
| `Ctrl+T` | Nowa zakładka (local shell) |
| `Ctrl+Shift+W` | Zamknij zakładkę |
| `Ctrl+Shift+C` | Kopiuj |
| `Ctrl+Shift+V` | Wklej |
| `Ctrl+PageUp/Down` | Poprzednia/następna zakładka |
Add a `CLAUDE.md` to your project root:
## Licencja
```markdown
On session start, load context:
ctx get myproject
Save important discoveries: ctx set myproject <key> <value>
Before ending session: ctx summary myproject "<what was done>"
```
Claude Code reads `CLAUDE.md` automatically and will maintain the context database.
## Configuration
Config files in `~/.config/bterminal/`:
| File | Description |
|------|-------------|
| `sessions.json` | Saved SSH sessions + macros |
| `claude_sessions.json` | Saved Claude Code configs |
Context database: `~/.claude-context/context.db`
## Keyboard Shortcuts
| Shortcut | Action |
|----------|--------|
| `Ctrl+T` | New tab (local shell) |
| `Ctrl+Shift+W` | Close tab |
| `Ctrl+Shift+C` | Copy |
| `Ctrl+Shift+V` | Paste |
| `Ctrl+PageUp/Down` | Previous/next tab |
## License
MIT