Skip to content

feat(#21,#48): apc memory list rich tables + apc memory remove command - #64

Open
forge-fz2000 wants to merge 4 commits into
mainfrom
feat/issue-21-48-memory-list-remove
Open

forge-fz2000 wants to merge 4 commits into
mainfrom
feat/issue-21-48-memory-list-remove

Conversation

@forge-fz2000

@forge-fz2000 forge-fz2000 commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #21
Fixes #48

Changes

Issue #21apc memory list: Rich table output

Rewrote apc memory list from plain text to three Rich tables, one per entry type. Added --tool to filter by source.

Before (plain text):

claude-code: CLAUDE.md (1.2 KB)
openclaw: MEMORY.md (3.4 KB)
[manual] preference: Always respond in English

After (Rich tables):

         Collected Files (2)         
┏━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ ID       ┃ Source Tool ┃ File       ┃ Size  ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│ a1b2c3d4 │ claude-code │ CLAUDE.md  │ 1.2 KB│
│ e5f6a7b8 │ openclaw    │ MEMORY.md  │ 3.4 KB│
└──────────┴─────────────┴────────────┴───────┘

        Manual Entries (1)        
┏━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ID       ┃ Category   ┃ Content                         ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ c9d0e1f2 │ preference │ Always respond in English       │
└──────────┴────────────┴─────────────────────────────────┘

3 total entries

Filter by tool:

apc memory list --tool claude-code
# Shows only entries collected from claude-code

Issue #48apc memory remove: four removal modes

New subcommand with four ways to remove entries. All destructive operations require confirmation unless -y/--yes is passed.

By ID prefix (from the ID column in apc memory list):

apc memory remove a1b2c3d4
# Remove entry a1b2c3d4? [y/N]: y
# ✓ Removed 1 entry.

By source tool — removes all entries collected from that tool:

apc memory remove --tool openclaw
# Remove 3 entries from 'openclaw'? [y/N]: y
# ✓ Removed 3 entries.

# Skip confirmation:
apc memory remove --tool openclaw -y

Clear everything:

apc memory remove --all
# Remove all 12 memory entries? [y/N]: y
# ✓ Removed 12 entries.

Interactive picker (no arguments) — shows the Rich table and prompts for an ID:

apc memory remove
# [displays full memory list table]
# Entry ID to remove: a1b2c3d4
# Remove entry a1b2c3d4? [y/N]: y
# ✓ Removed 1 entry.

Issue #21 — apc memory list rich tables:
Rewrote 'apc memory list' to display three Rich tables:
- Collected Files: ID, source_tool, file, size
- Manual Entries: ID, category, content preview
- Legacy Entries: category, source, content preview
Added --tool filter to show entries for a specific source tool only.

Issue #48 — apc memory remove command:
Added 'apc memory remove' with four usage modes:
- apc memory remove <id>         — remove by ID prefix (supports partial match)
- apc memory remove --tool <t>   — remove all entries from a source tool
- apc memory remove --all        — clear entire cache
- apc memory remove              — interactive selection with Rich table

All destructive modes require confirmation unless -y/--yes is passed.
@forge-fz2000
forge-fz2000 requested a review from FZ2000 as a code owner March 9, 2026 03:15
memory list (11 tests):
- empty cache → helpful message
- collected files / manual / legacy tables each render
- all three tables together
- total count footer
- --tool filter: matching shown, non-matching filtered
- --tool filter: no match → message
- long content truncated at 80 chars
- size in bytes vs KB
- ID prefix displayed correctly

memory remove (22 tests):
- empty cache for all modes (--all, --tool, id)
- --all: clears cache, reports count, cancel keeps cache, confirm proceeds
- --tool: removes matching only, keeps others, reports count,
  no-match message, cancel keeps cache
- by ID prefix: removes correct entry, no-match message,
  ambiguous prefix lists matches without removal, cancel keeps cache,
  success message
- interactive: valid selection removes, 'q' cancels, out-of-range rejected,
  table displayed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants