Merged
Conversation
- Add Table of Contents and Big Picture section with analogy - Use 'Breaking it down' tables for configuration explanations - Add step-by-step explanations with 'What this tests' callouts - Include state machine diagram for status transitions - Add Key Rust Concepts reference table - Add Common Patterns section with code examples - Match style of Backend Registry walkthrough Audience: Junior developers joining the project
- Define all CLI commands (serve, backends, models, health, config) - Document complete TOML configuration format - Specify config precedence: CLI > env > file > defaults - Define environment variable overrides (NEXUS_*) - Include data structures for NexusConfig and clap Args - Add 15 functional requirements and 5 NFRs - Define error handling with helpful messages - Include 18 acceptance criteria - Tech stack: clap (derive), config, toml, comfy-table Priority: P0 (Core MVP) Depends on: F02 Backend Registry, F03 Health Checker
7 phases covering: - Phase 1: Configuration module with layered loading (10 tests) - Phase 2: CLI command definitions with clap derive (8 tests) - Phase 3: Output formatting with comfy-table (6 tests) - Phase 4: Serve command with graceful shutdown (8 tests) - Phase 5: Query commands (backends, models, health) (10 tests) - Phase 6: Config init command (4 tests) - Phase 7: Integration tests with assert_cmd (10 tests) Total: 56 tests (46 unit + 10 integration) New dependencies: comfy-table, config crate, colored Tech: clap derive, TOML config, tracing subscriber
16 tasks totaling ~27 hours: - T01-T05: Configuration module (10h) - T06-T07: CLI definitions and output (4h) - T08: Serve command (3h) - T09-T13: Query commands and config init (8h) - T14-T16: Shutdown, integration tests, docs (5.5h) 66 tests total: - 52 unit tests - 10 integration tests (assert_cmd) - 4 doc tests Each task is: - Completable in 1-4 hours - Independently testable - Has clear acceptance criteria
Decisions made: 1. Shell completions: Top-level 'nexus completions <shell>' command - Follows patterns from rustup, gh, kubectl - Added new FR-016 and T14 for completions 2. Config validation: Warn on unknown keys, continue loading - Forward compatible, catches typos in logs - Added FR-017 for unknown key warnings 3. Backend auto-detection: Auto-detect with fallback to generic - Detection order: Ollama → LlamaCpp → OpenAI → Generic - 2s timeout per endpoint, fallback to Generic on failure - Updated T10 with auto-detection tests and implementation Updated artifacts: - spec.md: Added Design Decisions section, completions command, FR-016/FR-017 - tasks.md: Added T14 (Completions), updated T10 (auto-detection), renumbered T15-T17 - Total tests: 70 (was 66)
…-T14) Implements core CLI and configuration functionality for Nexus. ## Configuration Module - NexusConfig with all sub-configs (server, routing, logging, discovery, health_check) - TOML file loading with serde defaults - Environment variable overrides (NEXUS_*) - Proper enums with snake_case serialization ## CLI Module - Full command structure using clap derive - Commands: serve, backends, models, health, config, completions - Table formatting with comfy-table - JSON output support - Colored status indicators ## Working Commands - `nexus config init` - Initialize configuration file - `nexus completions <shell>` - Generate shell completions - `nexus --help` - Show help information ## Testing - 127 tests passing (19 config + 18 cli + 84 registry + 6 health) - Zero clippy warnings - Release binary: 924KB ## Files Added - src/config/ (8 files) - Configuration module - src/cli/ (8 files) - CLI module ## Next Steps - T08-T12: Implement command handlers (serve, backends, models, health) - T15: Graceful shutdown - T16: Integration tests - T17: Documentation
Complete implementation of CLI and Configuration feature: - T08: Serve command with config loading, tracing init, health checker - T09: Backends list command with status filtering and JSON output - T10: Backends add/remove with auto-detection (Ollama→LlamaCpp→OpenAI→Generic) - T11: Models command with aggregation across backends - T12: Health command showing system status and uptime - T15: Graceful shutdown on SIGINT/SIGTERM - T16: 10 CLI integration tests using assert_cmd Total: 171 tests passing All clippy warnings resolved
- Add module-level documentation with examples to config and cli modules - Add doc comments to NexusConfig struct with usage examples - Update README with comprehensive CLI command reference - Add environment variables documentation - Apply cargo fmt formatting - All 173 tests passing (151 unit + 10 CLI integration + 6 health + 6 doc)
- Remove unused chrono::Utc import in registry tests - Prefix unused test variables with underscore - Allow deprecated cargo_bin in CLI integration tests - Use struct initializer syntax instead of field assignment
leocamello
added a commit
that referenced
this pull request
Feb 17, 2026
Squash merge F04: CLI and Configuration Implements comprehensive CLI interface and layered configuration system. Review notes: - Signal handler panic on installation failure is acceptable (matches tokio patterns) - api_key_env field is a placeholder for F05 (Authentication feature)
leocamello
added a commit
that referenced
this pull request
Feb 17, 2026
Squash merge F04: CLI and Configuration Implements comprehensive CLI interface and layered configuration system. Review notes: - Signal handler panic on installation failure is acceptable (matches tokio patterns) - api_key_env field is a placeholder for F05 (Authentication feature)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature: CLI and Configuration (F04)
Implements comprehensive CLI interface and layered configuration system for Nexus.
Summary
Commands Implemented
nexus servenexus backends listnexus backends addnexus backends removenexus modelsnexus healthnexus config initnexus completionsConfiguration Precedence
Files Added/Modified
src/cli/- 8 files (mod.rs, serve.rs, backends.rs, models.rs, health.rs, output.rs, config.rs, completions.rs)src/config/- 7 files (mod.rs, server.rs, routing.rs, logging.rs, backend.rs, discovery.rs, error.rs)src/main.rs- Command routingtests/cli_integration.rs- End-to-end CLI testsspecs/003-cli-configuration/- spec.md, plan.md, tasks.md, walkthrough.mdRelated Issues
Closes #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43
Breaking Changes
None - new feature.