### Install Frontend Dependencies with Bun Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs all the necessary frontend dependencies for the opcode project using Bun, as defined in the project's package manifest. ```bash bun install ``` -------------------------------- ### Install Git Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs the Git distributed version control system. Git is required for cloning the opcode project repository. ```bash # Ubuntu/Debian: sudo apt install git # macOS: brew install git # Windows: Download from https://git-scm.com ``` -------------------------------- ### Start Opcode Development Server Source: https://github.com/getasterisk/opcode/blob/main/README.md Command to start the development server for the Opcode project, allowing for active development and testing of frontend and backend features simultaneously. ```bash # Start development server bun run tauri dev ``` -------------------------------- ### Install Linux Dependencies for opcode Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs essential system libraries and development tools required to build the opcode project on Debian-based Linux distributions. ```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 Bun Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs the Bun JavaScript runtime and package manager. Bun is used for managing frontend dependencies and running build scripts for the opcode project. ```bash curl -fsSL https://bun.sh/install | bash ``` -------------------------------- ### Install macOS Dependencies for opcode Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs Xcode Command Line Tools and optionally Homebrew for additional dependencies needed for building the opcode project on macOS. ```bash # Install Xcode Command Line Tools xcode-select --install # Install additional dependencies via Homebrew (optional) brew install pkg-config ``` -------------------------------- ### Install Rust via rustup Source: https://github.com/getasterisk/opcode/blob/main/README.md Installs the Rust programming language and its package manager, cargo, using the official rustup script. This is a prerequisite for building the opcode project from source. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Troubleshooting Rust Installation Source: https://github.com/getasterisk/opcode/blob/main/README.md Provides guidance on resolving the 'cargo not found' error by ensuring Rust is correctly installed and its binary directory is included in the system's PATH. ```bash # Ensure Rust is installed and ~/.cargo/bin is in your PATH # Run 'source ~/.cargo/env' or restart your terminal ``` -------------------------------- ### Example Claude CLI Command (Shell) Source: https://github.com/getasterisk/opcode/blob/main/src-tauri/tests/TESTS_COMPLETE.md An example of a simple, focused prompt executed via the Claude CLI. This command is designed to be quick and tests basic functionality, such as reading a file and displaying its contents. It is executed within a 20-second timeout to ensure sufficient response time. ```Shell claude --dangerously-skip-permissions "Read the file ./test.txt in the current directory and show its contents" ``` -------------------------------- ### Build opcode for Production Source: https://github.com/getasterisk/opcode/blob/main/README.md Compiles and packages the opcode application for a production release. The resulting executable will be found in the `src-tauri/target/release/` directory. ```bash # Build the application bun run tauri build # The built executable will be in: # - Linux: src-tauri/target/release/ # - macOS: src-tauri/target/release/ # - Windows: src-tauri/target/release/ ``` -------------------------------- ### Clone opcode Repository Source: https://github.com/getasterisk/opcode/blob/main/README.md Clones the opcode project's source code from GitHub and navigates into the project directory. This is the first step in building from source. ```bash git clone https://github.com/getAsterisk/opcode.git cd opcode ``` -------------------------------- ### Run Built Executable (Linux/macOS/Windows) Source: https://github.com/getasterisk/opcode/blob/main/README.md This snippet shows how to run the compiled Opcode application directly from the release build. It includes commands for both Linux/macOS and Windows environments. ```bash # Run the built executable directly # Linux/macOS ./src-tauri/target/release/opcode # Windows ./src-tauri/target/release/opcode.exe ``` -------------------------------- ### Run Rust Tests (Opcode) Source: https://github.com/getasterisk/opcode/blob/main/README.md Navigates to the `src-tauri` directory and executes the Rust test suite using `cargo test`. This verifies the functionality of the backend components. ```bash # Run Rust tests cd src-tauri && cargo test ``` -------------------------------- ### Build Universal Binary for macOS Source: https://github.com/getasterisk/opcode/blob/main/README.md Generates a universal binary for macOS that runs natively on both Intel and Apple Silicon (M1/M2) processors. ```bash bun run tauri build --target universal-apple-darwin ``` -------------------------------- ### Build opcode for Development Source: https://github.com/getasterisk/opcode/blob/main/README.md Builds the opcode application in development mode with hot reloading enabled. This is useful for iterative development and testing. ```bash bun run tauri dev ``` -------------------------------- ### Run Frontend Only (Opcode) Source: https://github.com/getasterisk/opcode/blob/main/README.md Command to run only the frontend development server for the Opcode project. This is useful for focusing on UI development without the backend process. ```bash # Run frontend only bun run dev ``` -------------------------------- ### Build opcode with Debug Flags Source: https://github.com/getasterisk/opcode/blob/main/README.md Creates a debug build of the opcode application, which typically involves faster compilation times and larger binary sizes, suitable for debugging purposes. ```bash bun run tauri build --debug ``` -------------------------------- ### Format Rust Code (Opcode) Source: https://github.com/getasterisk/opcode/blob/main/README.md Navigates to the `src-tauri` directory and formats the Rust code using `cargo fmt`. This command ensures consistent code style across the backend. ```bash # Format code cd src-tauri && cargo fmt ``` -------------------------------- ### Fetch Sessions using Zustand Store Source: https://github.com/getasterisk/opcode/blob/main/src/stores/README.md Demonstrates how to use the `useSessionStore` hook to fetch and display session data. It imports the store, accesses state and actions, and uses `useEffect` to trigger the fetch operation on component mount. ```typescript import { useSessionStore } from '@/stores/sessionStore'; function MyComponent() { const { sessions, fetchSessions } = useSessionStore(); useEffect(() => { fetchSessions(); }, []); return
{sessions.length} sessions
; } ``` -------------------------------- ### Backend Coding Standards (Rust) Source: https://github.com/getasterisk/opcode/blob/main/CONTRIBUTING.md Details the coding standards for backend development in Rust. It advises following Rust conventions, using `cargo fmt` for formatting, `cargo clippy` for linting, explicit handling of `Result` types, and comprehensive documentation with `///` comments. ```Rust /// Adds two integers and returns the result. /// /// # Arguments /// /// * `a` - The first integer. /// * `b` - The second integer. /// /// # Returns /// /// The sum of `a` and `b`. /// /// # Examples /// /// ``` /// let result = add_numbers(5, 3); /// assert_eq!(result, 8); /// ``` pub fn add_numbers(a: i32, b: i32) -> i32 { a + b } /// A function that might return an error. /// /// # Returns /// /// Returns `Ok(String)` on success or `Err(&str)` on failure. pub fn process_data() -> Result { // Simulate a successful operation Ok("Data processed successfully".to_string()) // Simulate a failed operation // Err("Failed to process data") } ``` -------------------------------- ### Agent File Format - JSON Source: https://github.com/getasterisk/opcode/blob/main/cc_agents/README.md Defines the structure for agent configuration files in the `.opcode.json` format. This includes versioning, export timestamps, and agent-specific details like 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" } } ``` -------------------------------- ### Execute Real Claude Task (Rust) Source: https://github.com/getasterisk/opcode/blob/main/src-tauri/tests/TESTS_COMPLETE.md Executes a real Claude task using the Claude CLI and captures its output. This function handles command execution, timeout management for different operating systems (macOS/Linux), and returns structured data including stdout, stderr, exit code, and execution duration. It is designed to work with the `--dangerously-skip-permissions` flag. ```Rust fn execute_claude_task(task: &str, timeout_seconds: u64) -> Result> { // Implementation details for executing Claude CLI command // including platform-specific timeout commands (gtimeout/timeout) // and capturing stdout, stderr, and exit code. // Returns a ClaudeOutput struct containing the results. unimplemented!("Real Claude execution logic here") } ``` -------------------------------- ### Frontend Coding Standards (React/TypeScript) Source: https://github.com/getasterisk/opcode/blob/main/CONTRIBUTING.md Specifies the coding standards for frontend development using React and TypeScript. It emphasizes using TypeScript, functional components with hooks, Tailwind CSS for styling, and JSDoc comments for exported elements. ```TypeScript /** * Example of a functional component with hooks and JSDoc. */ import React, { useState } from 'react'; interface MyComponentProps { initialCount: number; } const MyComponent: React.FC = ({ initialCount }) => { const [count, setCount] = useState(initialCount); return (

Current count: {count}

); }; export default MyComponent; ``` -------------------------------- ### Perform Type Checking (Opcode) Source: https://github.com/getasterisk/opcode/blob/main/README.md Executes a type check on the Opcode project using TypeScript compiler (`tsc`) without emitting any output files, ensuring code quality and catching type errors early. ```bash # Type checking bunx tsc --noEmit ``` -------------------------------- ### Rust Test Results Summary Source: https://github.com/getasterisk/opcode/blob/main/src-tauri/tests/TESTS_TASK.md Displays the final outcome of the test suite execution, indicating the number of passed, failed, ignored, and other test categories. ```Rust test result: ok. 61 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.