From 9d2df2fc667aab511794adf20b112ab7aa270a04 Mon Sep 17 00:00:00 2001 From: sshrushanth-ks Date: Tue, 26 May 2026 15:20:31 +0530 Subject: [PATCH 1/3] Support combined folder search with multiple -c flags search -c s -c d now returns Classic shared folders and KeeperDrive folders together in one JSON response. Changed -c from action='store' to action='append' so repeated flags accumulate instead of overwriting. JSON details field now shows Folder Category: Classic or Folder Category: KeeperDrive for folder results. --- keepercommander/commands/record.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keepercommander/commands/record.py b/keepercommander/commands/record.py index a507c0bd6..222a9b1c5 100644 --- a/keepercommander/commands/record.py +++ b/keepercommander/commands/record.py @@ -143,9 +143,11 @@ def register_command_info(aliases, command_info): search_parser = argparse.ArgumentParser(prog='search', description='Search the vault. Words can be in any order.') search_parser.add_argument('pattern', nargs='*', type=str, action='store', help='search terms (space-separated, order independent)') search_parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='verbose output') -search_parser.add_argument('-c', '--categories', dest='categories', action='store', - help='One or more of these letters for categories to search: "r" = records, ' - '"s" = shared folders, "t" = teams, "d" = Nested Share Folders') +search_parser.add_argument('-c', '--categories', dest='categories', action='append', + help='Category to search — repeatable: "r" = records, "s" = Classic shared folders, ' + '"t" = teams, "d" = KeeperDrive folders. ' + 'Pass multiple times (e.g. -c s -c d) or combine letters (e.g. -c sd). ' + 'Default when omitted: all categories (rstd).') search_parser.add_argument('--regex', dest='regex', action='store_true', help='treat pattern as a regular expression instead of space-separated search terms') search_parser.add_argument('--device', dest='device', action='store_true', @@ -1455,7 +1457,7 @@ def execute(self, params, **kwargs): else: pattern = '' # Empty pattern matches all in token mode - categories = (kwargs.get('categories') or 'rstd').lower() + categories = ''.join(kwargs.get('categories') or ['rstd']).lower() skip_details = not verbose nsf_records_map = getattr(params, 'nested_share_records', {}) or {} @@ -1575,14 +1577,12 @@ def execute(self, params, **kwargs): f"Type: {item['record_type']}, Description: {item['description']}, Record Category: {item.get('record_category', 'Classic')}"] elif item['type'] == 'shared_folder': row = [item['type'], item['shared_folder_uid'], item['name'], - f"Can Edit: {item['can_edit']}, Can Share: {item['can_share']}"] + 'Folder Category: Classic'] elif item['type'] == 'team': row = [item['type'], item['team_uid'], item['name'], f"Restrict Edit: {item['restrict_edit']}, Restrict View: {item['restrict_view']}, Restrict Share: {item['restrict_share']}"] elif item['type'] == 'nested_share_folder': - details = (f"Parent UID: {item['parent_uid']}" - if item.get('parent_uid') else '') - row = [item['type'], item['folder_uid'], item['name'], details] + row = [item['type'], item['folder_uid'], item['name'], 'Folder Category: KeeperDrive'] table.append(row) return base.dump_report_data(table, headers, fmt='json') From 09526723dd9523728a9c98b59e194008b26b639a Mon Sep 17 00:00:00 2001 From: sshrushanth-ks Date: Wed, 27 May 2026 17:03:19 +0530 Subject: [PATCH 2/3] Fix nested_share_folder details always shown in JSON search output NSF folders with no parent UID previously rendered an empty details field. Now always shows Folder Category: NestedShare, with Parent UID appended when the folder is not at root level. --- keepercommander/commands/record.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keepercommander/commands/record.py b/keepercommander/commands/record.py index 222a9b1c5..b868e4be9 100644 --- a/keepercommander/commands/record.py +++ b/keepercommander/commands/record.py @@ -1577,12 +1577,15 @@ def execute(self, params, **kwargs): f"Type: {item['record_type']}, Description: {item['description']}, Record Category: {item.get('record_category', 'Classic')}"] elif item['type'] == 'shared_folder': row = [item['type'], item['shared_folder_uid'], item['name'], - 'Folder Category: Classic'] + f"Folder Category: Classic, Can Edit: {item['can_edit']}, Can Share: {item['can_share']}"] elif item['type'] == 'team': row = [item['type'], item['team_uid'], item['name'], f"Restrict Edit: {item['restrict_edit']}, Restrict View: {item['restrict_view']}, Restrict Share: {item['restrict_share']}"] elif item['type'] == 'nested_share_folder': - row = [item['type'], item['folder_uid'], item['name'], 'Folder Category: KeeperDrive'] + details = 'Folder Category: NestedShare' + if item.get('parent_uid'): + details += f", Parent UID: {item['parent_uid']}" + row = [item['type'], item['folder_uid'], item['name'], details] table.append(row) return base.dump_report_data(table, headers, fmt='json') From 8a4111bb486c1c3afc0b4764cac83a3b9b3ce0f2 Mon Sep 17 00:00:00 2001 From: sshrushanth-ks Date: Thu, 28 May 2026 16:01:29 +0530 Subject: [PATCH 3/3] Fix help text for -c flag to use Nested Share Folders instead of KeeperDrive --- keepercommander/commands/record.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keepercommander/commands/record.py b/keepercommander/commands/record.py index b868e4be9..422243d21 100644 --- a/keepercommander/commands/record.py +++ b/keepercommander/commands/record.py @@ -144,8 +144,8 @@ def register_command_info(aliases, command_info): search_parser.add_argument('pattern', nargs='*', type=str, action='store', help='search terms (space-separated, order independent)') search_parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='verbose output') search_parser.add_argument('-c', '--categories', dest='categories', action='append', - help='Category to search — repeatable: "r" = records, "s" = Classic shared folders, ' - '"t" = teams, "d" = KeeperDrive folders. ' + help='Category to search — repeatable: "r" = records, "s" = shared folders, ' + '"t" = teams, "d" = Nested Share folders. ' 'Pass multiple times (e.g. -c s -c d) or combine letters (e.g. -c sd). ' 'Default when omitted: all categories (rstd).') search_parser.add_argument('--regex', dest='regex', action='store_true',