test cli stream

This commit is contained in:
2025-06-16 22:09:04 +09:00
parent 889ce8baa1
commit 1e83b50e3f
12 changed files with 776 additions and 82 deletions

View File

@ -102,7 +102,23 @@ enum Commands {
#[derive(Subcommand)]
enum AuthCommands {
/// Initialize OAuth authentication
Init,
Init {
/// Specify PDS server (e.g., syu.is, bsky.social)
#[arg(long)]
pds: Option<String>,
/// Handle/username for authentication
#[arg(long)]
handle: Option<String>,
/// Use password authentication instead of JWT
#[arg(long)]
password: bool,
/// Access JWT token (alternative to password auth)
#[arg(long)]
access_jwt: Option<String>,
/// Refresh JWT token (required with access-jwt)
#[arg(long)]
refresh_jwt: Option<String>,
},
/// Show current authentication status
Status,
/// Logout and clear credentials
@ -122,6 +138,14 @@ enum StreamCommands {
#[arg(long)]
ai_generate: bool,
},
/// Initialize user list for admin account
Init {
/// Path to the blog project directory
project_dir: Option<PathBuf>,
/// Handles to add to initial user list (comma-separated)
#[arg(long)]
handles: Option<String>,
},
/// Stop monitoring
Stop,
/// Show monitoring status
@ -183,8 +207,8 @@ async fn main() -> Result<()> {
}
Commands::Auth { command } => {
match command {
AuthCommands::Init => {
commands::auth::init().await?;
AuthCommands::Init { pds, handle, password, access_jwt, refresh_jwt } => {
commands::auth::init_with_options(pds, handle, password, access_jwt, refresh_jwt).await?;
}
AuthCommands::Status => {
commands::auth::status().await?;
@ -199,6 +223,9 @@ async fn main() -> Result<()> {
StreamCommands::Start { project_dir, daemon, ai_generate } => {
commands::stream::start(project_dir, daemon, ai_generate).await?;
}
StreamCommands::Init { project_dir, handles } => {
commands::stream::init_user_list(project_dir, handles).await?;
}
StreamCommands::Stop => {
commands::stream::stop().await?;
}