;
                    filteredCommands = [...allCommands];
                    renderCommands();
                } else {
                    throw new Error(data.error || 'Failed to load commands');
                }
            } catch (error) {
                console.error('Error loading commands:', error);
                throw error;
            }
        }

        // Load categories for the filter
        async function loadCategories() {
            try {
                const response = await fetc