feat(cli/org): org add document with collection-scoped attachment

This commit is contained in:
adlee-was-taken
2026-06-20 21:13:26 -04:00
parent db0ab1d82e
commit bd323d8b1b
2 changed files with 29 additions and 7 deletions

View File

@@ -614,6 +614,13 @@ pub(crate) enum OrgAddKind {
#[arg(long, value_delimiter = ',')] tags: Vec<String>,
#[arg(long)] secret_stdin: bool,
},
/// A document (file payload encrypted into a collection-scoped attachment).
Document {
#[arg(long)] collection: String,
#[arg(long)] title: String,
#[arg(long)] file: std::path::PathBuf,
#[arg(long, value_delimiter = ',')] tags: Vec<String>,
},
}
fn main() -> Result<()> {
@@ -737,6 +744,11 @@ fn main() -> Result<()> {
commands::org::OrgAddKind::Totp { title, issuer, label, secret, secret_stdin, period, digits, algorithm },
tags,
),
OrgAddKind::Document { collection, title, file, tags } => (
collection,
commands::org::OrgAddKind::Document { title, file },
tags,
),
};
commands::org::run_add(&d, &collection, add_kind, tags)?;
}