1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Sage Agent CLI application
//!
//! A powerful command-line interface for interacting with AI agents.
//!
//! # Installation
//!
//! ```bash
//! cargo install --path crates/sage-cli
//! ```
//!
//! # CLI Modes Overview
//!
//! This CLI provides multiple execution modes for different use cases:
//!
//! ## 1. Interactive Mode (Default)
//! Start a conversation loop where you can have multi-turn conversations with the AI.
//! The AI remembers context across messages within the same conversation.
//!
//! - **Use when:** You want to have a back-and-forth conversation, iterating on tasks
//! - **Command:** `sage` or `sage interactive`
//! - **Example:** Ask the AI to create a file, then ask it to modify that file
//!
//! ## 2. Run Mode (One-shot)
//! Execute a single task and exit. Best for automation and scripting.
//! The AI completes the task and returns immediately.
//!
//! - **Use when:** You have a single, well-defined task to complete
//! - **Command:** `sage run "<task>"`
//! - **Example:** `sage run "Create a Python hello world script"`
//!
//! ## 3. Unified Mode (Advanced)
//! New execution model with inline user input blocking. Supports both interactive
//! and non-interactive modes via flag.
//!
//! - **Use when:** You need fine-grained control over execution behavior
//! - **Command:** `sage unified "<task>"`
//! - **Example:** `sage unified --non-interactive "Run tests"`
//!
//! ## 4. Utility Commands
//! Additional commands for configuration, trajectory analysis, and tool inspection.
//! See `sage --help` for full list.
// Allow common clippy lints that are stylistic preferences
use Parser;
use SageResult;
// Re-export for external use
pub use ;
async