From 5d8e3f80254f20eb6672701fad5f116a3b05dbc3 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 20 Jan 2026 00:23:49 +0000 Subject: Fix: auth for CLI and CLI SIGTERM --- makima/src/daemon/cli/view.rs | 111 ++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 75 deletions(-) (limited to 'makima/src/daemon/cli/view.rs') diff --git a/makima/src/daemon/cli/view.rs b/makima/src/daemon/cli/view.rs index f42c490..b5b516f 100644 --- a/makima/src/daemon/cli/view.rs +++ b/makima/src/daemon/cli/view.rs @@ -1,94 +1,69 @@ -//! View subcommand - interactive TUI browser for tasks, contracts, and files. +//! View subcommand - interactive TUI browser for contracts and tasks. //! //! The `makima view` command provides an interactive Terminal User Interface (TUI) -//! for browsing and managing makima entities. It features fuzzy search filtering, -//! keyboard navigation, and quick actions. +//! for browsing and managing makima contracts and their tasks. It features +//! drill-down navigation, fuzzy search filtering, and real-time task output streaming. //! //! # Usage //! //! ```bash -//! # Browse tasks interactively -//! makima view tasks +//! # Browse contracts interactively +//! makima view //! -//! # Browse contracts with an initial search query -//! makima view contracts "my project" -//! -//! # Browse files without preview pane -//! makima view files --no-preview -//! -//! # Browse tasks for a specific contract -//! makima view tasks --contract-id +//! # Browse with an initial search query +//! makima view "my project" //! //! # Change directory to selected task's worktree -//! cd $(makima view tasks) +//! cd $(makima view) //! ``` //! //! # Keyboard Shortcuts //! -//! | Key | Action | -//! |-------------|---------------------------| -//! | `↑` / `k` | Move selection up | -//! | `↓` / `j` | Move selection down | -//! | `Enter` | View/select item | -//! | `e` | Open in editor ($EDITOR) | -//! | `d` | Delete item (with confirm)| -//! | `Tab` | Toggle preview pane | -//! | `/` | Focus search input | -//! | `Esc` | Clear search / cancel | -//! | `q` | Quit | -//! | `c` | Navigate to worktree (cd) | -//! | `Ctrl+r` | Refresh data | -//! | `?` | Show help | +//! | Key | Action | +//! |---------------|-------------------------------| +//! | `↑` / `k` | Move selection up | +//! | `↓` / `j` | Move selection down | +//! | `Enter` / `l` | Drill into item | +//! | `Esc` / `h` | Go back to previous view | +//! | `e` | Edit item (inline) | +//! | `d` | Delete item (with confirm) | +//! | `/` | Focus search input | +//! | `Space` | Show details in preview pane | +//! | `q` | Quit | +//! | `c` | Navigate to worktree (cd) | +//! | `r` | Refresh data | +//! +//! # Navigation +//! +//! - **Contracts view**: Lists all contracts. Press Enter to see tasks. +//! - **Tasks view**: Shows tasks for a contract. Press Enter to view output. +//! - **Output view**: Streams real-time task output with tool call formatting. //! //! # Features //! +//! - **Drill-down Navigation**: Contracts → Tasks → Task Output //! - **Fuzzy Search**: Type to filter items in real-time -//! - **Multi-term Search**: Use space-separated terms (e.g., "fix bug") -//! - **Recency Sorting**: Recent items appear higher in results +//! - **Real-time Streaming**: View live task output via WebSocket //! - **Preview Pane**: See item details without leaving the list -//! - **Status Indicators**: Visual icons for task states -use clap::{Args, Subcommand}; -use uuid::Uuid; +use clap::Args; -/// Interactive TUI browser for tasks, contracts, and files. +/// Interactive TUI browser for contracts and tasks. /// -/// Provides a fuzzy-searchable interface for browsing and managing -/// makima entities with keyboard navigation and quick actions. +/// Provides a fuzzy-searchable interface for browsing contracts, +/// viewing their tasks, and streaming real-time task output. /// /// # Examples /// -/// Browse tasks: +/// Browse contracts: /// ```bash -/// makima view tasks +/// makima view /// ``` /// /// Browse with initial search: /// ```bash -/// makima view contracts "auth" +/// makima view "auth" /// ``` -#[derive(Subcommand, Debug)] -pub enum ViewCommand { - /// Browse tasks interactively - /// - /// Shows all tasks for the current contract with status indicators, - /// fuzzy search filtering, and quick actions. - Tasks(ViewArgs), - - /// Browse contracts interactively - /// - /// Lists all contracts with their phase, status, and task counts. - Contracts(ViewArgs), - - /// Browse files interactively - /// - /// Shows contract files with preview of their content. - Files(ViewArgs), -} - -/// Common arguments for view commands. -/// -/// These arguments are shared across all view subcommands (tasks, contracts, files). #[derive(Args, Debug, Clone)] pub struct ViewArgs { /// API URL for the makima server @@ -99,12 +74,6 @@ pub struct ViewArgs { #[arg(long, env = "MAKIMA_API_KEY")] pub api_key: String, - /// Contract ID to filter results (optional) - /// - /// When specified, only shows items belonging to this contract. - #[arg(long, env = "MAKIMA_CONTRACT_ID")] - pub contract_id: Option, - /// Initial search query /// /// Pre-populates the search field with this query when the TUI opens. @@ -117,12 +86,4 @@ pub struct ViewArgs { /// Useful for smaller terminal windows. #[arg(long)] pub no_preview: bool, - - /// Sort order for results - /// - /// - `recent`: Sort by last updated time (default) - /// - `name`: Sort alphabetically by name - /// - `status`: Group by status, then by name - #[arg(long, default_value = "recent")] - pub sort: String, } -- cgit v1.2.3