### Show Installer Options Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Display available options and usage instructions for the bootstrap installer script. ```bash ./bootstrap.sh --help ``` -------------------------------- ### Start OpenCode Session Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Initiates an OpenCode session. This is the primary command to run after installation. ```text /ocb-start ``` -------------------------------- ### Disposable Install Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Install the bootstrap bundle to a specified target directory, forcing the installation and skipping backup. ```bash ./bootstrap.sh --target-dir /tmp/opencode-bootstrap-test --force --skip-backup ``` -------------------------------- ### Clone and Bootstrap OpenCode Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Clone the repository, make the bootstrap script executable, and run it to install OpenCode. ```bash git clone git@github.com:tikhomirov/opencode-bootstrap.git cd opencode-bootstrap chmod +x bootstrap.sh scripts/verify.sh scripts/generate-checksums.sh ./bootstrap.sh ``` -------------------------------- ### Installer Flow Dry-run Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Simulate the installer flow to a temporary directory without making any persistent changes. ```bash ./bootstrap.sh --dry-run --target-dir /tmp/ ``` -------------------------------- ### Make Scripts Executable Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Ensure scripts are executable after cloning the repository. This is a one-time setup step. ```bash chmod +x bootstrap.sh scripts/verify.sh scripts/generate-checksums.sh ``` -------------------------------- ### Verify-only Run Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Execute the verification step of the bootstrap process without performing the installation. ```bash ./bootstrap.sh --verify-only --target-dir /tmp/opencode-bootstrap-test ``` -------------------------------- ### OpenCode Authentication and Project Initialization Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Commands for authenticating with OpenCode and initializing a project. Run these after starting an OpenCode session. ```text opencode auth login ``` ```text cd /path/to/project && opencode ``` ```text /ocb-project-init ``` -------------------------------- ### Dry-run Install Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Perform a dry run of the installation process to a specified target directory without making any changes. ```bash ./bootstrap.sh --dry-run --target-dir /tmp/opencode-bootstrap-dry-run ``` -------------------------------- ### End-to-End Bootstrap Behavior Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Perform a full bootstrap installation to a temporary directory, forcing the operation and skipping backups. ```bash ./bootstrap.sh --target-dir /tmp/ --force --skip-backup ``` -------------------------------- ### Verify Wrapper Script Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Use the dedicated wrapper script to perform a verification run on the bootstrap installation. ```bash ./scripts/verify.sh --target-dir /tmp/opencode-bootstrap-test ``` -------------------------------- ### Start a New Bounded Loop with TypeScript Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `loop_state_start` function in TypeScript initiates a new bounded loop execution. It requires an alias and task prompt, with optional parameters for ideal result, maximum iterations, and success criteria. ```typescript // loop_state_start - Start a new bounded loop // Parameters: // - alias: Short loop alias // - taskPrompt: Task description // - idealResult: Optional ideal result description // - maxIterations: Maximum iterations (default: 4) // - criteriaJson: Success criteria JSON string { "root": "/path/to/project", "alias": "optimize-api", "run_id": "optimize-api-1710000000000", "run": "/path/to/project/.opencode/project/loops/optimize-api/run.json", "history": "/path/to/project/.opencode/project/loops/optimize-api/history.jsonl", "artifact": "/path/to/project/.opencode/project/loops/optimize-api/artifact.md" } ``` -------------------------------- ### CI-Equivalent Local Verification Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md A comprehensive local verification process mimicking CI checks, including syntax validation, checksum verification, installation, and service testing. ```bash sh -n bootstrap.sh sh -n scripts/verify.sh sh -n scripts/generate-checksums.sh ./scripts/generate-checksums.sh --check ./bootstrap.sh --dry-run --target-dir /tmp/opencode-bootstrap-dry-run ./bootstrap.sh --target-dir /tmp/opencode-bootstrap-test --force --skip-backup ./scripts/verify.sh --target-dir /tmp/opencode-bootstrap-test TARGET="/tmp/opencode-bootstrap-test" cd "$TARGET" OPENCODE_CONFIG="$TARGET/opencode.json" OPENCODE_CONFIG_DIR="$TARGET" opencode serve --port 4110 >/tmp/opencode-bootstrap-serve.log 2>&1 & SERVER_PID=$! sleep 5 curl --noproxy '*' -fsS "http://127.0.0.1:4110/experimental/tool/ids" | tee /tmp/opencode-bootstrap-tool-ids.json kill "$SERVER_PID" wait "$SERVER_PID" 2>/dev/null || true grep -q 'project_intelligence_status' /tmp/opencode-bootstrap-tool-ids.json grep -q 'project_intelligence_apply' /tmp/opencode-bootstrap-tool-ids.json grep -q 'loop_state_start' /tmp/opencode-bootstrap-tool-ids.json grep -q 'loop_state_status' /tmp/opencode-bootstrap-tool-ids.json ``` -------------------------------- ### Recommended Project Initialization and Workflow Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Steps to initialize a project and execute the core workflow commands within the OpenCode environment. ```bash cd /path/to/project opencode ``` -------------------------------- ### Basic OpenCode Workflow Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md This sequence of commands is recommended for beginners to initialize a project and manage tasks. ```text /ocb-project-init /ocb-plan add X /ocb-implement /ocb-verify ``` -------------------------------- ### Manual Post-Install OpenCode Commands Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Commands to run after the initial bootstrap for authentication and listing resources. ```bash opencode auth login opencode auth list opencode mcp list ``` -------------------------------- ### Manage Implementation Plans with /ocb-plan Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-plan command creates or updates project implementation plans. It generates structured phases, acceptance criteria, and verification checkpoints, saving the output to .opencode/project/PLAN.md. ```bash # Create a new implementation plan /ocb-plan add user authentication with JWT tokens # Refresh an existing plan with new requirements /ocb-plan add rate limiting to the authentication endpoints # View the current plan cat .opencode/project/PLAN.md ``` -------------------------------- ### OpenCode Explore Topic Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Use this command to research options, pros, and cons before committing to a solution. ```text /ocb-explore what is the safest way to verify the bundle after install? ``` -------------------------------- ### OpenCode Project Initialization Command Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md The command to run inside an OpenCode session to initialize project-specific artifacts. ```text /ocb-project-init ``` -------------------------------- ### Execute Implementation with /ocb-implement Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-implement command executes the current plan by delegating code generation to the Claude-based implementer subagent. It respects project rules and performs verification after each batch. ```bash # Execute the current plan /ocb-implement # Manual delegation to implementer for specific tasks @implementer implement the JWT validation middleware based on the plan ``` -------------------------------- ### Initialize Shell Scripts Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Standard header for POSIX-compliant shell scripts to ensure safe execution. ```bash #!/bin/sh set -eu ``` -------------------------------- ### Verify Implementation with /ocb-verify Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-verify command validates the current implementation against project requirements and rules. It runs tests, checks logs, and persists a summary to .opencode/project/VERIFY.md. ```bash # Verify current implementation /ocb-verify # Manual review delegation for critical changes @reviewer review the authentication implementation @final-reviewer final review before merge to main ``` -------------------------------- ### OpenCode Plan Task Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Initiates the planning phase for a new task, creating a step-by-step plan in `.opencode/project/PLAN.md`. ```text /ocb-plan add a command to check bundle health ``` -------------------------------- ### OpenCode Verification Script Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md A shell script to verify the bundle, OpenCode availability, required agents, MCP configuration, and provider routing. ```bash ./scripts/verify.sh ``` -------------------------------- ### Manage OpenCode Bootstrap Loops Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt Command-line interface for managing OpenCode Bootstrap loops, including status checks, resuming, viewing history, listing, stopping, and cleaning loops. These commands interact with the underlying loop state management. ```bash # Check loop status /ocb-loop status # Resume a paused loop /ocb-loop resume # Resume a specific loop by alias /ocb-loop resume optimize-api # View loop history /ocb-loop history # List all loops /ocb-loop list # Stop a loop manually /ocb-loop stop "performance target achieved" # Clean completed loops /ocb-loop clean optimize-api /ocb-loop clean --all ``` -------------------------------- ### Verification Logic Only Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Execute only the verification part of the bootstrap process to a temporary directory. ```bash ./bootstrap.sh --verify-only --target-dir /tmp/ ``` -------------------------------- ### OpenCode Implement Changes Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Executes code changes based on the saved plan and project rules. ```text /ocb-implement ``` -------------------------------- ### Run Iterative Refinement with /ocb-loop Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-loop command initiates iterative cycles to reach specific goals. It enforces success criteria and manages state persistence until stop conditions are met. ```bash # Start a new loop with explicit criteria /ocb-loop new optimize API response time to under 200ms ``` -------------------------------- ### OpenCode Bootstrap Agent Configuration Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt Configuration for OpenCode Bootstrap agents, defining primary, workflow, and subagents with their respective models, descriptions, and usage criteria. This structure enables specialized task routing and model selection for optimal AI performance. ```json // Primary agents (user-facing) { "fast": { "description": "Fast primary agent for small bugfixes and tight iterative changes", "model": "openai/gpt-5.3-codex", "use_for": ["small bugfixes", "narrow regressions", "lint/type/test failures"] }, "build": { "description": "Primary daily development orchestrator", "model": "openai/gpt-5.4", "use_for": ["normal project work", "feature implementation", "orchestration"] }, "plan": { "description": "Primary planning and analysis agent with guarded write access", "model": "openai/gpt-5.4", "use_for": ["planning", "analysis", "exploration"] }, "deep": { "description": "Deep analysis agent for complex problems", "model": "openai/gpt-5.4", "use_for": ["complex debugging", "architecture decisions", "deep research"] } } // Workflow agents (command-specific) { "project-bootstrapper": "Interview-driven project setup", "grounded-researcher": "Evidence-only analysis", "loop-orchestrator": "Bounded iteration management", "project-evolver": "Patch-to-rules learning" } // Subagents (delegated tasks) { "implementer": { "description": "Claude implementation agent for substantial code generation", "model": "anthropic/claude-sonnet-4-6", "use_when": "research done, plan clear, substantial code needed" }, "final-reviewer": { "description": "Claude Opus for final review of large or risky changes", "model": "anthropic/claude-opus", "use_when": "pre-merge review of critical changes" } } ``` -------------------------------- ### OpenCode Verify Changes Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Generates a verification summary in `.opencode/project/VERIFY.md` to check if the work is correct. ```text /ocb-verify ``` -------------------------------- ### OpenCode Evolve Project Rules Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Improves learned project rules based on past fixes, useful when the same mistakes keep recurring. ```text /ocb-evolve ``` -------------------------------- ### Core OpenCode Workflow Commands Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Essential commands for managing project tasks within OpenCode, including planning, implementation, and verification. ```text /ocb-project-init ``` ```text /ocb-plan ``` ```text /ocb-implement ``` ```text /ocb-verify ``` -------------------------------- ### OpenCode Loop Task Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Initiates a bounded iterative workflow for larger tasks that require several controlled rounds, with saved state. ```text /ocb-loop new ``` -------------------------------- ### Execute Shell Verification Commands Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Commands used to verify changes to specific project files during development. ```bash ./scripts/verify.sh --target-dir /tmp/opencode-bootstrap-test ``` ```bash ./scripts/generate-checksums.sh --check ``` -------------------------------- ### Check Bundle Checksums Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Verify the integrity of the bundled files by checking their checksums against the generated list. ```bash ./scripts/generate-checksums.sh --check ``` -------------------------------- ### Tail Log File with OpenCode Bootstrap Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `tail_log` tool efficiently reads the last lines of log files without loading the entire file into memory. It allows specifying the file path, the number of lines to return, and a maximum byte buffer for performance with large files. ```typescript // Read last 200 lines (default) from a log file tail_log({ path: "logs/app.log" }) // Returns: // path: /path/to/project/logs/app.log // size_bytes: 1048576 // read_from_offset: 983040 // returned_lines: 200 // --- // [2026-03-10 14:30:22] INFO: Server started on port 3000 // [2026-03-10 14:30:23] INFO: Database connected // ... // Read specific number of lines tail_log({ path: "/var/log/nginx/error.log", lines: 50 }) // Read with custom byte buffer for very large files tail_log({ path: "logs/debug.log", lines: 500, maxBytes: 131072 // Read last 128KB before extracting lines }) // Use with debugging workflow // 1. Check application logs tail_log({ path: "logs/app.log", lines: 100 }) // 2. Check error logs tail_log({ path: "logs/error.log", lines: 50 }) // 3. Use evidence in /ocb-fix command ``` -------------------------------- ### Evolve Project Rules with /ocb-evolve Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-evolve command analyzes historical bug-fix patches to identify recurring patterns. It updates LEARNED_RULES.generated.md to prevent future regressions. ```bash # Evolve project rules from patch history /ocb-evolve ``` -------------------------------- ### Save Clipboard Image with OpenCode Bootstrap Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `clipboard_image` tool captures an image from the system clipboard and saves it to a specified path. It supports default saving locations and custom paths, with output depending on the detected clipboard utility (e.g., pngpaste, xclip, wl-paste). ```typescript // Save clipboard image with default path // Output: .opencode/tmp/clipboard-{timestamp}.png clipboard_image() // Returns: // saved: /path/to/project/.opencode/tmp/clipboard-1710000000000.png // source: pngpaste // You can now attach this file to an OpenCode prompt or inspect it directly. // Save clipboard image to custom path clipboard_image({ outputPath: "screenshots/error-state.png" }) // Returns: // saved: /path/to/project/screenshots/error-state.png // source: xclip // You can now attach this file to an OpenCode prompt or inspect it directly. // Supported clipboard utilities by platform: // - macOS: pngpaste (via Homebrew) // - Linux X11: xclip // - Linux Wayland: wl-paste (via wl-clipboard) // - WSL: Best-effort support, may require manual setup ``` -------------------------------- ### Detect Project Root and Overlay Status with TypeScript Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `project_intelligence_status` function in TypeScript detects the project root directory and checks the status of project overlays, including configuration and rules existence. It returns detailed information about the project's state. ```typescript // project_intelligence_status - Detect project root and overlay status // Returns: project root, overlay existence, local config state { "root": "/path/to/project", "project_dir": "/path/to/project/.opencode/project", "profile_exists": true, "rules_exists": true, "learned_rules_exists": true, "local_config_exists": true, "local_instructions": [ ".opencode/project/PROJECT_RULES.generated.md", ".opencode/project/LEARNED_RULES.generated.md" ] } ``` -------------------------------- ### Run pre-submission verification and smoke tests Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/CONTRIBUTING.md A collection of shell commands to validate script syntax, generate checksums, and perform a dry-run bootstrap to ensure environment compatibility before submitting a pull request. ```bash sh -n bootstrap.sh sh -n scripts/verify.sh sh -n scripts/generate-checksums.sh ./scripts/generate-checksums.sh --check ./bootstrap.sh --dry-run --target-dir /tmp/opencode-bootstrap-dry-run ./bootstrap.sh --target-dir /tmp/opencode-bootstrap-test --force --skip-backup ./scripts/verify.sh --target-dir /tmp/opencode-bootstrap-test ``` -------------------------------- ### Apply Project Profile and Rules with TypeScript Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `project_intelligence_apply` function in TypeScript applies the project profile and rules. It takes structured project profile JSON, generated rules markdown, and optional learned rules markdown as input, writing them to the project directory. ```typescript // project_intelligence_apply - Apply project profile and rules // Parameters: // - profileJson: Structured project profile JSON string // - rulesMarkdown: Generated project rules markdown // - learnedRulesMarkdown: Optional learned rules markdown { "root": "/path/to/project", "written": [ "/path/to/project/.opencode/project/PROJECT_PROFILE.json", "/path/to/project/.opencode/project/PROJECT_RULES.generated.md", "/path/to/project/.opencode/project/LEARNED_RULES.generated.md", "/path/to/project/opencode.json" ] } ``` -------------------------------- ### OpenCode Fix Bug Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Use this command for debugging and fixing issues. It first attempts to debug and then applies a small fix with a patch note. ```text /ocb-fix the README says to run a command that does not exist ``` -------------------------------- ### Regenerate Bundle Checksums Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Generate or regenerate the checksums file for the bundled runtime payload. ```bash ./scripts/generate-checksums.sh ``` -------------------------------- ### Shell Syntax Check for Single Script Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Perform a POSIX shell syntax check on an individual script file. ```bash sh -n path/to/script.sh ``` -------------------------------- ### OpenCode Bootstrap Useful Flags Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Flags that can be used with the bootstrap script to modify its behavior, such as dry runs or skipping dependencies. ```text --dry-run ``` ```text --verify-only ``` ```text --skip-deps ``` ```text --skip-opencode ``` ```text --skip-backup ``` ```text --target-dir PATH ``` ```text --bundle-dir PATH ``` ```text --opencode-version VERSION ``` -------------------------------- ### Write Workflow Artifacts with TypeScript Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The `project_intelligence_artifact` function in TypeScript is used to write workflow artifacts, such as plan details, to a specified location within the `.opencode/project` directory. It allows for either replacing or appending content. ```typescript // project_intelligence_artifact - Write workflow artifacts // Parameters: // - relativePath: Path under .opencode/project (e.g., "PLAN.md") // - content: Artifact content // - append: Optional boolean to append instead of replace { "root": "/path/to/project", "file": "/path/to/project/.opencode/project/PLAN.md", "append": false } ``` -------------------------------- ### Shell Syntax Checks Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Perform POSIX shell syntax validation on the main scripts of the bootstrap bundle. ```bash sh -n bootstrap.sh ``` ```bash sh -n scripts/verify.sh ``` ```bash sh -n scripts/generate-checksums.sh ``` -------------------------------- ### Format JSON Output Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/AGENTS.md Standard pattern for writing JSON files in TypeScript tools with consistent indentation. ```typescript JSON.stringify(value, null, 2) ``` -------------------------------- ### Fix Bugs and Capture Patches with /ocb-fix Source: https://context7.com/tikhomirov/opencode-bootstrap/llms.txt The /ocb-fix command facilitates evidence-based debugging. It gathers reproduction steps and logs, applies a fix, and saves a structured patch artifact for future reference. ```bash # Fix a specific bug with evidence gathering /ocb-fix users cannot log in after token expiry ``` -------------------------------- ### OpenCode Grounded Question Source: https://github.com/tikhomirov/opencode-bootstrap/blob/main/README.md Obtain a strict, evidence-only answer to a question, avoiding any guessing. ```text /ocb-grounded which files define the shipped OpenCode bundle? ```