mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-06-30 18:11:39 +02:00
Add CLI import and export commands (#484)
This commit is contained in:
@@ -42,6 +42,12 @@ pub enum Commands {
|
||||
/// Authentication commands
|
||||
Auth(AuthArgs),
|
||||
|
||||
/// Import API data from Yaak, OpenAPI, Postman, Insomnia, Swagger, or cURL
|
||||
Import(ImportArgs),
|
||||
|
||||
/// Export Yaak workspace data
|
||||
Export(ExportArgs),
|
||||
|
||||
/// Plugin development and publishing commands
|
||||
Plugin(PluginArgs),
|
||||
|
||||
@@ -92,6 +98,34 @@ pub struct SendArgs {
|
||||
pub fail_fast: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct ImportArgs {
|
||||
/// Path to the file to import
|
||||
pub file: PathBuf,
|
||||
|
||||
/// Existing workspace ID to import into when supported by the importer
|
||||
#[arg(long = "workspace-id", value_name = "WORKSPACE_ID")]
|
||||
pub workspace_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct ExportArgs {
|
||||
/// Path to write the Yaak export JSON file
|
||||
pub file: PathBuf,
|
||||
|
||||
/// Workspace IDs to export (defaults to the only workspace when exactly one exists)
|
||||
#[arg(value_name = "WORKSPACE_ID")]
|
||||
pub workspace_ids: Vec<String>,
|
||||
|
||||
/// Export all workspaces
|
||||
#[arg(long, conflicts_with = "workspace_ids")]
|
||||
pub all: bool,
|
||||
|
||||
/// Include private environments in the export
|
||||
#[arg(long)]
|
||||
pub include_private_environments: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
#[command(disable_help_subcommand = true)]
|
||||
pub struct CookieJarArgs {
|
||||
|
||||
Reference in New Issue
Block a user