Skip to content

feat: Add 'q webchat' command #2480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
220 changes: 214 additions & 6 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/chat-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ url.workspace = true
uuid.workspace = true
walkdir.workspace = true
webpki-roots.workspace = true
web-terminal = { path = "../web-terminal" }
whoami.workspace = true
winnow.workspace = true
schemars.workspace = true
Expand Down
10 changes: 8 additions & 2 deletions crates/chat-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod issue;
mod mcp;
mod settings;
mod user;
mod webchat;

use std::fmt::Display;
use std::io::{
Expand Down Expand Up @@ -43,6 +44,7 @@ use crate::cli::user::{
LoginArgs,
WhoamiArgs,
};
use crate::cli::webchat::WebchatArgs;
use crate::logging::{
LogArgs,
initialize_logging,
Expand Down Expand Up @@ -89,6 +91,8 @@ pub enum RootSubcommand {
Agent(AgentArgs),
/// AI assistant in your terminal
Chat(ChatArgs),
/// AI assistant in your web browser
Webchat(WebchatArgs),
/// Log in to Amazon Q
Login(LoginArgs),
/// Log out of Amazon Q
Expand Down Expand Up @@ -123,11 +127,11 @@ impl RootSubcommand {
///
/// Emitting telemetry takes a long time so the answer is usually no.
pub fn valid_for_telemetry(&self) -> bool {
matches!(self, Self::Chat(_) | Self::Login(_) | Self::Profile | Self::Issue(_))
matches!(self, Self::Chat(_) | Self::Webchat(_) | Self::Login(_) | Self::Profile | Self::Issue(_))
}

pub fn requires_auth(&self) -> bool {
matches!(self, Self::Chat(_) | Self::Profile)
matches!(self, Self::Chat(_) | Self::Webchat(_) | Self::Profile)
}

pub async fn execute(self, os: &mut Os) -> Result<ExitCode> {
Expand Down Expand Up @@ -155,6 +159,7 @@ impl RootSubcommand {
Self::Issue(args) => args.execute(os).await,
Self::Version { changelog } => Cli::print_version(changelog),
Self::Chat(args) => args.execute(os).await,
Self::Webchat(args) => args.execute(os).await,
Self::Mcp(args) => args.execute(os, &mut std::io::stderr()).await,
}
}
Expand All @@ -171,6 +176,7 @@ impl Display for RootSubcommand {
let name = match self {
Self::Agent(_) => "agent",
Self::Chat(_) => "chat",
Self::Webchat(_) => "webchat",
Self::Login(_) => "login",
Self::Logout => "logout",
Self::Whoami(_) => "whoami",
Expand Down
Loading