A local-first desktop app for command tracking, CLI logging, and PowerShell/CMD history insights on Windows.
CLI Logging helps developers understand terminal usage patterns without sending data to external services.
It watches local PowerShell history files, categorizes commands automatically, stores everything locally, and gives you a modern UI for search + insights.
- Live command ingestion from PowerShell history files
- Fast local storage with SQLite (
sql.js) - Automatic command categorization (Git, Docker, npm, Python, filesystem, cloud, and more)
- Instant search and category filters
- Stats dashboard with:
- total commands
- today activity
- unique commands
- category distribution
- top repeated commands
- hourly activity graph
- System tray integration + quick reopen
- Global toggle shortcut:
Ctrl + Shift + L - Clean frameless desktop experience
- The app watches PowerShell history files under
%APPDATA%. - New command lines are captured in near real time.
- Each command is categorized using rule-based matching.
- Commands are stored in a local DB with timestamp, source, category, and frequency.
- React UI fetches this data via secure Electron IPC and renders command views + analytics.
flowchart LR
A["PowerShell History Files<br/>(%APPDATA%/.../PSReadLine/*_history.txt)"] --> B["Watcher Layer<br/>electron/watcher.cjs<br/>(chokidar + polling fallback)"]
B --> C["Data Layer<br/>electron/database.cjs<br/>(sql.js local DB)"]
C --> D["App Core<br/>electron/main.cjs<br/>(IPC handlers + lifecycle)"]
D --> E["Secure Bridge<br/>electron/preload.cjs<br/>(contextBridge API)"]
E --> F["Renderer UI<br/>src/App.tsx + components/*<br/>(React + Tailwind)"]
C --> G["Categorization Engine<br/>electron/categorizer.cjs<br/>(rule-based labels)"]
D --> H["System Tray + Global Shortcut<br/>electron/tray.cjs + Ctrl+Shift+L"]
watcher.cjsdetects new terminal history lines.database.cjsstores normalized command records locally.categorizer.cjsassigns category labels (Git, Docker, npm, etc.).main.cjsexposes command/stat APIs through IPC handlers.preload.cjssafely bridges APIs into the renderer.- React UI renders command feed, filters, and analytics in real time.
- Electron
- React 18 + TypeScript
- Vite
- Tailwind CSS
sql.jschokidar
- Windows 10/11
- Node.js 18+
- npm
npm install
npm run devThis starts Vite + Electron in development mode.
npm run buildInstaller output is generated in release/.
cli-logging/
|-- electron/
| |-- main.cjs # Electron app lifecycle, window, IPC, shortcuts
| |-- preload.cjs # Secure API surface for renderer (contextBridge)
| |-- database.cjs # Local DB init, CRUD, stats, history import
| |-- watcher.cjs # File watching for PowerShell history updates
| |-- categorizer.cjs # Command-to-category matching rules
| `-- tray.cjs # System tray menu + quick app controls
|-- src/
| |-- App.tsx # Main shell and view routing (home/stats/settings)
| |-- components/
| | |-- Sidebar.tsx # Navigation + category filters + quick counters
| | |-- SearchBar.tsx # Search, shortcuts, category chips
| | |-- CommandList.tsx # Grouped command timeline + virtualized loading
| | |-- CommandCard.tsx # Individual command row UI
| | |-- StatsPanel.tsx # Charts and usage analytics
| | `-- SettingsPanel.tsx# Import/clear actions + preference UI
| |-- types/
| | `-- index.ts # Shared command/stats/API TypeScript contracts
| |-- main.tsx # React entry point
| `-- index.css # Tailwind + theme styling
|-- public/ # Static assets
|-- assets/ # README/demo assets
|-- electron-builder.yml # Windows packaging config
|-- tailwind.config.js # Tailwind theme + tokens
|-- vite.config.ts # Vite build/dev config
`-- package.json # Scripts and dependencies
electron/*handles ingestion, persistence, and desktop runtime features.src/*handles presentation, interaction, and analytics views.assets/*powers visual documentation for open-source readers.
- Local-first by design.
- No telemetry enabled by default.
- Command history data stays on your machine.
- Primary focus: Windows + PowerShell history workflow.
- Some settings UI controls are currently presentational and can be wired deeper in future releases.
- Persistent settings behavior (auto-start, watcher toggles)
- Better multi-shell source detection
- Export/import workflows
- Optional sensitive-command redaction
- Extended analytics and trend insights
Contributions are welcome.
- Fork the repo
- Create a feature branch
- Commit with clear messages
- Open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
