Skip to main content
Glama
8b-is
by 8b-is
file_history_demo.sh1.77 kB
#!/bin/bash # File History Demo - Shows how to use the new file history tracking system # 🎸 The Cheet says: "Track every change, remember every moment!" echo "=== Smart Tree File History Demo ===" echo "The Ultimate Context-Driven System" echo "" # Test file for demonstration TEST_FILE="./tmp/demo_file.txt" echo "1. Creating a test file..." echo "Hello, World!" > "$TEST_FILE" echo "" echo "2. Tracking file creation with MCP..." cat << 'EOF' mcp.callTool('track_file_operation', { file_path: './tmp/demo_file.txt', operation: 'create', new_content: 'Hello, World!', agent: 'demo-agent', session_id: 'demo-session-1' }) EOF echo "" echo "3. Appending content (favored operation)..." echo "This is an append operation." >> "$TEST_FILE" echo "" echo "4. Tracking the append..." cat << 'EOF' mcp.callTool('track_file_operation', { file_path: '/tmp/demo_file.txt', old_content: 'Hello, World!', new_content: 'Hello, World!\nThis is an append operation.', agent: 'demo-agent', session_id: 'demo-session-1' }) EOF echo "" echo "5. Getting file history..." cat << 'EOF' mcp.callTool('get_file_history', { file_path: '/tmp/demo_file.txt' }) EOF echo "" echo "6. Getting project summary..." cat << 'EOF' mcp.callTool('get_project_history_summary', { project_path: '/tmp' }) EOF echo "" echo "=== File History Storage Location ===" echo "All history is stored in: ~/.mem8/.filehistory/" echo "Format: project_id/YYYYMMDD_HHMM.flg" echo "" echo "Each log entry contains:" echo "- Timestamp (unix time)" echo "- File path" echo "- Operation code (A=Append, C=Create, R=Replace, etc.)" echo "- Before/after hashes" echo "- Agent identifier" echo "- Session ID" echo "" echo "🎸 The Cheet says: 'Every file has a story - now we can tell it!'"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/8b-is/smart-tree'

If you have feedback or need assistance with the MCP directory API, please join our Discord server