feat: allow --list to accept item IDs for filtering

- Local and client/server modes now support ID-based filtering
- keep -l 1 2 3 lists specific items by ID
- keep -l --ids-only 1 2 3 outputs just those IDs
- Server API adds optional 'ids' query parameter to GET /api/item/
- KeepClient.list_items gains ids parameter
This commit is contained in:
2026-03-17 17:56:35 -03:00
parent 02f0c8d453
commit 074ba64805
7 changed files with 39 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ pub fn mode(
client: &KeepClient,
_cmd: &mut Command,
settings: &crate::config::Settings,
ids: &[i64],
tags: &[String],
) -> Result<(), anyhow::Error> {
debug!("CLIENT_LIST: Listing items via remote server");
@@ -19,7 +20,7 @@ pub fn mode(
.iter()
.map(|(k, v)| (k.clone(), v.clone()))
.collect();
let items = client.list_items(tags, "newest", 0, 100, &meta_filter)?;
let items = client.list_items(ids, tags, "newest", 0, 100, &meta_filter)?;
if settings.ids_only {
for item in &items {