grove-core is the foundational Go library for the Grove ecosystem. It provides shared infrastructure for configuration management, workspace discovery, logging, and terminal user interface (TUI) components, ensuring consistency across all Grove CLI tools.
Layered Configuration: Configuration is loaded and merged from multiple sources in a specific precedence order:
- Global:
~/.config/grove/grove.yml(System-wide defaults and search paths). - Ecosystem:
grove.ymlin a parent directory defining a workspace boundary. - Project:
grove.ymlin the current working directory. - Overrides:
grove.override.ymlfor local, git-ignored developer settings.
Workspace Discovery: The DiscoveryService scans directories defined in the groves configuration. It classifies filesystem locations into three types based on file markers:
- Ecosystems: Directories containing a
grove.ymlwith aworkspaceskey. - Projects: Directories containing a
grove.ymlor.git. - Worktrees: Git worktrees located in
.grove-worktrees/directories.
Unified Logging: The logging system writes two streams simultaneously:
- Structured: JSON-formatted logs written to
.grove/logs/in the workspace root for machine analysis. - Human-Readable: Styled, colored text written to
stderrfor interactive use. - Filtering: Supports component-based filtering rules defined in
grove.yml.
cli: Wrapsspf13/cobrato provide standard flags (--json,--verbose,--config) and styled help output across all tools.config: Handles YAML parsing, environment variable expansion (${VAR}), and JSON schema validation.logging: A wrapper aroundlogrusproviding the unified logging streams and component registry.
pkg/tmux: A client for controllingtmuxservers. Manages sessions, windows, and panes via the CLI or socket. Supports socket isolation for testing.git: Wrappers for git operations, specifically focusing on worktree management and status retrieval.command: A safe command executor that validates arguments to prevent injection and handles timeouts.
The tui package provides reusable Bubble Tea components:
navigator: A list-based browser for selecting projects or files.logviewer: A component for tailing files and streaming logs with filtering capabilities.jsontree: An interactive viewer for exploring structured JSON data.theme: Centralized color palette and style definitions (Kanagawa, Gruvbox).
While primarily a library, this repository compiles to a core binary used for debugging the ecosystem state.
core ws list: JSON output of the full discovery tree. Used bynavto populate the project list.core config-layers: Prints the merged configuration and the source file for each value.core logs: Aggregates and streams logs from.grove/logs/.core nvim-demo: Demonstrates the embedded Neovim component integration.
See the documentation for detailed usage instructions: