🌐 Full Documentation & Live Showcase →
Amazing CLI utilities for Grok Build by Cobus Greyling.
A powerful, batteries-included collection of command-line tools that make you dramatically more productive with Grok Build.
- 12+ power commands (sessions, skills, backup, usage+cost, plugins, hooks, config, logs, mcp, worktree, memory,
doctor) - Beautiful rich terminal output (tables, progress, sparklines, bars)
- Safe-by-default (dry-run on anything destructive)
- Works directly against your real
~/.grokdata - Scriptable with
--json - Zero-config — just works
New in 0.3.1: shared robust TOML loader (tomllib on 3.11+, tomli, improved naive), safe FS/JSON helpers, reduced broad exception handling, more tests + coverage, CI on macOS + build verification, __main__ support, CODE_OF_CONDUCT, docs/CI polish, and bug fixes (e.g. plugin discovery).
Sole author & maintainer: Cobus Greyling
📖 Full documentation: https://cobusgreyling.github.io/grok-build-cli-utilities/ — command reference, examples, philosophy and more.
Recommended (PyPI + pipx for isolation):
# Best for CLI tools
pipx install grok-build-cli-utilities
# Or with pip
pip install grok-build-cli-utilitiesFrom source (latest development):
git clone https://github.com/cobusgreyling/grok-build-cli-utilities.git
cd grok-build-cli-utilities
pip install -e ".[dev]"
# (or `python -m pip install -e ".[dev]"`)The command grok-utils (and python -m grok_build_cli_utilities) will be available.
Verify:
grok-utils --version
grok-utils --help
grok-utils doctorTip: Run
grok-utils doctorfor a quick health check of your Grok Build environment (works with--grok-homeand--json).
grok-utils sessions list --limit 20
grok-utils sessions list --project my-app --since 2026-05-20
grok-utils sessions search "auth middleware" --limit 10
grok-utils sessions info 019e87 --deep # tool usage stats
grok-utils sessions stats
grok-utils sessions analyze 019e87
grok-utils sessions export 019e87 --format md -o session.md
grok-utils sessions resume 019e87 # or no arg = most recent in CWD
grok-utils sessions prune --older-than 60d --dry-run- Fast summary-based listing (no heavy parsing until asked)
- Leverages Grok's own
session_search.sqliteFTS when present - Fallback content search across summaries
- Deep mode parses
updates.jsonlfor real tool call counts - Safe prune with age + project filters (defaults to dry-run)
grok-utils skills list
grok-utils skills list --all
grok-utils skills create deploy --desc "Deploy services following our golden path"
grok-utils skills info deploy
grok-utils skills validate # all skills
grok-utils skills validate ./my-skill
grok-utils skills pack my-skill -o my-skill.skill.tar.gz
grok-utils skills unpack my-skill.skill.tar.gz --dest ~/.grok/skills- Discovers skills from all locations (local, repo, user, claude/cursor compat) with correct priority
- Generates high-quality starter
SKILL.mdwith frontmatter + structure - Validates required fields, length, and content
- Pack/unpack for sharing or version control of skill collections
grok-utils backup create --include-sessions --projects "acme,personal"
grok-utils backup create -o ~/backups/grok-$(date +%F).tar.gz
grok-utils backup list
grok-utils backup restore ~/grok-backups/grok-backup-....tar.gz --dry-run
grok-utils backup restore ... --no-dry-run --force- Always produces a manifest with SHA-256 hashes
- Selective session backup by project substring
- Core state always included: config, skills, user-settings, memory, plugins, etc.
- Restore is dry-run by default. Extremely safe.
grok-utils usage report --by project --top 8
grok-utils usage report --by model --since 2026-05-01
grok-utils usage top-projects
grok-utils usage models
grok-utils usage timeline --days 21- Grouped reports with visual share bars (
████░░░░) - Unicode sparklines for recent activity
- Daily timeline
- Model distribution
- JSON output for feeding into other tools or dashboards
grok-utils mcp list
grok-utils mcp doctor
grok-utils mcp test my-github-server
grok-utils mcp add-example myfs --kind filesystem- Parses
[mcp_servers]from yourconfig.toml(works even without tomli) - Doctor checks PATH for commands
- Easy example injector for common servers (filesystem, GitHub, SQLite, ...)
- Delegates to
grok mcp ...when helpful
grok-utils worktree list
grok-utils worktree stats
grok-utils worktree prune-orphaned --dry-run
grok-utils worktree prune-orphaned --no-dry-run --yes- Correlates
git worktree listwith your Grok sessions - Finds "zombie" sessions pointing at deleted directories
- Great for heavy worktree users who spin up many Grok sessions
grok-utils memory list
grok-utils memory stats
grok-utils memory search "architecture decision"
grok-utils memory pathsEven if you don't have memory enabled yet, the tools are ready the moment you turn it on.
grok-utils plugins list --all
grok-utils plugins inventory
grok-utils hooks list --event SessionStart
grok-utils hooks create PostToolUse my-audit
grok-utils config show
grok-utils config paths
grok-utils logs tail --level error -n 20
grok-utils usage cost --by model
grok-utils sessions export <id> --format html -o out.html
grok-utils sessions analyze <id>These bring rich views for the maturing plugins/hooks ecosystem, cost awareness, and deep session forensics.
- Sole author: Every commit is by Cobus Greyling. No bots, no drive-by PRs, no other contributors.
- Safe first: Anything that can delete or overwrite defaults to
--dry-run. - Beautiful & fast: Rich tables, progress bars on big scans, instant on cached summaries.
- Scriptable: Every command that makes sense supports
--json. - Real data only: No mocks — these tools operate on your actual
~/.groklayout. - Minimal deps: Typer + Rich + Pydantic + a few small friends.
git clone https://github.com/cobusgreyling/grok-build-cli-utilities
cd grok-build-cli-utilities
pip install -e ".[dev]"
# Quality gates (CI runs the same)
make lint
make format # or make lint after edits
make typecheck
make cov
# or simply: make test
# See Makefile for all targets (lint, cov, build, clean, etc.)See CONTRIBUTING.md for the full development guide, testing expectations, and how to propose changes.
Real terminal output is best experienced live (grok-utils usage report, sessions list, doctor, etc.). Placeholder for future captured output:
Many Tier 1/2 items implemented in this update (plugins, hooks, sessions export/analyze, usage cost, config, logs, doctor expansions, deep parsers). See CHANGELOG.
sessions resume <short-id>— done.sessions export <id>— done (md/html/json).pluginssubcommand — done.hookssubcommand — done.- Cost estimation in usage — done.
- Rewind-preview / stronger diff (analyze covers some signals/rewinds).
- Cost estimation + pricing in
usage(model price table,usage report --cost,usage cost --by project). "Cost estimation using real model pricing". - Deeper
sessions analyze <id>(orinfo --deep --full) usingsignals.json,plan.json, compaction history, error rates, subagent trees, rewind stats.
- Rewind / diff tooling:
sessions rewind-preview <id>,sessions diff <id1> <id2>(what files/tokens/tools would change). "More powerful session rewind / diff tooling". sessions compact-statsor compaction insights.
config— inspect, validate, show effective (merged) config, key paths, get/set (dry-run + backup).- Automatic / assisted skill extraction:
skills extract-from-session <id>(headless grok assisted). "Automatic skill extraction from successful sessions". - Logs & diagnostics:
logs tail,logs query "error" --since 1doverunified.jsonl; integrate recent errors intodoctor. - Permissions/safety auditor: scan sessions for permission events, suggest rules or blocked actions.
- TUI dashboard mode (Textual) for live usage + session browser.
- Fill screenshots in this README (rich tables, sparklines
████░░░░, progress, panels). - Project-rules / AGENTS.md linter + discovery (
rules lint,rules list). - Marketplace helpers (refresh, search) under
plugins marketplace. - Self-apply: add a
grok-utils-devskill for this repo's own development workflow.
This project is primarily maintainer-driven, but high-quality, well-tested contributions are welcome. Please read CONTRIBUTING.md first.
MIT © 2026 Cobus Greyling
Cobus Greyling
- GitHub: @cobusgreyling
- Built for the Grok Build community
Enjoy the utilities!
