$ show aws/amazon-q-developer-cli
This repository is the open-source CLI client for Amazon Q Developer (formerly CodeWhisperer), now deprecated in favor of the closed-source Kiro CLI. It is a Rust workspace with approximately 2000 files, building two main binaries: `q` (terminal chat assistant) and `qchat` (legacy chat binary). The codebase is dominated by auto-generated AWS SDK client crates (amzn-codewhisperer-client, amzn-codewhisperer-streaming-client, amzn-qdeveloper-streaming-client, amzn-consolas-client, amzn-toolkit-telemetry-client), which are Smithy-generated and checked in. Hand-written code includes the chat CLI interactive loop, an agent framework with MCP (Model Context Protocol) support, a semantic search client using local ONNX models (MiniLM) and BM25 indexing, authentication (OIDC with device grant flow), telemetry, and an OS abstraction layer. The architecture is essentially a monolithic CLI application with multiple supporting libraries. About 90% of the source files are generated code, which means the hand-crafted components are relatively small. The project was previously actively maintained but is now effectively archived; the README states only critical security fixes will be accepted.
The LLM identified 4 files worth highlighting for reuse:
Defines an `Os` struct that encapsulates all operating system interactions (env, fs, sysinfo, database, api client, telemetry) behind trait-based abstractions. This enables the chat application to be tested by injecting mock implementations, and the entire IO surface can be replaced for different environments. The pattern is clean and could be extracted for any Rust application needing testable OS boundaries.
Implements a typed request/response channel using `tokio::sync::oneshot` for sending a request and receiving a reply asynchronously. The `RequestSender` and `Request` types provide a reusable mechanism for message passing between components. Includes macros for generating request types. This is solid infrastructure for any async multi-component system in Rust.
Defines the `TextEmbedderTrait` with embed/embed_batch methods and `BenchmarkableEmbedder` trait for performance testing. This abstraction allows swapping between real Candle-based models and mock embedders for testing. The separation of trait from implementation makes it easy to integrate different embedding backends.
A centralized color theme system with semantic categories (`StatusColors`, `UiColors`, `InteractiveColors`). Provides a clean palette for CLI UI without hardcoding ANSI codes. The theme struct can be serialized/deserialized, making it configurable. Demonstrates good separation of concerns for terminal styling.