Skip to content

Commit

Permalink
rename bp
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Jan 7, 2025
1 parent 77a453d commit 9dde469
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions crates/cli/src/commands/blueprints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub struct Blueprints {
pub enum BlueprintCommands {
/// List available blueprints
List(ListArgs),
/// Download a blueprint by workflow ID
Download(DownloadArgs),
/// Upload a blueprint by workflow ID
Upload(UploadArgs),
/// Pull a blueprint by workflow ID
Pull(PullArgs),
/// Push a blueprint by workflow ID
Push(PushArgs),
}

#[derive(Parser, Debug, Serialize)]
Expand Down Expand Up @@ -81,17 +81,17 @@ impl ListArgs {
}

#[derive(Parser, Debug, Serialize)]
pub struct DownloadArgs {
/// The workflow ID of the blueprint to download
pub struct PullArgs {
/// The workflow ID of the blueprint to pull
#[clap(long)]
workflow_id: String,

/// Force download even if the blueprint already exists
/// Force pull even if the blueprint already exists
#[clap(long)]
force: bool,
}

impl DownloadArgs {
impl PullArgs {
pub async fn run(&self, parent: &GlobalFormatFlags) -> Result<()> {
let input = format!(
r#"{{"workflow_id": "{}", "force": {} }}"#,
Expand All @@ -102,13 +102,13 @@ impl DownloadArgs {
}

#[derive(Parser, Debug, Serialize)]
pub struct UploadArgs {
/// The workflow ID of the blueprint to upload
pub struct PushArgs {
/// The workflow ID of the blueprint to push
#[clap(long)]
workflow_id: String,
}

impl UploadArgs {
impl PushArgs {
pub async fn run(&self, parent: &GlobalFormatFlags) -> Result<()> {
let input = format!(r#"{{"workflow_id": "{}"}}"#, self.workflow_id);
run_blueprint_workflow("blueprints/upload", Some(input), parent).await
Expand Down
10 changes: 5 additions & 5 deletions crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub enum Commands {
/// Print diagnostic information about the current environment
Doctor(DoctorArgs),
/// Manage blueprints for the Grit Agent
#[clap(alias = "blueprint")]
#[clap(aliases = ["blueprint", "bp"])]
Blueprints(Blueprints),
/// Authentication commands, run `grit auth --help` for more information
#[clap(name = "auth")]
Expand Down Expand Up @@ -203,8 +203,8 @@ impl fmt::Display for Commands {
},
Commands::Blueprints(arg) => match arg.blueprint_commands {
BlueprintCommands::List(_) => write!(f, "blueprints list"),
BlueprintCommands::Download(_) => write!(f, "blueprints download"),
BlueprintCommands::Upload(_) => write!(f, "blueprints upload"),
BlueprintCommands::Pull(_) => write!(f, "blueprints pull"),
BlueprintCommands::Push(_) => write!(f, "blueprints push"),
},
#[cfg(feature = "workflows_v2")]
Commands::Workflows(arg) => match arg.workflows_commands {
Expand Down Expand Up @@ -439,8 +439,8 @@ async fn run_command(_use_tracing: bool) -> Result<()> {
},
Commands::Blueprints(arg) => match arg.blueprint_commands {
BlueprintCommands::List(arg) => arg.run(&app.format_flags).await,
BlueprintCommands::Download(arg) => arg.run(&app.format_flags).await,
BlueprintCommands::Upload(arg) => arg.run(&app.format_flags).await,
BlueprintCommands::Pull(arg) => arg.run(&app.format_flags).await,
BlueprintCommands::Push(arg) => arg.run(&app.format_flags).await,
},
#[cfg(feature = "workflows_v2")]
Commands::Workflows(arg) => match arg.workflows_commands {
Expand Down

0 comments on commit 9dde469

Please sign in to comment.