Skip to content

Commit 5768241

Browse files
committed
feat: add interactive memory management TUI
- Create SimpleMemoryTUI component with React + Ink - Support full CRUD operations on memory entries - Interactive interface with keyboard shortcuts - Multiple views: list, search, details, edit, delete, stats - Namespace filtering and wildcard search - Real-time memory statistics - Add memory-tui command with 'mtui' alias - Extract MemoryStorage utility for shared usage - Update build config to support JSX/React Features: - 📋 List all memory entries with namespace filtering - 🔍 Search with wildcard patterns (*theme*) - ✏️ Create/edit entries with namespace support - 🗑️ Delete entries with confirmation - 📊 View memory statistics and breakdown - 🎯 Keyboard shortcuts for quick navigation - 🧠 Full AI agent memory management
1 parent e96c6a5 commit 5768241

File tree

11 files changed

+2268
-93
lines changed

11 files changed

+2268
-93
lines changed

dist/index.cjs

Lines changed: 561 additions & 45 deletions
Large diffs are not rendered by default.

dist/index.js

Lines changed: 568 additions & 45 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
"bin": {
88
"sylphx-flow": "dist/index.js"
99
},
10-
"files": ["dist", "docs", "agents", "README.md", "LICENSE"],
10+
"files": [
11+
"dist",
12+
"docs",
13+
"agents",
14+
"README.md",
15+
"LICENSE"
16+
],
1117
"repository": {
1218
"type": "git",
1319
"url": "https://github.com/sylphxltd/flow.git"
@@ -57,6 +63,9 @@
5763
"commander": "^12.0.0",
5864
"figlet": "^1.9.3",
5965
"ink": "^6.3.1",
66+
"ink-select-input": "^6.2.0",
67+
"ink-table": "^3.1.0",
68+
"ink-text-input": "^6.0.0",
6069
"react": "^19.2.0",
6170
"zod": "^3.25.76"
6271
},

pnpm-lock.yaml

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Command } from 'commander';
22
import { initCommand } from './commands/init-command.js';
33
import { mcpCommand } from './commands/mcp-command.js';
44
import { memoryCommand } from './commands/memory-command.js';
5+
import { memoryTuiCommand, handleMemoryTui } from './commands/memory-tui-command.js';
56
import { syncCommand } from './commands/sync-command.js';
67
import { createCommand } from './utils/command-builder.js';
78
import { showDefaultHelp } from './utils/help.js';
@@ -20,6 +21,13 @@ export function createCLI(): Command {
2021
program.addCommand(createCommand(commandConfig));
2122
}
2223

24+
// Add TUI command separately since it has special handler
25+
program
26+
.command('memory-tui')
27+
.alias('mtui')
28+
.description('Launch interactive memory management TUI')
29+
.action(handleMemoryTui);
30+
2331
program.action(() => {
2432
showDefaultHelp();
2533
});

src/commands/memory-tui-command.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env node
2+
import { render } from 'ink';
3+
import React from 'react';
4+
import { SimpleMemoryTUI } from '../components/SimpleMemoryTUI.js';
5+
import type { CommandConfig } from '../types.js';
6+
7+
export const memoryTuiCommand: CommandConfig = {
8+
name: 'memory-tui',
9+
description: 'Launch interactive memory management TUI',
10+
options: [],
11+
};
12+
13+
export const handleMemoryTui = async () => {
14+
const { waitUntilExit } = render(React.createElement(SimpleMemoryTUI));
15+
await waitUntilExit();
16+
};

0 commit comments

Comments
 (0)