UNPKG

trace.ai-cli

Version:

A powerful AI-powered CLI tool

64 lines (51 loc) 2.68 kB
// All commands in one place. Every UI surface (welcome, help, autocomplete, memory show) reads from here. const allCommands = [ // Analysis { cmd: '<path> [question]', desc: 'Analyze any file, folder, or image (auto-detected)', group: 'main' }, { cmd: '!<command>', desc: 'Run a shell command (e.g., !ls, !npm start)', group: 'main' }, // Memory { cmd: '/memory', desc: 'Manage memory contexts', group: 'main' }, { cmd: '/memory "text"', desc: 'Add text as memory', group: 'memory' }, { cmd: '/memory <path>', desc: 'Add file/folder/keylink url as memory', group: 'memory' }, { cmd: '/memory show', desc: 'Show all memories', group: 'memory' }, { cmd: '/memory 1,2,3', desc: 'Activate specific memories', group: 'memory' }, { cmd: '/memory 0', desc: 'Deselect all active memories', group: 'memory' }, { cmd: '@', desc: 'Pick files from memory folders', group: 'memory' }, // Clear { cmd: '/clear', desc: 'Clear screen', group: 'main' }, { cmd: '/clear m', desc: 'Clear all memories', group: 'memory' }, { cmd: '/clear m1,2', desc: 'Clear specific memories', group: 'memory' }, // General { cmd: '/help', desc: 'Show all commands', group: 'general' }, { cmd: '/stats', desc: 'Session statistics', group: 'general' }, { cmd: '/system [query]', desc: 'Get system information', group: 'main' }, { cmd: '/mode <1|2|3>', desc: 'Set AI mode: 1=Fast, 2=Balanced, 3=Think', group: 'main' }, // Agent { cmd: '/agent <url>', desc: 'Connect to agent', group: 'main' }, { cmd: '@', desc: 'Select trained agent (when connected)', group: 'main' }, // Auth { cmd: '/auth', desc: 'Account info', group: 'main' }, { cmd: '/auth out', desc: 'Sign out', group: 'general' }, // Exit { cmd: '/exit', desc: 'Disconnect agent or exit (also Ctrl+C)', group: 'main' } ]; // Commands shown on the main welcome screen const mainCommands = allCommands.filter(c => c.group === 'main'); // Memory-related commands shown in /memory show const memoryCommands = allCommands.filter(c => c.group === 'memory'); // All slash commands (for sub-command dropdown) const allSlashCommands = allCommands .filter(c => c.cmd.startsWith('/')) .map(({ cmd, desc }) => ({ cmd, desc })); // Commands for autocomplete/dropdown (only unique base slash commands) const baseSlashCommands = new Set(); const autocompleteCommands = allCommands .filter(c => { if (!c.cmd.startsWith('/')) return false; const base = c.cmd.split(' ')[0]; if (baseSlashCommands.has(base)) return false; baseSlashCommands.add(base); return true; }) .map(c => ({ cmd: c.cmd.split(' ')[0], desc: c.desc })); module.exports = { allCommands, mainCommands, memoryCommands, autocompleteCommands, allSlashCommands };