MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / vault_list

Function vault_list

atomic-cli/src/commands/rpc.rs:2044–2083  ·  view source on GitHub ↗

`atomic vault list` over ListVaultEntries — every form. kind absent is the WHOLE-VAULT listing: every entry with its type, content size, and updated-at date, filtered by the request's path prefix and entry type; the CLI renders with the same table/JSON code the local body uses.

(args: &super::vault::list::List)

Source from the content-addressed store, hash-verified

2042/// type; the CLI renders with the same table/JSON code the local body
2043/// uses.
2044pub fn vault_list(args: &super::vault::list::List) -> CliResult<bool> {
2045 let Some(session) = Service::open()? else {
2046 return Ok(false);
2047 };
2048 // The local parse: an unknown --type value parses to no filter (the
2049 // local body lists everything), so only a PARSED type rides the wire.
2050 let type_filter = args
2051 .r#type
2052 .as_deref()
2053 .and_then(atomic_core::pristine::VaultEntryType::parse);
2054 let request = pb::ListVaultEntriesRequest {
2055 repository: Some(session.reference.clone()),
2056 kind: None,
2057 status: None,
2058 summaries_only: true,
2059 cursor: None,
2060 budget: None,
2061 view: None,
2062 identity: None,
2063 path_prefix: args.prefix.clone(),
2064 entry_type: type_filter.map(|kind| kind.to_string()),
2065 status_filter: None,
2066 tool_result_previews: false,
2067 sort: None,
2068 reverse: false,
2069 };
2070 let response = session.list_vault_entries(request)?;
2071 let rows = response
2072 .entries
2073 .iter()
2074 .map(|entry| super::vault::list::EntryRow {
2075 path: entry.vault_path.clone().unwrap_or_default(),
2076 entry_type: entry.entry_type.clone().unwrap_or_default(),
2077 size: entry.content_size.unwrap_or(0),
2078 updated_at: entry.updated_at_label.clone().unwrap_or_default(),
2079 })
2080 .collect::<Vec<_>>();
2081 super::vault::list::render_rows(&rows, args.json);
2082 Ok(true)
2083}
2084
2085/// `atomic vault show <path>` over GetVaultEntry — every form. The
2086/// wire resolves by vault-relative path (any entry type) and carries

Callers 1

runMethod · 0.85

Calls 5

openFunction · 0.85
render_rowsFunction · 0.85
cloneMethod · 0.45
list_vault_entriesMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected