### Install Dependencies and Start Dev Server (Bun) Source: https://github.com/ksd-co/ironcode/blob/dev/CONTRIBUTING.md Installs project dependencies and starts the development server using Bun. This is the primary command for local development. ```bash bun install bun dev ``` -------------------------------- ### Install Bun Development Environment Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs the required Bun version (1.3.8) for development. This involves downloading the installer script and sourcing the appropriate shell configuration file to make Bun available in the current session. ```bash curl -fsSL https://bun.sh/install | bash source ~/.bashrc # or ~/.zshrc if you use zsh ``` -------------------------------- ### Install IronCode via Direct Download (Linux) Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs IronCode on Linux (x64) by downloading pre-built binaries from GitHub Releases. The archive is extracted, and the binary is moved to a directory in the system's PATH. ```bash curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-linux-x64.tar.gz | tar xz sudo mv ironcode /usr/local/bin/ ironcode --version ``` -------------------------------- ### Clone and Build IronCode Project Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Clones the IronCode repository, installs Node.js dependencies using Bun, builds the native Rust components, and then builds the standalone executable for the IronCode package. ```bash # Clone the repository git clone https://github.com/KSD-CO/IronCode.git cd IronCode # Install dependencies bun install # Build Rust native components cd packages/ironcode/native/tool cargo build --release cd ../../../.. # Run in development mode bun dev # Or build standalone executable cd packages/ironcode bun run build ``` -------------------------------- ### Install IronCode via NPM Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Installs the IronCode CLI globally using npm or allows execution without installation using npx. This is the recommended installation method. ```bash # Install globally npm install -g ironcode-ai # Or use with npx (no installation) npx ironcode-ai ``` -------------------------------- ### Install IronCode via NPM Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs the IronCode CLI globally using NPM, allowing it to be run from any directory. Alternatively, it can be executed directly using npx without a global installation. ```bash # Install globally npm install -g ironcode-ai # Or use with npx (no installation needed) npx ironcode-ai ``` -------------------------------- ### Install IronCode via Direct Download (Linux x64) Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Downloads and installs the standalone IronCode CLI binary for Linux (x64) systems. This method is suitable for users who prefer not to use package managers. ```bash # Download and extract curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-linux-x64.tar.gz | tar xz # Move to PATH sudo mv ironcode /usr/local/bin/ # Verify installation ironcode --version ``` -------------------------------- ### Install Rust Development Environment Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs the latest stable version of Rust using the official installation script. After installation, the environment variables are sourced to make Rust commands available. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env ``` -------------------------------- ### Install IronCode via Direct Download (macOS Intel) Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs IronCode on macOS with Intel processors by downloading pre-built binaries from GitHub Releases. The archive is extracted, and the binary is moved to a directory in the system's PATH. ```bash curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-x64.tar.gz | tar xz sudo mv ironcode /usr/local/bin/ ironcode --version ``` -------------------------------- ### Install IronCode via Direct Download (macOS Apple Silicon) Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs IronCode on macOS with Apple Silicon by downloading pre-built binaries from GitHub Releases. The archive is extracted, and the binary is moved to a directory in the system's PATH. ```bash curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-arm64.tar.gz | tar xz sudo mv ironcode /usr/local/bin/ ironcode --version ``` -------------------------------- ### Install GitHub CLI on Linux Source: https://github.com/ksd-co/ironcode/blob/dev/README.md This command installs the GitHub CLI (Command Line Interface) on Linux using apt. The GitHub CLI is used for authenticating with GitHub repositories, which IronCode can leverage for Git operations. ```bash sudo apt install gh ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/ksd-co/ironcode/blob/dev/packages/ironcode/AGENTS.md Installs project dependencies using the Bun package manager. This is typically the first step before running or testing the project. ```shell bun install ``` -------------------------------- ### Authenticate with GitHub CLI Source: https://github.com/ksd-co/ironcode/blob/dev/README.md This command initiates the login process for the GitHub CLI, guiding the user through authentication with their GitHub account. This is a prerequisite for using the GitHub CLI as a Git credential helper. ```bash gh auth login ``` -------------------------------- ### Install IronCode via Direct Download (macOS Intel) Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Downloads and installs the standalone IronCode CLI binary for macOS (Intel x64) systems. This method is suitable for users who prefer not to use package managers. ```bash # Download and extract curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-x64.tar.gz | tar xz # Move to PATH sudo mv ironcode /usr/local/bin/ # Verify installation ironcode --version ``` -------------------------------- ### Install IronCode via Homebrew Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Installs IronCode using a Homebrew tap for macOS and Linux systems. This method automatically selects the appropriate binary for the platform. ```bash # Add the tap brew tap KSD-CO/tap https://github.com/KSD-CO/homebrew-tap # Install IronCode brew install ironcode # Verify installation ironcode --version # Update to latest version brew upgrade ironcode ``` -------------------------------- ### Install IronCode via Direct Download (macOS Apple Silicon) Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Downloads and installs the standalone IronCode CLI binary for macOS (Apple Silicon arm64) systems. This method is suitable for users who prefer not to use package managers. ```bash # Download and extract curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-arm64.tar.gz | tar xz # Move to PATH sudo mv ironcode /usr/local/bin/ # Verify installation ironcode --version ``` -------------------------------- ### Install GitHub CLI on macOS Source: https://github.com/ksd-co/ironcode/blob/dev/README.md This command installs the GitHub CLI (Command Line Interface) on macOS using Homebrew. The GitHub CLI is used for authenticating with GitHub repositories, which IronCode can leverage for Git operations. ```bash brew install gh ``` -------------------------------- ### Example Test Structure using Bun Test Source: https://github.com/ksd-co/ironcode/blob/dev/AGENTS.md Demonstrates a basic test structure using Bun's built-in test runner. It imports necessary functions from 'bun:test' and a local module 'Scheduler'. The example shows a describe block for a specific function and a test case with an assertion. ```typescript import { describe, expect, test } from "bun:test" import { Scheduler } from "../src/scheduler" describe("Scheduler.register", () => { test("defaults to instance scope per directory", async () => { // Test implementation expect(runs.count).toBe(1) }) }) ``` -------------------------------- ### Manual Debugger Setup for IronCode TUI Source: https://github.com/ksd-co/ironcode/blob/dev/CONTRIBUTING.md This command enables debugging for the IronCode TUI by running it with specific conditions for browser environments. It also includes the necessary inspector URL. ```bash bun run --inspect=ws://localhost:6499/ --cwd packages/ironcode --conditions=browser ./src/index.ts ``` -------------------------------- ### Initialize IronCode Client and Server Source: https://context7.com/ksd-co/ironcode/llms.txt Demonstrates how to initialize the IronCode SDK to create both a server and a client, or to create them separately. ```APIDOC ## Initialize IronCode Client and Server ### Description Initialize the IronCode SDK to interact with the server programmatically. This can be done by creating the server and client separately or with a single call. ### Method `createIroncodeServer`, `createIroncodeClient`, `createIroncode` ### Endpoint N/A (SDK Initialization) ### Parameters #### createIroncodeServer - **hostname** (string) - Required - The hostname for the server. - **port** (number) - Required - The port for the server. - **timeout** (number) - Optional - The timeout in milliseconds for server operations. - **config** (object) - Optional - Configuration for the AI model and logging. - **model** (string) - Required - The AI model to use (e.g., "anthropic/claude-sonnet-4"). - **logLevel** (string) - Optional - The logging level (e.g., "INFO"). #### createIroncodeClient - **baseUrl** (string) - Required - The base URL of the IronCode server. - **directory** (string) - Optional - The working directory for the client. #### createIroncode - **port** (number) - Required - The port for the server. - **config** (object) - Optional - Configuration for the AI model. - **model** (string) - Required - The AI model to use (e.g., "anthropic/claude-sonnet-4"). ### Request Example ```typescript import { createIroncodeClient, createIroncodeServer, createIroncode } from "@ironcode-ai/sdk" // Option 1: Create server and client separately const server = await createIroncodeServer({ hostname: "127.0.0.1", port: 4096, timeout: 5000, config: { model: "anthropic/claude-sonnet-4", logLevel: "INFO" } }) const client = createIroncodeClient({ baseUrl: server.url, directory: "/path/to/project" // Optional: specify working directory }) // Option 2: Create both with single call const { client, server } = await createIroncode({ port: 4096, config: { model: "anthropic/claude-sonnet-4" } }) // Cleanup when done server.close() ``` ### Response #### Success Response - **client** (object) - The IronCode client instance. - **server** (object) - The IronCode server instance (if created together). #### Response Example N/A (SDK Initialization) ``` -------------------------------- ### Print 'Hello World' in Python Source: https://github.com/ksd-co/ironcode/blob/dev/packages/ironcode/src/tool/todowrite.txt Demonstrates the basic syntax for printing a string to the console in Python. This is a fundamental operation for beginners and requires no external libraries. ```python print("Hello World") ``` -------------------------------- ### Build IronCode from Source Source: https://github.com/ksd-co/ironcode/blob/dev/README.md This bash script outlines the steps to build IronCode from its source repository. It includes cloning the repository, installing Node.js dependencies with Bun, building the native Rust components, and running the CLI in development mode. Finally, it shows how to build a standalone executable. ```bash # Clone the repository git clone https://github.com/KSD-CO/IronCode.git cd IronCode # Install dependencies bun install # Build Rust native components cd packages/ironcode/native/tool cargo build --release cd ../../../.. # Run CLI locally (development mode) bun dev # Build standalone executable cd packages/ironcode bun run build ``` -------------------------------- ### Examples of Provider Tools Configuration Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Illustrates various ways to configure `provider_tools` in `ironcode.json`, including enabling single tools, multiple tools from the same provider, all tools from a provider using a wildcard, and mixing tools from different providers. Note that only tools matching the currently active model's provider will be enabled. ```json { "experimental": { "provider_tools": ["anthropic:web_search"] } } ``` ```json { "experimental": { "provider_tools": ["anthropic:web_search", "anthropic:code_execution"] } } ``` ```json { "experimental": { "provider_tools": ["openai:*"] } } ``` ```json { "experimental": { "provider_tools": [ "anthropic:web_search", "anthropic:web_fetch", "openai:web_search", "google:google_search", "xai:x_search" ] } } ``` -------------------------------- ### Install IronCode via Homebrew Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs IronCode using Homebrew on macOS and Linux. This method involves adding a custom tap and then installing the ironcode package. It also includes instructions for upgrading to the latest version. ```bash # Add the IronCode tap brew tap KSD-CO/tap # Install IronCode brew install ironcode # Update to latest version brew upgrade ironcode ``` -------------------------------- ### Install Specific Bun Version Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Installs a specific version of Bun (1.3.8) required by the project. This is useful for resolving version mismatch issues and ensuring compatibility with the project's dependencies. ```bash curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.8" ``` -------------------------------- ### Start ACP Server Programmatically Source: https://github.com/ksd-co/ironcode/blob/dev/packages/ironcode/src/acp/README.md Provides a TypeScript example of how to start the ACP server programmatically using the ACPServer class from the local implementation. ```typescript import { ACPServer } from "./acp/server" await ACPServer.start() ``` -------------------------------- ### Troubleshoot 'Permission denied' Error Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Addresses the 'Permission denied' error on Linux/macOS by making the IronCode binary executable using the chmod command. This ensures the system can execute the installed binary. ```bash chmod +x /usr/local/bin/ironcode ``` -------------------------------- ### Start ACP Server via Command Line Source: https://github.com/ksd-co/ironcode/blob/dev/packages/ironcode/src/acp/README.md Demonstrates how to initiate the ACP server using the ironcode command-line interface. It shows the basic command and an option to specify the working directory. ```bash # Start the ACP server in the current directory ironcode acp # Start in a specific directory ironcode acp --cwd /path/to/project ``` -------------------------------- ### Troubleshoot 'Command not found: ironcode' Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Provides steps to resolve the 'Command not found: ironcode' error when IronCode is installed via NPM. It involves checking the NPM global bin path and adding it to the system's PATH environment variable if necessary. ```bash # Check npm global bin path npm config get prefix # Add to PATH if needed export PATH="$PATH:$(npm config get prefix)/bin" ``` -------------------------------- ### Run VCS Performance Comparison (TypeScript vs Rust) Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Executes a TypeScript script using Bun to benchmark Version Control System (VCS) performance, comparing TypeScript and Rust implementations. This helps in identifying performance bottlenecks and validating optimizations. ```bash bun ./script/bench-vcs.ts ``` -------------------------------- ### Run IronCode Development Commands Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Provides commands for common development tasks within the IronCode project, including running tests, performing type checking, formatting code, and benchmarking Rust components. ```bash # Run tests bun test # Type checking bun run typecheck # Format code ./script/format.ts # Benchmark Rust components cd packages/ironcode/native/tool cargo bench ``` -------------------------------- ### Configure AI API Keys Source: https://github.com/ksd-co/ironcode/blob/dev/install.md Sets environment variables for API keys required by AI models like Anthropic Claude and OpenAI. It also shows how to add these exports to the shell profile for persistence across sessions. ```bash # Anthropic Claude (recommended) export ANTHROPIC_API_KEY="your-key-here" # OpenAI export OPENAI_API_KEY="your-key-here" # Add to your shell profile echo 'export ANTHROPIC_API_KEY="your-key-here"' >> ~/.bashrc ``` -------------------------------- ### Run IronCode with Custom Memory Limit and Resource Monitoring Source: https://github.com/ksd-co/ironcode/blob/dev/README.md Demonstrates how to configure IronCode's memory usage and resource monitoring via command-line flags. This allows users to set a custom maximum memory limit or explicitly enable/disable the resource monitoring system. ```bash # Default (300MB limit, monitoring enabled) ironcode # Custom memory limit ironcode --max-memory 500 # Disable resource monitoring ironcode --no-enable-resource-monitor # Both options ironcode --max-memory 400 --enable-resource-monitor ``` -------------------------------- ### Run Root Commands with Bun Source: https://github.com/ksd-co/ironcode/blob/dev/AGENTS.md Execute core development commands from the repository root using Bun. These commands cover starting development servers, type checking, and building. ```bash bun dev # Run CLI/TUI (packages/ironcode) bun run dev:desktop # Run Tauri desktop app bun run dev:web # Run web app dev server (packages/app) bun typecheck # Type check all packages via Turbo ``` -------------------------------- ### Verify IronCode Installation Source: https://github.com/ksd-co/ironcode/blob/dev/README.md This command checks the installed version of IronCode. It's a simple verification step to ensure the tool is accessible from the command line. ```bash ironcode --version ```