Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ openssl = { version = "0.10", features = ["vendored"] }
ratatui = { version = "0.29", default-features = false, features = ["crossterm"] }
regex = "1.11"
reqwest = { version = "0.12.18", default-features = false }
rmcp = { version = "2.2.0", features = ["server", "macros", "transport-io", "schemars"] }
schemars = "1"
serde = "1"
serde_json = "1.0.82"
serde_repr = "0.1"
Expand Down
2 changes: 2 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ open = { workspace = true }
ratatui = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots"] }
rmcp = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_repr = { workspace = true }
Expand Down
11 changes: 9 additions & 2 deletions crates/cli/src/account/me/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use crate::client;
use crate::token::get_smb_token::get_smb_token;
use crate::{
cli::CommandResult,
ui::{fail_message, fail_symbol, me_view::show_user_tui, succeed_message, succeed_symbol},
interface::is_tui,
ui::{
fail_message, fail_symbol, me_view::show_user_tui, plain, succeed_message, succeed_symbol,
},
};
use anyhow::{anyhow, Result};
use smbcloud_auth::me::me;
Expand All @@ -30,7 +33,11 @@ pub async fn process_me(env: Environment) -> Result<CommandResult> {
match me(env, client(), &token).await {
Ok(user) => {
spinner.stop_and_persist(&succeed_symbol(), succeed_message("Loaded."));
show_user_tui(&user).map_err(|e| anyhow!(e))?;
if is_tui() {
show_user_tui(&user).map_err(|e| anyhow!(e))?;
} else {
plain::render_user(&user);
}
Ok(CommandResult {
spinner: Spinner::new(
spinners::Spinners::SimpleDotsScrolling,
Expand Down
10 changes: 10 additions & 0 deletions crates/cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ pub struct Cli {
#[arg(long, global = true, env = "SMB_CI")]
pub ci: bool,

/// Full-screen TUI mode: render read commands in an interactive ratatui
/// view instead of plain text. Mutually exclusive with --mcp.
#[arg(long, global = true, conflicts_with = "mcp")]
pub tui: bool,

/// Run as an MCP (Model Context Protocol) server over stdio instead of a
/// one-shot command. Implies non-interactive; the subcommand is ignored.
#[arg(long, global = true)]
pub mcp: bool,

#[command(subcommand)]
pub command: Option<Commands>,
}
Expand Down
Loading
Loading