Skip to content

Commit 0730108

Browse files
evansenterclaude
andauthored
Extract clemitui into standalone repository (#105)
* docs: add missing details to CLAUDE.md Document config.toml fields, clemitui demo binary, MSRV 1.88, cargo-nextest usage, and cargo doc CI gate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract clemitui into standalone repo Move clemitui from crates/clemitui/ to evansenter/clemitui as an independent GitHub repository. clemini now references it as a git dependency instead of a workspace path dependency. No functional changes - all 283 tests pass, clippy clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Address PR feedback: commit Cargo.lock, remove workspace, add changelog - Commit Cargo.lock for reproducible builds (removed from .gitignore) - Remove single-member workspace wrapper from Cargo.toml - Add changelog entry for clemitui extraction - Update CI workflow to remove --workspace flags Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: fix stale --workspace flag in CLAUDE.md Remove --workspace from cargo doc command in quality gates section to match actual CI workflow after workspace removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9358dba commit 0730108

16 files changed

Lines changed: 4149 additions & 3771 deletions

File tree

.github/workflows/rust.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- uses: Swatinem/rust-cache@v2
2121
- name: Install mold linker
2222
run: sudo apt-get update && sudo apt-get install -y mold
23-
- name: Check workspace
24-
run: cargo check --workspace --all-targets --all-features
23+
- name: Check
24+
run: cargo check --all-targets --all-features
2525

2626
test:
2727
name: Test Suite
@@ -34,8 +34,7 @@ jobs:
3434
- name: Install mold linker
3535
run: sudo apt-get update && sudo apt-get install -y mold
3636
- name: Run unit tests
37-
run: cargo nextest run --workspace
38-
# Note: No doctests - clemini is a binary crate without a library target
37+
run: cargo nextest run
3938

4039
test-integration:
4140
name: Integration Tests
@@ -86,7 +85,7 @@ jobs:
8685
- name: Install mold linker
8786
run: sudo apt-get update && sudo apt-get install -y mold
8887
- name: Run clippy
89-
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
88+
run: cargo clippy --all-targets --all-features -- -D warnings
9089

9190
doc:
9291
name: Documentation
@@ -98,7 +97,7 @@ jobs:
9897
- name: Install mold linker
9998
run: sudo apt-get update && sudo apt-get install -y mold
10099
- name: Check documentation
101-
run: cargo doc --workspace --no-deps --document-private-items
100+
run: cargo doc --no-deps --document-private-items
102101
env:
103102
RUSTDOCFLAGS: -D warnings
104103

@@ -111,8 +110,8 @@ jobs:
111110
- uses: Swatinem/rust-cache@v2
112111
- name: Install mold linker
113112
run: sudo apt-get update && sudo apt-get install -y mold
114-
- name: Check workspace with MSRV
115-
run: cargo check --workspace
113+
- name: Check with MSRV
114+
run: cargo check
116115

117116
coverage:
118117
name: Code Coverage
@@ -127,7 +126,7 @@ jobs:
127126
- name: Install mold linker
128127
run: sudo apt-get update && sudo apt-get install -y mold
129128
- name: Generate coverage
130-
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
129+
run: cargo llvm-cov --lcov --output-path lcov.info
131130
- uses: codecov/codecov-action@v4
132131
with:
133132
files: lcov.info

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Rust
22
/target/
3-
Cargo.lock
43

54
# IDE
65
.idea/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Changed
11+
- Extracted clemitui into standalone repository ([evansenter/clemitui](https://github.com/evansenter/clemitui)), now referenced as a git dependency
12+
- Committed Cargo.lock for reproducible builds
13+
- Removed single-member workspace wrapper
14+
815
## [0.4.0] - 2026-01-24
916

1017
### Added

CLAUDE.md

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,7 @@ Logs are stored in `~/.clemini/logs/` with daily rotation.
3333

3434
The CLI has three modes: single-prompt (`-p "prompt"`), interactive REPL, and MCP server (`--mcp-server`).
3535

36-
### Workspace Structure
37-
38-
This project is a Cargo workspace with two crates:
39-
40-
```
41-
.
42-
├── Cargo.toml # Workspace root
43-
├── src/ # clemini crate (AI agent)
44-
└── crates/
45-
└── clemitui/ # TUI library crate (reusable by any ACP agent)
46-
```
47-
48-
#### clemini (AI Agent)
36+
### Source Structure
4937

5038
```
5139
src/
@@ -69,27 +57,9 @@ src/
6957
└── ... # Individual tool modules (edit, read, grep, etc.)
7058
```
7159

72-
#### clemitui (TUI Library)
73-
74-
Standalone crate for terminal UI, usable by any ACP-compatible agent:
75-
76-
```
77-
crates/clemitui/
78-
├── Cargo.toml
79-
├── src/
80-
│ ├── lib.rs # Re-exports
81-
│ ├── format.rs # Primitive formatting functions (tool output, warnings)
82-
│ ├── logging.rs # OutputSink trait, log_event functions
83-
│ └── text_buffer.rs # TextBuffer for streaming markdown
84-
└── tests/
85-
├── common/mod.rs # Shared test helpers (strip_ansi, RAII guards, CaptureSink)
86-
├── acp_simulation_tests.rs # 29 tests simulating ACP agent patterns
87-
└── e2e_tests.rs # 19 PTY-based tests for actual terminal output
88-
```
89-
90-
**Design**: clemitui takes primitive types (strings, durations, token counts), not genai-rs types. This allows it to work with any ACP agent. clemini's format.rs re-exports these and adds genai-rs-specific wrappers.
60+
### clemitui (External TUI Library)
9161

92-
Run clemitui tests: `cargo test -p clemitui`
62+
Terminal UI is provided by [clemitui](https://github.com/evansenter/clemitui), a standalone crate referenced as a git dependency. It takes primitive types (strings, durations, token counts), not genai-rs types, so it can work with any ACP agent. clemini's `format.rs` and `logging.rs` re-export clemitui's API and add genai-rs-specific wrappers.
9363

9464
### Event-Driven Architecture
9565

@@ -158,6 +128,9 @@ Debugging: `LOUD_WIRE=1` logs all HTTP requests/responses.
158128
- `GEMINI_API_KEY` - Required
159129
- Model: `gemini-3-flash-preview`
160130
- Config: `~/.clemini/config.toml` (optional)
131+
- `model` - Gemini model to use (default: `gemini-3-flash-preview`)
132+
- `bash_timeout` - Timeout in seconds for bash commands (default: 120)
133+
- `allowed_paths` - Additional paths tools can access beyond cwd (default: none)
161134

162135
## Documentation
163136

@@ -169,9 +142,10 @@ Debugging: `LOUD_WIRE=1` logs all HTTP requests/responses.
169142

170143
## Conventions
171144

172-
- Rust 2024 edition (let chains, etc.)
145+
- Rust 2024 edition (let chains, etc.), MSRV 1.88 (enforced in CI)
173146
- Tools return JSON: success data or `{"error": "..."}`
174147
- Tool errors return as JSON (not propagated) so Gemini can see them and retry
148+
- CI uses `cargo-nextest` for test execution (`make test-all` uses it locally too)
175149

176150
## Development Process
177151

@@ -189,6 +163,7 @@ Debugging: `LOUD_WIRE=1` logs all HTTP requests/responses.
189163
- `make clippy` (no warnings)
190164
- `make fmt` (run formatter, then commit any changes it makes)
191165
- `make test` (tests pass)
166+
- Documentation must compile without warnings (CI runs `cargo doc --no-deps --document-private-items` with `-D warnings`)
192167

193168
Don't skip tests. If a test is flaky or legitimately broken by your change, fix the test as part of the PR.
194169

@@ -216,7 +191,7 @@ Run locally with: `cargo test --test <name> -- --include-ignored --nocapture`
216191
These use `validate_response_semantically()` from `tests/common/mod.rs` - a second Gemini call with structured output that judges whether responses are appropriate. This provides a middle ground between brittle string assertions and purely structural checks.
217192

218193
**Shared test helpers** - Common patterns for test utilities:
219-
- Put shared helpers in `tests/common/mod.rs` (for clemini) or `crates/clemitui/tests/common/mod.rs` (for clemitui)
194+
- Put shared helpers in `tests/common/mod.rs`
220195
- Use `#![allow(dead_code)]` in shared test modules since not all test files use all helpers
221196
- RAII guards for cleanup: `DisableColors` (reset color override on drop), `LoggingGuard` (disable logging on drop)
222197
- Pattern: `let _guard = DisableColors::new();` at test start ensures cleanup even on panic

0 commit comments

Comments
 (0)