Skip to content

Commit 25fc128

Browse files
committed
Update configuration files and remove deprecated scripts
- Updated `Cargo.lock` and `Cargo.toml` to reflect new dependency versions and unified configuration paths. - Added a new `tools` member to the workspace for configuration management. - Removed obsolete scripts (`fix_json.py`, `install_mcp_servers.sh`, `mcpd_wrapper_fixed.sh`, `mcpd_wrapper_patch.sh`, `rebuild_cli.sh`, `rebuild_mcp_servers.sh`, and `updated_servers.json`) to streamline the project. - Enhanced the installation script to create a configuration directory and provide clearer next steps for users. - Updated documentation in `README.md` and other files to reflect changes in configuration paths and usage instructions.
1 parent 8da42d8 commit 25fc128

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4689
-2793
lines changed

.cursor/rules/02-cli.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The primary user interface is provided by the `gemini-cli` crate ([cli/README.md
1313
* **Wrapper:** The `gemini` command (usually installed via `install.sh` to `~/.bashrc` or `~/.zshrc`) is a crucial wrapper around `gemini-cli-bin` that manages session environment variables (`GEMINI_SESSION_ID`) for history persistence across separate command invocations. See the wrapper function definition in [README.md](mdc:README.md).
1414
* **Dependencies:** Leverages `gemini-core` for API communication, `gemini-mcp` for tool integration, and `gemini-memory` for memory features.
1515
* **Configuration:**
16-
* `~/.config/gemini-cli/config.toml`: Stores API key, default model, system prompt, feature flags (history, memory). Managed via `gemini --set-...` flags or manual editing. See [cli/README.md](mdc:cli/README.md) for details.
17-
* `~/.config/gemini-cli/mcp_servers.json`: Configures connections to MCP servers (used by the embedded MCP host or the `mcp-hostd` daemon). See [mcp/README.md](mdc:mcp/README.md).
16+
* `~/.config/gemini-suite/config.toml`: Stores API key, default model, system prompt, feature flags (history, memory broker, auto memory). Managed via `gemini --set-...` flags or manual editing. See [cli/README.md](mdc:cli/README.md).
17+
* `~/.config/gemini-suite/mcp_servers.json`: Configures connections to MCP servers (used by the embedded MCP host or the `mcp-hostd` daemon). See [mcp/README.md](mdc:mcp/README.md).
1818
* **Interaction Modes:** Supports single-shot prompts (default), interactive chat (`-i`), task loops (`-t`), and combined interactive task mode (`-i -t`). These are detailed in [INTERACTIVE-TASKS.md](mdc:INTERACTIVE-TASKS.md).
19-
* **History:** Saved in `~/.local/share/gemini-cli/history/`. Requires the wrapper function for history across commands.
19+
* **History:** Saved in `~/.local/share/gemini-suite/history/`. Requires the wrapper function for history across commands.
2020
* **Built-in Server Execution:** Can run built-in MCP servers directly via flags (`--filesystem-mcp`, `--command-mcp`, `--memory-store-mcp`).

.cursor/rules/03-mcp.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MCP allows Gemini to use external tools and services. This is primarily handled
1313
* Can run embedded within the CLI.
1414
* Can run as a standalone daemon: `mcp-hostd` ([mcp/src/bin/mcp-hostd.rs](mdc:mcp/src/bin/mcp-hostd.rs)).
1515
* **MCP Servers:** External processes providing tools (capabilities). The host connects to them based on configuration.
16-
* **Configuration:** Defined in `~/.config/gemini-cli/mcp_servers.json`. Specifies server name, transport (stdio, sse, websocket), command to launch (for stdio), etc. See [mcp/README.md](mdc:mcp/README.md) for format.
16+
* **Configuration:** Defined in `~/.config/gemini-suite/mcp_servers.json`. Specifies server name, transport (stdio, sse, websocket), command to launch (for stdio), etc. See [mcp/README.md](mdc:mcp/README.md) for format.
1717
* **Transports:** Supports `Stdio`, `SSE`, and `WebSocket`.
1818
* **Communication:** Uses JSON-RPC 2.0.
1919
* **Built-in Servers:** The source code for common servers is included within `gemini-mcp`:

.cursor/rules/04-memory.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Persistent, semantic memory is managed by the `gemini-memory` crate ([memory/REA
1313
* **`Memory` Struct ([memory/src/memory.rs](mdc:memory/src/memory.rs))**: Represents a single memory item (key, value, timestamp, tags, metadata, vector embedding).
1414
* **LanceDB Integration:**
1515
* Uses LanceDB ([https://lancedb.com/](mdc:https:/lancedb.com)) as the vector database for efficient storage and semantic search.
16-
* Database typically located at `~/.local/share/gemini-cli/memory.db` ([memory/src/config.rs](mdc:memory/src/config.rs)).
16+
* Database typically located at `~/.local/share/gemini-suite/memory.db` ([memory/src/config.rs](mdc:memory/src/config.rs)).
1717
* Schema defined using Apache Arrow ([memory/src/schema.rs](mdc:memory/src/schema.rs)), including a vector column.
1818
* CRUD operations and vector search are implemented using the LanceDB Rust SDK.
1919
* **Embeddings via MCP:**

Cargo.lock

Lines changed: 52 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"happe", # Host Application Environment daemon (Placeholder)
1111
"install", # Installer crate for Gemini CLI Suite
1212
"daemon-manager", # CLI for managing gemini-suite daemons and MCP servers
13+
"tools", # Tools for configuration, maintenance, etc.
1314
]
1415

1516
[workspace.lints]

README.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,31 +178,26 @@ The suite uses a couple of configuration files, primarily managed by the CLI:
178178

179179
### CLI Configuration (`config.toml`)
180180

181-
* **Location:** `~/.config/gemini-cli/config.toml`
182-
* **Content:** Stores API key, default system prompt, default model name, and feature flags (history, memory broker, auto memory).
183-
* **Management:** Use the `gemini` command with flags:
184-
* `gemini --set-api-key YOUR_API_KEY_HERE`
185-
* `gemini --set-system-prompt "Your desired prompt"`
186-
* `gemini --set-model "gemini-1.5-pro-latest"`
187-
* `gemini --show-config`
188-
* Or edit the file manually.
181+
* **Location:** `~/.config/gemini-suite/config.toml`
182+
* **Purpose:** Unified configuration for CLI, Daemons (HAPPE, IDA, mcp-hostd).
183+
* **Managed by:** `gemini config` or `gemini daemon-manager config` subcommands.
184+
* **Details:** See `cli/README.md` and `daemon-manager/README.md`.
189185

190186
### MCP Server Configuration (`mcp_servers.json`)
191187

192-
* **Location:** `~/.config/gemini-cli/mcp_servers.json`
193-
* **Content:** Defines how the MCP host (either `mcp-hostd` daemon or the one embedded in the CLI) should connect to MCP servers (built-in or external).
194-
* **Format:** JSON array of server objects. See the `gemini-mcp` README for details.
195-
* **Management:** Edit the file manually. The `install.sh` script may set up initial entries for built-in servers.
188+
* **Location:** `~/.config/gemini-suite/mcp_servers.json`
189+
* **Purpose:** Defines how the MCP Host connects to external tool servers.
190+
* **Managed by:** `gemini mcp` or `gemini daemon-manager mcp` subcommands.
196191

197192
### API Key Precedence 🔑
198193

199-
1. Value in `~/.config/gemini-cli/config.toml`.
194+
1. Value in `~/.config/gemini-suite/config.toml`.
200195
2. `GEMINI_API_KEY` environment variable.
201196
3. Value in a `.env` file in the current working directory (or project root during development).
202197

203198
### System Prompt Precedence 🗣️
204199

205-
1. Value in `~/.config/gemini-cli/config.toml`.
200+
1. Value in `~/.config/gemini-suite/config.toml`.
206201
2. Default prompt embedded in the CLI.
207202

208203
## 💡 CLI Usage
@@ -256,14 +251,12 @@ mcpd logs
256251

257252
### Chat History
258253

259-
* History is saved to files in `~/.local/share/gemini-cli/history/`.
260-
* To maintain history *across separate `gemini` commands*, the `GEMINI_SESSION_ID` environment variable must be set (the wrapper function helps manage this).
261-
* Use `--new-chat` to start fresh, `--disable-history` to temporarily ignore/not save history.
262-
* Long conversations are automatically summarized to manage token limits.
254+
* History is saved to files in `~/.local/share/gemini-suite/history/`.
255+
* Requires the wrapper function (installed by the installer) to work correctly across shell sessions.
263256

264257
### Memory Features
265258

266-
Powered by `gemini-memory` and LanceDB (`~/.local/share/gemini-cli/memory.db`).
259+
Powered by `gemini-memory` and LanceDB (`~/.local/share/gemini-suite/memory.db`).
267260

268261
* **Memory Broker (`--enable-memory-broker` / `--disable-memory-broker`):** Automatically retrieves relevant past memories and adds them as context to your prompts.
269262
* **Auto Memory (`--enable-auto-memory` / `--disable-auto-memory`):** Automatically extracts and saves key information from conversations.

UNIFIED_CONFIG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Plan for Unified Configuration in Gemini Suite
2+
3+
**Goal:** Consolidate configuration loading logic and settings for all Gemini Suite components (CLI, daemons) into a single source of truth (`gemini-core/src/config.rs`), managed by the `core` crate and potentially generated/updated by the `tools/generate_unified_config.rs` script. Exclude `mcp_servers.json`.
4+
5+
**Plan:**
6+
7+
1. **Define Unified Configuration Structure (`core` crate):**
8+
* Create `core/src/config.rs`.
9+
* Define `UnifiedConfig` struct holding all settings, using nested structs (e.g., `CliConfig`, `HappeConfig`, etc.).
10+
* Derive `serde::Serialize` and `serde::Deserialize`.
11+
* Choose TOML format and standard location (e.g., `~/.config/gemini-suite/config.toml` or env var `GEMINI_SUITE_CONFIG_PATH`).
12+
13+
2. **Implement Configuration Loading (`core` crate):**
14+
* Add dependencies (`serde`, `toml`, `config-rs`/`figment`, `directories`) to `core/Cargo.toml`.
15+
* Implement `load_config()` in `core/src/config.rs` to:
16+
* Find config file path.
17+
* Read and deserialize into `UnifiedConfig`.
18+
* Handle errors.
19+
* (Optional) Merge sources (file, env vars).
20+
21+
3. **Audit and Refactor Crates:**
22+
* **For each relevant crate (`cli`, `daemon-manager`, `happe`, `ida`, `mcp`, `memory`):**
23+
* **3.1 Audit:** Systematically search the crate's codebase (using `grep`, IDE search, etc.) for *any* existing configuration mechanisms:
24+
* Reading environment variables (e.g., `std::env::var`).
25+
* Reading specific config files (e.g., `.env`, custom formats).
26+
* Hardcoded configuration values.
27+
* `clap` arguments used for configuration values (not just operational flags).
28+
* Any pre-existing attempts at unified configuration.
29+
* **Maintain a meticulous log (`UNIFIED_CONFIG_REFACTOR_LOG.md`)** detailing the file, line number, and type of configuration found in each crate *before* refactoring.
30+
* **3.2 Add Dependency:** Add `gemini-core` to the crate's `Cargo.toml`.
31+
* **3.3 Refactor:** In the crate's entry point/initialization:
32+
* Call `gemini_core::config::load_config()` once.
33+
* Remove *all* identified legacy configuration logic (from step 3.1).
34+
* Pass the relevant parts of the loaded `UnifiedConfig` struct (e.g., `config.happe`) to the components needing them. Update function signatures and struct definitions as necessary.
35+
* **Update the refactoring log** indicating the changes made to replace the legacy logic with the unified config approach.
36+
* **Note:** Handle `install` and `tools` crates appropriately (config generation vs. runtime needs). `ipc` likely needs no config.
37+
38+
4. **Update Configuration Generator (`tools/generate_unified_config.rs`):**
39+
* Add `gemini-core` dependency.
40+
* Modify script to:
41+
* Use `gemini_core::config::UnifiedConfig`.
42+
* Populate defaults.
43+
* Serialize to TOML.
44+
* Write to the standard config path.
45+
46+
5. **Update Documentation:**
47+
* Modify `README.md` files (root, `cli`, `daemon-manager`, `happe`, `ida`, `mcp`, `memory`).
48+
* Document unified config file (location, format, structure, modification).
49+
* Explain `generate_unified_config` tool's role.
50+
51+
6. **Testing:**
52+
* Unit tests for `core::config::load_config()`.
53+
* Integration tests for all components verifying config usage.
54+
* Test overriding defaults.
55+
* Run `cargo clippy --all -- -D warnings` and `cargo fmt --all`.

0 commit comments

Comments
 (0)