From 87044a747b47bd83249d61a45842c7f7b2eae56d Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 11 Jan 2026 05:52:14 +0000 Subject: Contract system --- makima/src/daemon/cli/mod.rs | 120 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 makima/src/daemon/cli/mod.rs (limited to 'makima/src/daemon/cli/mod.rs') diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs new file mode 100644 index 0000000..24c19c6 --- /dev/null +++ b/makima/src/daemon/cli/mod.rs @@ -0,0 +1,120 @@ +//! Command-line interface for the makima CLI. + +pub mod contract; +pub mod daemon; +pub mod server; +pub mod supervisor; + +use clap::{Parser, Subcommand}; + +pub use contract::ContractArgs; +pub use daemon::DaemonArgs; +pub use server::ServerArgs; +pub use supervisor::SupervisorArgs; + +/// Makima - unified CLI for server, daemon, and task management. +#[derive(Parser, Debug)] +#[command(name = "makima")] +#[command(version, about = "Makima CLI - server, daemon, and task management", long_about = None)] +pub struct Cli { + #[command(subcommand)] + pub command: Commands, +} + +#[derive(Subcommand, Debug)] +pub enum Commands { + /// Run the makima server + Server(ServerArgs), + + /// Run the daemon (connect to server, manage tasks) + Daemon(DaemonArgs), + + /// Supervisor commands for contract orchestration + #[command(subcommand)] + Supervisor(SupervisorCommand), + + /// Contract commands for task-contract interaction + #[command(subcommand)] + Contract(ContractCommand), +} + +/// Supervisor subcommands for contract orchestration. +#[derive(Subcommand, Debug)] +pub enum SupervisorCommand { + /// List all tasks in the contract + Tasks(SupervisorArgs), + + /// Get the task tree structure + Tree(SupervisorArgs), + + /// Create and start a new task + Spawn(supervisor::SpawnArgs), + + /// Wait for a task to complete + Wait(supervisor::WaitArgs), + + /// Read a file from a task's worktree + ReadFile(supervisor::ReadFileArgs), + + /// Create a git branch + Branch(supervisor::BranchArgs), + + /// Merge a task's changes to a branch + Merge(supervisor::MergeArgs), + + /// Create a pull request + Pr(supervisor::PrArgs), + + /// View task diff + Diff(supervisor::DiffArgs), + + /// Create a checkpoint + Checkpoint(supervisor::CheckpointArgs), + + /// List checkpoints + Checkpoints(SupervisorArgs), + + /// Get contract status + Status(SupervisorArgs), +} + +/// Contract subcommands for task-contract interaction. +#[derive(Subcommand, Debug)] +pub enum ContractCommand { + /// Get contract status + Status(ContractArgs), + + /// Get the phase checklist + Checklist(ContractArgs), + + /// Get contract goals + Goals(ContractArgs), + + /// List contract files + Files(ContractArgs), + + /// Get a specific file's content + File(contract::FileArgs), + + /// Report progress on the contract + Report(contract::ReportArgs), + + /// Get suggested next action + SuggestAction(ContractArgs), + + /// Get completion recommendation + CompletionAction(contract::CompletionActionArgs), + + /// Update a file (reads content from stdin) + UpdateFile(contract::UpdateFileArgs), + + /// Create a new file (reads content from stdin) + CreateFile(contract::CreateFileArgs), +} + +impl Cli { + /// Parse command-line arguments + pub fn parse_args() -> Self { + Self::parse() + } +} -- cgit v1.2.3