### Install Dependencies and Start Dev Server Source: https://github.com/kilo-org/kilocode/blob/main/CONTRIBUTING.md Install project dependencies and start the development server using Bun. This is the initial step for developing Kilo CLI. ```bash bun install bun dev ``` -------------------------------- ### Install Dependencies and Start Development Server Source: https://github.com/kilo-org/kilocode/blob/main/packages/desktop/README.md Run these commands from the repo root to install project dependencies and start the Tauri development server for the desktop app. ```bash bun install bun run --cwd packages/desktop tauri dev ``` -------------------------------- ### SDK Installation and Client Creation Source: https://context7.com/kilo-org/kilocode/llms.txt Guides on installing the Kilo SDK and creating clients to interact with Kilo's capabilities, either by creating a local server and client together or connecting to an existing server. ```APIDOC ## SDK Installation and Client Creation The `@kilocode/sdk` provides programmatic access to Kilo's capabilities. Use `createKilo()` to spin up a local server and client together, or `createKiloClient()` to connect to an existing server. ```typescript import { createKilo, createKiloClient, createKiloServer } from "@kilocode/sdk" // Option 1: Create server and client together const { client, server } = await createKilo() // Option 2: Create server separately with custom options const server = await createKiloServer({ hostname: "127.0.0.1", port: 4096, timeout: 5000, config: { model: "anthropic/claude-sonnet-4", logLevel: "INFO", }, }) // Option 3: Connect to existing server const client = createKiloClient({ baseUrl: "http://localhost:4096", directory: "/path/to/project", // Optional: specify working directory }) // V2 SDK with experimental workspace support import { createKiloClient as createKiloClientV2 } from "@kilocode/sdk/v2" const clientV2 = createKiloClientV2({ baseUrl: "http://localhost:4096", experimental_workspaceID: "my-workspace", }) // Clean up when done server.close() ``` ``` -------------------------------- ### Install Go Package Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/kiloclaw/pre-installed-software.md Use this command to install a Go package. The tool will be installed at the latest version. ```bash go install github.com/example/tool@latest ``` -------------------------------- ### Build and Start Project Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/automate/tools/execute-command.md Executes sequential build and start commands for a project, typically 'npm run build' followed by 'npm start'. ```xml npm run build && npm start ``` -------------------------------- ### Basic Workflow Example (VSCode) Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/customize/workflows.md This workflow, saved as `submit-pr.md` in `.kilo/commands/`, guides the user through submitting a pull request by checking for TODOs, running tests, staging changes, and creating the PR. ```markdown --- description: Submit a pull request with full checks --- # Submit PR Workflow You are helping submit a pull request. Follow these steps: 1. First, use `grep` to check for any TODO comments or console.log statements that shouldn't be committed 2. Run tests using `bash` with `npm test` or the appropriate test command 3. If tests pass, stage and commit changes with a descriptive commit message 4. Push the branch and create a pull request using `bash` with `gh pr create` 5. Use `question` to get the PR title and description from the user Parameters needed (ask if not provided): - Branch name - Reviewers to assign ``` -------------------------------- ### Start Ollama Server Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/ai-providers/ollama.md Run this command in your terminal to start the Ollama server. Ensure Ollama is installed first. ```bash ollama serve ``` -------------------------------- ### Install Dependencies Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/contributing/development-environment.md Installs all necessary dependencies for the extension, webview UI, and tests. ```bash pnpm install ``` -------------------------------- ### Start, Check Version, and Get Help with Kilo CLI Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/platforms/cli.md Basic commands to start the Kilo CLI TUI, check its version, and access help documentation. ```bash # Start the TUI kilo # Check the version kilo --version # Get help kilo --help ``` -------------------------------- ### Install @kilocode/kilo-gateway Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-gateway/README.md Install the package using bun. ```bash bun add @kilocode/kilo-gateway ``` -------------------------------- ### Get System Status (No Arguments) Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/automate/tools/use-mcp-tool.md This example shows how to retrieve the current system status from the system-monitor server. This tool requires no arguments. ```xml system-monitor get_current_status {} ``` -------------------------------- ### Local Vim Plugin Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Example of a local vim plugin configuration. ```plaintext .opencode/plugins/tui-vim.tsx ``` -------------------------------- ### Example: Download qwen3-coder:30b Model Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/ai-providers/ollama.md This is an example of downloading the recommended `qwen3-coder:30b` model using the `ollama pull` command. ```bash ollama pull qwen3-coder:30b ``` -------------------------------- ### Verify and Install Agents SDK Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/test/fixture/skills/agents-sdk/SKILL.md Check for existing installation or install the package via npm. ```bash npm ls agents # Should show agents package ``` ```bash npm install agents ``` -------------------------------- ### Local Smoke Config Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Example of a local smoke configuration file. ```json .opencode/tui.json ``` -------------------------------- ### Install Dependencies Source: https://github.com/kilo-org/kilocode/blob/main/script/upstream/README.md Installs project dependencies using bun. Navigate to the script/upstream directory before running. ```bash cd script/upstream bun install ``` -------------------------------- ### Install a Theme Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Use `api.theme.install` to install a theme from a JSON file path. Relative paths are resolved from the plugin root. ```javascript api.theme.install("./themes/my-custom-theme.json"); ``` -------------------------------- ### Install Dependencies Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/gateway/quickstart.md Install the necessary npm packages for your project, including the AI SDK and OpenAI integration. ```bash npm install ai @ai-sdk/openai dotenv ``` -------------------------------- ### Install Git on Fedora Linux Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md Install Git on Fedora Linux using dnf. ```bash sudo dnf install git ``` -------------------------------- ### Install OpenAI SDK (Node.js) Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/gateway/sdks-and-frameworks.md Install the official OpenAI SDK for Node.js using npm. ```bash npm install openai ``` -------------------------------- ### Install Vercel AI SDK Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/gateway/sdks-and-frameworks.md Install the Vercel AI SDK and the OpenAI integration package using npm. ```bash npm install ai @ai-sdk/openai ``` -------------------------------- ### Install and Run Docs Locally Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/contributing/index.md Follow these steps to set up the documentation site locally for testing changes. Ensure you are in the correct directory and use pnpm for installation and development. ```bash cd packages/kilo-docs pnpm install pnpm dev ``` -------------------------------- ### Verify Kilo Code Installation Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/markdoc/partials/install-cli.md Checks the installed version of the Kilo Code CLI to confirm successful setup. ```bash kilo --version ``` -------------------------------- ### Install and Start Dunst Notification Daemon Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/getting-started/settings/system-notifications.md Install the lightweight notification daemon 'dunst' for minimal window managers on Linux. ```bash # Install and start dunst (lightweight notification daemon) sudo apt install dunst # Ubuntu/Debian sudo pacman -S dunst # Arch Linux ``` -------------------------------- ### Build the Desktop Application Source: https://github.com/kilo-org/kilocode/blob/main/packages/desktop/README.md Execute this command from the repo root to build the production-ready desktop application. ```bash bun run --cwd packages/desktop tauri build ``` -------------------------------- ### Run Development Server with Parameters Source: https://github.com/kilo-org/kilocode/blob/main/AGENTS.md Execute the development server with help parameters to display available options and configurations. ```bash bun dev -- help ``` -------------------------------- ### JSON Role Definition Property Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/customize/custom-modes.md Example of the `roleDefinition` property in JSON, defining the AI's role and expertise at the start of the system prompt. ```json "roleDefinition": "You are a technical writer specializing in clear documentation." ``` -------------------------------- ### Reference Environment Variable for API Key Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/platforms/cli.md Demonstrates how to securely reference an environment variable for an API key within the configuration. This example shows the setup for the OpenAI provider. ```json { "provider": { "openai": { "options": { "apiKey": "{env:OPENAI_API_KEY}" } } } } ``` -------------------------------- ### Development Setup Commands Source: https://github.com/kilo-org/kilocode/blob/main/sdks/vscode/README.md Commands required to initialize and run the extension development environment. ```bash code sdks/vscode ``` ```bash bun install ``` -------------------------------- ### Analyze Source Code Complexity Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/automate/tools/use-mcp-tool.md This example shows how to use the code-analysis server to get complexity metrics for a TypeScript file. You can specify which metrics to include, such as cyclomatic and cognitive complexity. ```xml code-analysis complexity_metrics { "language": "typescript", "file_path": "src/app.ts", "include_functions": true, "metrics": ["cyclomatic", "cognitive"] } ``` -------------------------------- ### Start CLI Server Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-vscode/AGENTS.md The extension starts the CLI backend by spawning `bin/kilo serve --port 0`. It captures the dynamic port from stdout and uses environment variables for authentication. ```bash kilo serve --port 0 ``` -------------------------------- ### Example Output Format for Code Definitions Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/automate/tools/list-code-definition-names.md The output displays file paths followed by line numbers and the actual source code of each definition. Each line shows the start and end line numbers, a pipe separator, and the source code of the definition. ```text src/utils.js: 0--0 | export class HttpClient { 5--5 | formatDate() { 10--10 | function parseConfig(data) { src/models/User.js: 0--0 | interface UserProfile { 10--10 | export class User { 20--20 | function createUser(data) { ``` -------------------------------- ### In-App Tutorial Flow Steps Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/contributing/architecture/onboarding-improvements.md Step-by-step breakdown of the interactive tutorial highlighting key interface elements. ```text Step 1: Welcome ├── Highlight: Entire interface ├── Content: "Welcome to KiloCode! Let's take a quick tour." └── Actions: [Skip Tour] [Next] Step 2: Mode Selection ├── Highlight: Mode selector buttons ├── Content: "Choose between Chat, Edit, and Architect modes for different tasks" └── Actions: [Back] [Next] Step 3: Side Panels & MCP Configuration ├── Highlight: Left sidebar ├── Content: "Access history, memory, and configure MCP servers for enhanced capabilities" └── Actions: [Back] [Next] Step 4: Starting a Chat ├── Highlight: Input area ├── Content: "Type your request here or use @ to reference files" └── Actions: [Back] [Next] Step 5: Starter Prompts ├── Highlight: Starter prompt area ├── Content: "Use these prompts to get started quickly with common tasks" └── Actions: [Back] [Finish] ``` -------------------------------- ### Install Kilo GitHub Action Source: https://github.com/kilo-org/kilocode/blob/main/github/README.md Run this command in your GitHub repository's terminal to initiate the installation process for the KiloConnect GitHub app and workflow. ```bash kilo github install ``` -------------------------------- ### Install Python Package Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/kiloclaw/pre-installed-software.md Use this command to install a Python package. Ensure you have pip installed. ```bash pip install ``` -------------------------------- ### Run Backend Development Server Source: https://github.com/kilo-org/kilocode/blob/main/packages/app/AGENTS.md Starts the backend development server for local UI changes. Ensure you are in the `packages/opencode` directory. ```bash bun run --conditions=browser ./src/index.ts serve --port 4096 ``` -------------------------------- ### Install Node Package Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/kiloclaw/pre-installed-software.md Use this command to install a Node.js package globally. Ensure you have npm installed. ```bash npm install -g ``` -------------------------------- ### Run Qdrant Locally with Docker Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/customize/context/codebase-indexing.md Use this command to quickly set up a local Qdrant instance for testing purposes. Ensure Docker is installed and running. ```bash docker run -p 6333:6333 qdrant/qdrant ``` -------------------------------- ### Setup CompletionProvider Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-vscode/src/services/autocomplete/continuedev/EXAMPLES.md Initializes the completion provider with configuration, LLM provider, error handling, and optional LSP definitions. ```typescript import { CompletionProvider } from "./core/autocomplete/CompletionProvider" import { MinimalConfigProvider } from "./core/autocomplete/MinimalConfig" import { IDE, ILLM } from "./core/index.d" import { OpenAI } from "./core/llm/llms/OpenAI" // 1. Create configuration const config = new MinimalConfigProvider({ tabAutocompleteOptions: { debounceDelay: 150, maxPromptTokens: 1024, useCache: true, }, }) // 2. Create LLM provider async function getLlm(): Promise { return new OpenAI({ apiKey: process.env.OPENAI_API_KEY || "", model: "gpt-4", completionOptions: { temperature: 0.1, maxTokens: 1000, }, }) } // 3. Error handler function onError(error: any) { console.error("Autocomplete error:", error) // Show user notification } // 4. LSP definitions function (optional but recommended) async function getDefinitionsFromLsp(filepath: string, contents: string, cursorIndex: number, ide: IDE, lang: any) { // Implement LSP integration or return empty array return [] } // 5. Create completion provider const completionProvider = new CompletionProvider( config, ide, // Your IDE implementation getLlm, onError, getDefinitionsFromLsp, ) ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/kilo-org/kilocode/blob/main/packages/app/README.md Installs project dependencies using npm, pnpm, or yarn. Ensure you have a package manager installed. ```bash npm install # or pnpm install or yarn install ``` -------------------------------- ### Install Git with Xcode Command Line Tools on macOS Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md Install Git on macOS by installing the Xcode Command Line Tools. ```bash xcode-select --install ``` -------------------------------- ### Install a Plugin Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Installs a plugin from a specification, performing install, manifest read, and config patch. Does not load the plugin into the current session; use api.plugins.add() afterwards. ```javascript api.plugins.install(spec, { global? }) ``` -------------------------------- ### Basic NextEdit Setup Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-vscode/src/services/autocomplete/continuedev/EXAMPLES.md Initializes the NextEditProvider with configuration, an LLM provider, and an error handler. Requires an IDE implementation. ```typescript import { NextEditProvider } from "./core/nextEdit/NextEditProvider" import { MinimalConfigProvider } from "./core/autocomplete/MinimalConfig" import { ILLM, IDE } from "./core" // 1. Configuration (shared with autocomplete) const config = new MinimalConfigProvider() // 2. LLM provider for NextEdit (can be different from autocomplete) async function getNextEditLlm(): Promise { return new OpenAI({ apiKey: process.env.OPENAI_API_KEY || "", model: "gpt-4", // Or specialized model like 'instinct' or 'mercury-coder' }) } // 3. Error handler function onNextEditError(error: any) { console.error("NextEdit error:", error) } // 4. Create NextEdit provider const nextEditProvider = new NextEditProvider( config, ide, // Your IDE implementation getNextEditLlm, onNextEditError, ) ``` -------------------------------- ### Install Additional Packages with APT Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/kiloclaw/pre-installed-software.md Use this command to install additional packages on a KiloClaw instance. Note that packages installed this way do not persist across redeploys. ```bash apt update && apt install -y ``` -------------------------------- ### Create File Prompt Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/customize/prompt-engineering.md Example of a specific prompt requesting a new file and function implementation. ```text Create a new file named `utils.py` and add a function called `calculate_average` that takes a list of numbers and returns their average. ``` -------------------------------- ### Build the Extension Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/contributing/development-environment.md Compiles the project and generates a .vsix file in the bin/ directory. ```bash pnpm build ``` -------------------------------- ### Install Kilo Code CLI with Homebrew Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/README.md Install the Kilo Code CLI on macOS or Linux using the Homebrew package manager. Ensure you have Homebrew installed first. ```bash brew install Kilo-Org/tap/kilo ``` -------------------------------- ### Example Patch Structure Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/src/tool/apply_patch.txt This example demonstrates the complete structure of a patch file, including adding, updating, moving, and deleting files. Ensure all operations are enclosed within '*** Begin Patch' and '*** End Patch' markers. ```patch *** Begin Patch *** Add File: hello.txt +Hello world *** Update File: src/app.py *** Move to: src/main.py @@ def greet(): -print("Hi") +print("Hello, world!") *** Delete File: obsolete.txt *** End Patch ``` -------------------------------- ### Local Smoke Theme Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Example of a local smoke theme configuration. ```json .opencode/plugins/smoke-theme.json ``` -------------------------------- ### TUI Configuration Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Example of a `tui.json` file, showing theme and plugin configurations. Plugin entries can be npm specs or local paths with options. ```json { "$schema": "https://opencode.ai/tui.json", "theme": "smoke-theme", "plugin": ["@acme/opencode-plugin@1.2.3", ["./plugins/demo.tsx", { "label": "demo" }]], "plugin_enabled": { "acme.demo": false } } ``` -------------------------------- ### Local Smoke Plugin Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/opencode/specs/tui-plugins.md Example of a local smoke plugin configuration. ```plaintext .opencode/plugins/tui-smoke.tsx ``` -------------------------------- ### Install Git on Arch Linux Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md Install Git on Arch Linux using pacman. ```bash sudo pacman -S git ``` -------------------------------- ### Verify Git Installation on macOS Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md Check if Git is installed and display its version on macOS. ```bash git --version ``` -------------------------------- ### MultiSearchReplaceDiffStrategy Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/automate/tools/apply-diff.md Demonstrates the required format for multiple search/replace blocks, including mandatory :start_line: and :end_line: markers. ```diff <<<<<<< SEARCH :start_line:10 :end_line:12 ------- // Old calculation logic const result = value * 0.9; return result; ======= // Updated calculation logic with logging console.log(`Calculating for value: ${value}`); const result = value * 0.95; // Adjusted factor return result; >>>>>>> REPLACE <<<<<<< SEARCH :start_line:25 :end_line:25 ------- const defaultTimeout = 5000; ======= const defaultTimeout = 10000; // Increased timeout >>>>>>> REPLACE ``` -------------------------------- ### Changeset File Example Source: https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/contributing/index.md Example of a manually created changeset file. Use 'patch' for bug fixes, 'minor' for new features, and 'major' for breaking changes. Descriptions should be user-oriented and in the imperative mood. ```markdown --- "kilo-code": minor --- Short description of the change for the changelog. ```