### Install Rust via rustup Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Use this command to install Rust and the rustup toolchain manager. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install Git on Ubuntu/Debian Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Command to install Git on Ubuntu or Debian-based Linux systems. ```bash sudo apt update sudo apt install git ``` -------------------------------- ### Install Frontend Dependencies with Bun Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Installs the necessary frontend packages for the Gooey project using Bun. ```bash bun install ``` -------------------------------- ### Install Bun Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Install the latest version of Bun using the provided curl command. ```bash curl -fsSL https://bun.sh/install | bash ``` -------------------------------- ### Install Git on macOS Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Command to install Git on macOS using Homebrew. ```bash brew install git ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Installs essential development tools for macOS. ```bash xcode-select --install ``` -------------------------------- ### Install Linux System Dependencies for Gooey Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Installs necessary system packages for building Gooey on Ubuntu/Debian. ```bash sudo apt update sudo apt install -y \ libwebkit2gtk-4.1-dev \ libgtk-3-dev \ libayatana-appindicator3-dev \ librsvg2-dev \ patchelf \ build-essential \ curl \ wget \ file \ libssl-dev \ libxdo-dev \ libsoup-3.0-dev \ libjavascriptcoregtk-4.1-dev ``` -------------------------------- ### Install pkg-config on macOS Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Installs pkg-config using Homebrew, a helper tool for compiling C/C++ code. ```bash brew install pkg-config ``` -------------------------------- ### Development Commands Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Common commands for developing the Gooey application, including starting the dev server, type checking, and running Rust tests. ```bash # Start development server bun run tauri dev # Run frontend only bun run dev # Type checking bunx tsc --noEmit # Run Rust tests cd src-tauri && cargo test # Format code cd src-tauri && cargo fmt ``` -------------------------------- ### List and Manage MCP Servers Source: https://context7.com/ceramicwhite/claudia/llms.txt Use these functions to list, add, import, get details, test connections, and remove MCP servers. Configuration can be done via direct arguments or JSON. ```typescript import { api, MCPServer, AddServerResult, ImportResult } from '@/lib/api'; // List configured MCP servers const servers: MCPServer[] = await api.mcpList(); servers.forEach(server => { console.log(`${server.name}: ${server.command} (${server.scope})`); }); ``` ```typescript // Add a new stdio MCP server const result: AddServerResult = await api.mcpAdd( "filesystem", // name "stdio", // transport "npx", // command ["-y", "@anthropics/mcp-server-filesystem", "/Users/dev"], // args { "NODE_ENV": "production" }, // env undefined, // url (for SSE) "user" // scope: "local" | "project" | "user" ); ``` ```typescript // Add server via JSON configuration const jsonResult = await api.mcpAddJson( "github", JSON.stringify({ type: "stdio", command: "npx", args: ["-y", "@anthropics/mcp-server-github"], env: { GITHUB_TOKEN: "ghp_xxx" } }), "user" ); ``` ```typescript // Import servers from Claude Desktop const importResult: ImportResult = await api.mcpAddFromClaudeDesktop("user"); console.log(`Imported ${importResult.imported_count} servers`); ``` ```typescript // Get server details const server = await api.mcpGet("filesystem"); ``` ```typescript // Test server connection const testResult = await api.mcpTestConnection("filesystem"); ``` ```typescript // Remove a server await api.mcpRemove("filesystem"); ``` ```typescript // Read/write project-specific MCP config (.mcp.json) const projectConfig = await api.mcpReadProjectConfig("/Users/dev/myproject"); projectConfig.mcpServers["custom-tool"] = { command: "python", args: ["./tools/custom_tool.py"], env: {} }; await api.mcpSaveProjectConfig("/Users/dev/myproject", projectConfig); ``` -------------------------------- ### Troubleshoot Linux Webkit2gtk Not Found Error Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Instructions to fix the 'webkit2gtk not found' error on Linux by installing the correct development packages. ```bash sudo apt update sudo apt install -y libwebkit2gtk-4.0-dev ``` -------------------------------- ### Claude Code Configuration & Settings API Source: https://context7.com/ceramicwhite/claudia/llms.txt APIs for managing Claude Code installation status, binary paths, and general settings. ```APIDOC ## Claude Code Configuration & Settings Manage Claude Code settings and binary configuration. ### Check Claude Code Installation Status **Method**: GET **Endpoint**: `/api/claude/version/status` ### List All Claude Installations **Method**: GET **Endpoint**: `/api/claude/installations` ### Get Custom Claude Binary Path **Method**: GET **Endpoint**: `/api/claude/binary-path` ### Set Custom Claude Binary Path **Method**: POST **Endpoint**: `/api/claude/binary-path` **Request Body**: - **path** (string) - Required - The absolute path to the Claude binary. ### Read Claude Settings **Method**: GET **Endpoint**: `/api/claude/settings` ### Save Claude Settings **Method**: POST **Endpoint**: `/api/claude/settings` **Request Body**: - **settings** (object) - Required - The Claude settings object to save. Can include `preferredModel` and `apiKey`. ### Get Home Directory **Method**: GET **Endpoint**: `/api/home-directory` ``` -------------------------------- ### Configure Claude Code Settings Source: https://context7.com/ceramicwhite/claudia/llms.txt Manage Claude Code installation status, binary path, and general settings. Ensure API key is configured for full functionality. ```typescript import { api, ClaudeSettings, ClaudeVersionStatus, ClaudeInstallation } from '@/lib/api'; // Check Claude Code installation const version: ClaudeVersionStatus = await api.checkClaudeVersion(); console.log(`Installed: ${version.is_installed}, Version: ${version.version}`); ``` ```typescript // List all Claude installations on the system const installations: ClaudeInstallation[] = await api.listClaudeInstallations(); installations.forEach(inst => { console.log(`${inst.path} (${inst.source}): ${inst.version}`); }); ``` ```typescript // Get/set custom Claude binary path const currentPath = await api.getClaudeBinaryPath(); await api.setClaudeBinaryPath("/opt/homebrew/bin/claude"); ``` ```typescript // Read Claude settings const settings: ClaudeSettings = await api.getClaudeSettings(); console.log('API key configured:', !!settings.apiKey); ``` ```typescript // Update settings settings.preferredModel = "claude-sonnet-4-20250514"; await api.saveClaudeSettings(settings); ``` ```typescript // Get home directory const homeDir = await api.getHomeDirectory(); ``` -------------------------------- ### Troubleshoot Cargo Not Found Error Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Steps to resolve the 'cargo not found' error by ensuring Rust is installed and its bin directory is in the PATH. ```bash source ~/.cargo/env ``` -------------------------------- ### Agent File Format Example Source: https://github.com/ceramicwhite/claudia/blob/main/cc_agents/README.md This JSON structure defines the format for exporting and importing Gooey agents. It includes versioning, export timestamp, and agent configuration details such as name, icon, model, system prompt, and default task. ```json { "version": 1, "exported_at": "2025-01-23T14:29:58.156063+00:00", "agent": { "name": "Your Agent Name", "icon": "bot", "model": "opus|sonnet|haiku", "system_prompt": "Your agent's instructions...", "default_task": "Default task description" } } ``` -------------------------------- ### Manage Claude Code Projects and Sessions Source: https://context7.com/ceramicwhite/claudia/llms.txt Use these functions to list, get, and create Claude Code projects. Load full session history for a specific session. ```typescript import { api } from '@/lib/api'; // List all projects sorted by most recent activity const projects = await api.listProjects(); console.log(projects); // [{ id: "-Users-dev-myproject", path: "/Users/dev/myproject", sessions: ["uuid1", "uuid2"], created_at: 1704067200, most_recent_session: 1704153600 }] // Get sessions for a specific project const sessions = await api.getProjectSessions("-Users-dev-myproject"); console.log(sessions); // [{ id: "abc-123", project_id: "-Users-dev-myproject", project_path: "/Users/dev/myproject", created_at: 1704153600, first_message: "Help me refactor this code", message_timestamp: "2024-01-01T12:00:00Z" }] // Create a new project for a directory const newProject = await api.createProject("/Users/dev/new-project"); // Load full session history (JSONL messages) const messages = await api.loadSessionHistory("session-uuid", "-Users-dev-myproject"); ``` -------------------------------- ### Troubleshoot Claude Command Not Found Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Steps to resolve the 'claude command not found' error by verifying the Claude Code CLI installation and PATH. ```bash claude --version ``` -------------------------------- ### Execute and Manage Claude Code Sessions Source: https://context7.com/ceramicwhite/claudia/llms.txt Start new sessions, continue existing conversations, or resume specific sessions with streaming output. Cancel running executions. ```typescript import { api } from '@/lib/api'; import { listen } from '@tauri-apps/api/event'; // Listen for streaming output from Claude const unlisten = await listen('claude-output', (event) => { const jsonLine = event.payload as string; const message = JSON.parse(jsonLine); console.log('Claude message:', message); }); // Start a new Claude Code session await api.executeClaudeCode( "/Users/dev/myproject", // projectPath "Help me write unit tests for the auth module", // prompt "claude-sonnet-4-20250514" // model ); // Continue an existing conversation (uses -c flag) await api.continueClaudeCode( "/Users/dev/myproject", "Now add integration tests", "claude-sonnet-4-20250514" ); // Resume a specific session by ID (uses --resume flag) await api.resumeClaudeCode( "/Users/dev/myproject", "session-uuid-123", "Let's continue from where we left off", "claude-sonnet-4-20250514" ); // Cancel a running execution await api.cancelClaudeExecution("session-uuid-123"); // Cleanup when done unlisten(); ``` -------------------------------- ### Get Overall Usage Statistics Source: https://context7.com/ceramicwhite/claudia/llms.txt Retrieves comprehensive usage statistics for the Claude API, including total cost, token counts, and breakdowns by model, date, and project. Requires importing the 'api' object. ```typescript import { api, UsageStats, ProjectUsage } from '@/lib/api'; // Get overall usage statistics const stats: UsageStats = await api.getUsageStats(); console.log(`Total cost: $${stats.total_cost.toFixed(4)}`); console.log(`Total tokens: ${stats.total_tokens}`); console.log(`Input tokens: ${stats.total_input_tokens}`); console.log(`Output tokens: ${stats.total_output_tokens}`); console.log(`Cache creation tokens: ${stats.total_cache_creation_tokens}`); console.log(`Cache read tokens: ${stats.total_cache_read_tokens}`); // Usage breakdown by model stats.by_model.forEach(model => { console.log(`${model.model}: $${model.total_cost.toFixed(4)} (${model.total_tokens} tokens)`); }); // Usage by date stats.by_date.forEach(day => { console.log(`${day.date}: $${day.total_cost.toFixed(4)}`); }); // Usage by project stats.by_project.forEach(project => { console.log(`${project.project_name}: $${project.total_cost.toFixed(4)} (${project.session_count} sessions)`); }); ``` -------------------------------- ### Build Universal Binary for macOS Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Creates a universal binary for macOS that supports both Intel and Apple Silicon architectures. ```bash bun run tauri build --target universal-apple-darwin ``` -------------------------------- ### Run Built Executable Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Execute the compiled application directly from the release build. Ensure you are in the correct directory. ```bash # Run the built executable directly # Linux/macOS ./src-tauri/target/release/gooey # Windows ./src-tauri/target/release/gooey.exe ``` -------------------------------- ### Create and Execute Agents in Gooey Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Steps to create, configure, and execute agents within the Gooey application. ```text CC Agents → Create Agent → Configure → Execute ``` -------------------------------- ### Create, List, and Update Custom AI Agents Source: https://context7.com/ceramicwhite/claudia/llms.txt Demonstrates the creation of a new agent with a system prompt and default task, listing all available agents, and updating an existing agent's configuration. ```typescript import { api, Agent, AgentRunWithMetrics } from '@/lib/api'; import { listen } from '@tauri-apps/api/event'; // Create a new agent const agent = await api.createAgent( "Code Reviewer", // name "magnifying-glass", // icon identifier "You are an expert code reviewer. Analyze code for bugs, security issues, and best practices.", // system_prompt "Review the changes in the current PR", // default_task (optional) "claude-sonnet-4-20250514", // model JSON.stringify({ PreToolUse: [{ matcher: "Edit", hooks: [{ type: "command", command: "echo 'About to edit'" }] }] }) // hooks (optional) ); // List all agents const agents: Agent[] = await api.listAgents(); // Update an agent await api.updateAgent( agent.id!, "Senior Code Reviewer", "magnifying-glass", "You are a senior code reviewer with 10+ years experience...", "Review code for production readiness" ); ``` -------------------------------- ### Build Gooey for Production Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Compiles the Gooey application for a production release. ```bash bun run tauri build ``` -------------------------------- ### Export and Import Agents Source: https://context7.com/ceramicwhite/claudia/llms.txt Illustrates how to export an agent's configuration to a JSON string and import it back, as well as fetching and importing agents directly from a GitHub repository. ```typescript // Export/import agents for sharing const exportedJson = await api.exportAgent(agent.id!); const importedAgent = await api.importAgent(exportedJson); // Import from GitHub repository const githubAgents = await api.fetchGitHubAgents(); const importedFromGithub = await api.importAgentFromGitHub(githubAgents[0].download_url); ``` -------------------------------- ### Configure MCP Servers in Gooey Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Steps to add and configure MCP servers within the Gooey application's MCP Manager. ```text Menu → MCP Manager → Add Server → Configure ``` -------------------------------- ### Navigate Gooey Project Management Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Follow these steps to view and manage sessions within a selected project in Gooey. ```text Projects → Select Project → View Sessions → Resume or Start New ``` -------------------------------- ### Execute and Monitor Agent Runs Source: https://context7.com/ceramicwhite/claudia/llms.txt Shows how to execute an agent for a specific task and directory, stream its output, retrieve run metrics, and manage running sessions. ```typescript // Execute an agent with streaming output const runId = await api.executeAgent( agent.id!, "/Users/dev/myproject", "Review the authentication implementation", "claude-sonnet-4-20250514" ); // Listen for agent output const unlisten = await listen(`agent-output:${runId}`, (event) => { console.log('Agent output:', event.payload); }); // Get run with real-time metrics const runWithMetrics: AgentRunWithMetrics = await api.getAgentRunWithRealTimeMetrics(runId); console.log(`Tokens used: ${runWithMetrics.metrics?.total_tokens}, Cost: $${runWithMetrics.metrics?.cost_usd}`); // List running sessions const runningSessions = await api.listRunningAgentSessions(); // Kill a running agent await api.killAgentSession(runId); ``` -------------------------------- ### Build Gooey for Development Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Builds the Gooey application with hot-reloading enabled for development purposes. ```bash bun run tauri dev ``` -------------------------------- ### Configure Lifecycle Hooks Source: https://context7.com/ceramicwhite/claudia/llms.txt Set up and manage hooks that execute before or after tool usage. Hooks can be defined at user, project, or local levels, with priority given to local configurations. ```typescript import { api } from '@/lib/api'; import type { HooksConfiguration } from '@/types/hooks'; // Get hooks config for different scopes const userHooks = await api.getHooksConfig('user'); const projectHooks = await api.getHooksConfig('project', '/Users/dev/myproject'); const localHooks = await api.getHooksConfig('local', '/Users/dev/myproject'); ``` ```typescript // Get merged hooks (respects priority: local > project > user) const mergedHooks = await api.getMergedHooksConfig('/Users/dev/myproject'); ``` ```typescript // Update hooks configuration const newHooks: HooksConfiguration = { PreToolUse: [{ matcher: "Edit", hooks: [{ type: "command", command: "npm run lint --fix $FILEPATH" }] }], PostToolUse: [{ matcher: "Bash", hooks: [{ type: "command", command: "echo 'Command executed: $TOOL_INPUT'" }] }] }; await api.updateHooksConfig('project', newHooks, '/Users/dev/myproject'); ``` ```typescript // Validate a hook command syntax const validation = await api.validateHookCommand("echo 'test' && npm run build"); console.log(`Valid: ${validation.valid}, Message: ${validation.message}`); ``` -------------------------------- ### Troubleshoot Build Out of Memory Error Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Provides solutions for build failures due to insufficient memory, such as limiting parallel jobs. ```bash cargo build -j 2 ``` -------------------------------- ### Build Gooey with Debug Flags Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Compiles the Gooey application with debug flags, resulting in faster compilation but a larger binary. ```bash bun run tauri build --debug ``` -------------------------------- ### Create and Manage Session Checkpoints Source: https://context7.com/ceramicwhite/claudia/llms.txt Functions for creating, listing, restoring, and forking session checkpoints. Also includes diffing, updating settings, and cleanup. ```typescript import { api, Checkpoint, CheckpointResult, SessionTimeline, CheckpointDiff } from '@/lib/api'; // Create a checkpoint at current state const result: CheckpointResult = await api.createCheckpoint( "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject", undefined, // messageIndex (optional, defaults to current) "Before refactoring auth module" // description ); console.log(`Created checkpoint: ${result.checkpoint.id}, files: ${result.filesProcessed}`); ``` ```typescript // List all checkpoints for a session const checkpoints: Checkpoint[] = await api.listCheckpoints( "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject" ); ``` ```typescript // Get the full timeline tree const timeline: SessionTimeline = await api.getSessionTimeline( "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject" ); console.log(`Total checkpoints: ${timeline.totalCheckpoints}`); console.log(`Auto-checkpoint enabled: ${timeline.autoCheckpointEnabled}`); ``` ```typescript // Restore session to a previous checkpoint const restoreResult = await api.restoreCheckpoint( "checkpoint-id", "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject" ); ``` ```typescript // Fork a new session from a checkpoint const forkResult = await api.forkFromCheckpoint( "checkpoint-id", "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject", "new-session-uuid", "Alternative approach branch" ); ``` ```typescript // Get diff between two checkpoints const diff: CheckpointDiff = await api.getCheckpointDiff( "checkpoint-1", "checkpoint-2", "session-uuid", "-Users-dev-myproject" ); console.log(`Modified files: ${diff.modifiedFiles.length}`); console.log(`Token delta: ${diff.tokenDelta}`); ``` ```typescript // Configure checkpoint strategy await api.updateCheckpointSettings( "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject", true, // autoCheckpointEnabled "smart" // strategy: "manual" | "per_prompt" | "per_tool_use" | "smart" ); ``` ```typescript // Cleanup old checkpoints (keep last N) const deleted = await api.cleanupOldCheckpoints( "session-uuid", "-Users-dev-myproject", "/Users/dev/myproject", 10 // keepCount ); ``` -------------------------------- ### Clone Gooey Repository Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Clones the Gooey project from GitHub and navigates into the project directory. ```bash git clone https://github.com/getAsterisk/gooey.git cd gooey ``` -------------------------------- ### Gooey Project Structure Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Overview of the Gooey project's directory layout, separating frontend (React) and backend (Rust/Tauri) components. ```tree gooey/ ├── src/ # React frontend │ ├── components/ # UI components │ ├── lib/ # API client & utilities │ └── assets/ # Static assets ├── src-tauri/ # Rust backend │ ├── src/ │ │ ├── commands/ # Tauri command handlers │ │ ├── checkpoint/ # Timeline management │ │ └── process/ # Process management │ └── tests/ # Rust test suite └── public/ # Public assets ``` -------------------------------- ### Manage Slash Commands Source: https://context7.com/ceramicwhite/claudia/llms.txt Create, list, retrieve, and delete custom slash commands for reusable prompts. Commands can be scoped to user, project, or other defined scopes. ```typescript import { api, SlashCommand } from '@/lib/api'; // List all available slash commands const commands: SlashCommand[] = await api.slashCommandsList('/Users/dev/myproject'); commands.forEach(cmd => { console.log(`${cmd.full_command}: ${cmd.description}`); }); ``` ```typescript // Get a specific command const command = await api.slashCommandGet("user:review"); ``` ```typescript // Create/update a slash command const savedCommand = await api.slashCommandSave( "project", // scope "optimize", // name "performance", // namespace (optional) `# Performance Optimization Analyze the codebase for performance issues and suggest optimizations. ## Focus Areas - Database queries - Memory usage - API response times $ARGUMENTS`, // content with $ARGUMENTS placeholder "Optimize code for performance", // description ["Read", "Grep", "Bash"], // allowedTools "/Users/dev/myproject" // projectPath ); ``` ```typescript // Delete a command await api.slashCommandDelete("project:performance:optimize", '/Users/dev/myproject'); ``` -------------------------------- ### Fetch and Display Sessions with Zustand Source: https://github.com/ceramicwhite/claudia/blob/main/src/stores/README.md Use this pattern to fetch session data using the `useSessionStore` hook and display the count. Ensure the `useEffect` hook is used to trigger the fetch on component mount. ```typescript import { useSessionStore } from '@/stores/sessionStore'; function MyComponent() { const { sessions, fetchSessions } = useSessionStore(); useEffect(() => { fetchSessions(); }, []); return
{sessions.length} sessions
; } ``` -------------------------------- ### Filter Usage Statistics by Date Range and Session Source: https://context7.com/ceramicwhite/claudia/llms.txt Demonstrates how to fetch usage statistics filtered by a specific date range and retrieve session-level statistics with ordering. ```typescript // Filter by date range const rangeStats = await api.getUsageByDateRange("2024-01-01", "2024-01-31"); // Get session-level statistics const sessionStats: ProjectUsage[] = await api.getSessionStats( "20240101", // since (YYYYMMDD) "20240131", // until "desc" // order ); ``` -------------------------------- ### CLAUDE.md Management API Source: https://context7.com/ceramicwhite/claudia/llms.txt APIs for finding, reading, and saving CLAUDE.md instruction files across projects. ```APIDOC ## CLAUDE.md Management Find and edit CLAUDE.md instruction files across projects for customizing Claude's behavior. ### Get Global CLAUDE.md Content **Method**: GET **Endpoint**: `/api/system/prompt` ### Save Global CLAUDE.md Content **Method**: POST **Endpoint**: `/api/system/prompt` **Request Body**: - **content** (string) - Required - The new content for the global CLAUDE.md file. ### Find CLAUDE.md Files in Project **Method**: GET **Endpoint**: `/api/projects/{projectPath}/claude-md-files` **Path Parameters**: - **projectPath** (string) - Required - The absolute path to the project directory. ### Read Specific CLAUDE.md File **Method**: GET **Endpoint**: `/api/projects/{projectPath}/claude-md-files/{relativePath}` **Path Parameters**: - **projectPath** (string) - Required - The absolute path to the project directory. - **relativePath** (string) - Required - The relative path of the CLAUDE.md file within the project. ### Save CLAUDE.md File **Method**: POST **Endpoint**: `/api/projects/{projectPath}/claude-md-files/{relativePath}` **Path Parameters**: - **projectPath** (string) - Required - The absolute path to the project directory. - **relativePath** (string) - Required - The relative path of the CLAUDE.md file within the project. **Request Body**: - **content** (string) - Required - The new content for the CLAUDE.md file. ``` -------------------------------- ### Manage CLAUDE.md Files Source: https://context7.com/ceramicwhite/claudia/llms.txt Use these functions to retrieve, save, find, and read CLAUDE.md files. Ensure the correct API is imported. ```typescript import { api, ClaudeMdFile } from '@/lib/api'; // Get global CLAUDE.md content const globalPrompt = await api.getSystemPrompt(); console.log('Global CLAUDE.md:', globalPrompt); ``` ```typescript // Save global CLAUDE.md await api.saveSystemPrompt("# Project Guidelines\n\nAlways write tests first..."); ``` ```typescript // Find all CLAUDE.md files in a project const claudeFiles: ClaudeMdFile[] = await api.findClaudeMdFiles("/Users/dev/myproject"); claudeFiles.forEach(file => { console.log(`${file.relative_path} (${file.size} bytes, modified: ${file.modified})`); }); ``` ```typescript // Read a specific CLAUDE.md file const content = await api.readClaudeMdFile("/Users/dev/myproject/src/CLAUDE.md"); ``` ```typescript // Save a CLAUDE.md file await api.saveClaudeMdFile( "/Users/dev/myproject/src/CLAUDE.md", "# Module-specific instructions\n\nThis module handles authentication..." ); ``` -------------------------------- ### Hooks Configuration API Source: https://context7.com/ceramicwhite/claudia/llms.txt APIs for configuring and managing lifecycle hooks for tool executions. ```APIDOC ## Hooks Configuration Configure lifecycle hooks that run before/after tool executions for automation and validation. ### Get Hooks Configuration **Method**: GET **Endpoint**: `/api/hooks/{scope}` **Path Parameters**: - **scope** (string) - Required - The scope of the hooks (e.g., 'user', 'project', 'local'). **Query Parameters**: - **projectPath** (string) - Optional - The absolute path to the project directory (required for 'project' and 'local' scopes). ### Get Merged Hooks Configuration **Method**: GET **Endpoint**: `/api/hooks/merged/{projectPath}` **Path Parameters**: - **projectPath** (string) - Required - The absolute path to the project directory. ### Update Hooks Configuration **Method**: PUT **Endpoint**: `/api/hooks/{scope}` **Path Parameters**: - **scope** (string) - Required - The scope of the hooks to update (e.g., 'user', 'project', 'local'). **Query Parameters**: - **projectPath** (string) - Optional - The absolute path to the project directory (required for 'project' and 'local' scopes). **Request Body**: - **hooksConfig** (object) - Required - The new hooks configuration object. ### Validate Hook Command Syntax **Method**: POST **Endpoint**: `/api/hooks/validate-command` **Request Body**: - **command** (string) - Required - The command string to validate. ``` -------------------------------- ### Slash Commands API Source: https://context7.com/ceramicwhite/claudia/llms.txt APIs for creating, managing, and retrieving custom slash commands. ```APIDOC ## Slash Commands Create and manage custom slash commands for reusable prompts. ### List Slash Commands **Method**: GET **Endpoint**: `/api/slash-commands` **Query Parameters**: - **projectPath** (string) - Optional - The absolute path to the project directory to filter commands. ### Get Specific Slash Command **Method**: GET **Endpoint**: `/api/slash-commands/{commandName}` **Path Parameters**: - **commandName** (string) - Required - The full name of the command (e.g., 'user:review'). **Query Parameters**: - **projectPath** (string) - Optional - The absolute path to the project directory. ### Save Slash Command **Method**: POST **Endpoint**: `/api/slash-commands` **Request Body**: - **scope** (string) - Required - The scope of the command ('user', 'project'). - **name** (string) - Required - The name of the command. - **namespace** (string) - Optional - The namespace for the command. - **content** (string) - Required - The content of the command, potentially including $ARGUMENTS placeholder. - **description** (string) - Required - A description of the command. - **allowedTools** (array of strings) - Optional - A list of allowed tools for the command. - **projectPath** (string) - Optional - The absolute path to the project directory (required for 'project' scope). ### Delete Slash Command **Method**: DELETE **Endpoint**: `/api/slash-commands/{commandName}` **Path Parameters**: - **commandName** (string) - Required - The full name of the command to delete (e.g., 'project:performance:optimize'). **Query Parameters**: - **projectPath** (string) - Optional - The absolute path to the project directory (required for 'project' scope). ``` -------------------------------- ### Listen to Tauri Events Source: https://context7.com/ceramicwhite/claudia/llms.txt Use the `listen` function from `@tauri-apps/api/event` to subscribe to real-time events from the Rust backend. This includes general session events, session-specific events identified by an ID, agent execution events, and error events. Remember to call the returned unlisten function to clean up event listeners. ```typescript import { listen } from '@tauri-apps/api/event'; // Claude session events const unlistenOutput = await listen('claude-output', (event) => { const line = JSON.parse(event.payload as string); if (line.type === 'assistant' && line.message?.content) { console.log('Assistant:', line.message.content); } }); const unlistenComplete = await listen('claude-complete', (event) => { console.log('Session completed:', event.payload); }); // Session-specific events (isolated by session ID) const sessionId = "abc-123"; await listen(`claude-output:${sessionId}`, (event) => { console.log('Session output:', event.payload); }); // Agent execution events const runId = 42; await listen(`agent-output:${runId}`, (event) => { console.log('Agent output:', event.payload); }); await listen(`agent-complete:${runId}`, (event) => { console.log('Agent completed:', event.payload); }); await listen(`agent-cancelled:${runId}`, (event) => { console.log('Agent cancelled:', event.payload); }); // Error events await listen('claude-error', (event) => { console.error('Claude error:', event.payload); }); await listen(`agent-error:${runId}`, (event) => { console.error('Agent error:', event.payload); }); // Cleanup unlistenOutput(); unlistenComplete(); ``` -------------------------------- ### Access Gooey Usage Dashboard Source: https://github.com/ceramicwhite/claudia/blob/main/README.md Navigate to the Usage Dashboard in Gooey to monitor analytics and costs. ```text Menu → Usage Dashboard → View Analytics ``` -------------------------------- ### Test Suite Results Source: https://github.com/ceramicwhite/claudia/blob/main/src-tauri/tests/TESTS_COMPLETE.md Indicates the outcome of the test suite execution, showing the number of passed, failed, ignored, measured, and filtered tests. ```text test result: ok. 58 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.