### Install Dependencies and Run Development Server Source: https://github.com/xiaomimimo/mimo-code/blob/main/README.md Use these commands to install project dependencies and start the development server. Ensure you have Bun installed. ```bash bun install # Install dependencies bun run dev # Run in development mode bun turbo typecheck # Type check ``` -------------------------------- ### Install Dependencies and Run Development Server Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/desktop/README.md Use these commands to install project dependencies and start the development server for OpenCode Desktop. ```bash bun install bun dev ``` -------------------------------- ### Start SolidStart Development Server Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/console/app/README.md Run this command after installing dependencies to start the development server. The `-- --open` flag will automatically open the application in a new browser tab. ```bash npm run dev # or start the server and open the app in a new browser tab npm run dev -- --open ``` -------------------------------- ### Install OpenCode with Bun Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode globally using Bun. ```bash bun install -g opencode-ai ``` -------------------------------- ### Install OpenCode with Script Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Use this command to install OpenCode via the official installation script. ```bash curl -fsSL https://opencode.ai/install | bash ``` -------------------------------- ### Install OpenCode with npm Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode globally using npm. ```bash npm install -g opencode-ai ``` -------------------------------- ### Install OpenCode with Yarn Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode globally using Yarn. ```bash yarn global add opencode-ai ``` -------------------------------- ### Install MiMoCode via curl Source: https://github.com/xiaomimimo/mimo-code/blob/main/README_npm.md Install MiMoCode using a curl command to download and execute the installation script. This is a quick way to get started. ```bash curl -fsSL https://mimo.xiaomi.com/install | bash ``` -------------------------------- ### Install SDK Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Install the opencode SDK from npm. This command is used to add the necessary package to your project. ```bash npm install @mimo-ai/sdk ``` -------------------------------- ### Install OpenCode with pnpm Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode globally using pnpm. ```bash pnpm install -g opencode-ai ``` -------------------------------- ### Start Headless OpenCode Server with Web Interface Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/cli.mdx Use this command to start an HTTP server that provides a web interface for OpenCode. Set OPENCODE_SERVER_PASSWORD to enable basic authentication. ```bash opencode web ``` -------------------------------- ### Apply Patch Example Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/apply_patch.txt This example demonstrates a complete patch file, including adding a new file, updating an existing file with content changes and a rename, and deleting a file. ```plaintext *** 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 ``` -------------------------------- ### Install OpenCode with Mise Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode using Mise, a polyglot version manager. ```bash mise use -g github:anomalyco/opencode ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/README.md Run this command in the root of your project to install all the necessary dependencies defined in `package.json`. ```bash npm install ``` -------------------------------- ### Install GitHub Agent Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/cli.mdx Install the GitHub agent in your repository. This sets up the necessary GitHub Actions workflow and guides you through the configuration process. ```bash opencode github install ``` -------------------------------- ### WSLg Audio Setup Source: https://github.com/xiaomimimo/mimo-code/blob/main/README.md Installs necessary audio packages and sets the PulseAudio server for WSLg environments. Ensure sox is installed on your system. ```bash sudo apt install -y sox pulseaudio libasound2-plugins export PULSE_SERVER=unix:/mnt/wslg/PulseServer ``` -------------------------------- ### Prompt to use MCP Server Tool Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/mcp-servers.mdx Example prompt demonstrating how to invoke a configured MCP server tool. ```text use the mcp_everything tool to add the number 3 and 4 ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/README.md Use this command to install all project dependencies managed by Bun. ```bash bun install ``` -------------------------------- ### Install Clipboard Utilities on Linux (Wayland) Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/troubleshooting.mdx Install `wl-clipboard` on Wayland-based Linux systems for copy/paste functionality in OpenCode. ```bash apt install -y wl-clipboard ``` -------------------------------- ### Example Command Usage Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/commands.mdx Illustrates how to invoke a custom command in the TUI. ```bash /my-command ``` -------------------------------- ### Create Client Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Create an instance of opencode to start both a server and a client. You can optionally provide configuration options. ```javascript import { createOpencode } from "@mimo-ai/sdk" const { client } = await createOpencode() console.log(`Server running at ${opencode.server.url}`) opencode.server.close() ``` -------------------------------- ### AGENTS.md Example for Context7 Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/mcp-servers.mdx An example of how to instruct an agent to use the 'context7' tool for searching documentation, as might be configured in an AGENTS.md file. ```markdown When you need to search docs, use `context7` tools. ``` -------------------------------- ### Basic OpenCode Configuration Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/formatters.mdx An example of the basic OpenCode configuration file structure, including the formatter section. ```json { "$schema": "https://opencode.ai/config.json", "formatter": {} } ``` -------------------------------- ### Install OpenCode with Scoop on Windows Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode on Windows using the Scoop package manager. ```powershell scoop install opencode ``` -------------------------------- ### Start New Session Command Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/tui.mdx Start a new session. Alias: /clear. Keybind: ctrl+x n. ```bash /new ``` -------------------------------- ### Example: Spawn Subagent and Tie to a Task Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/actor.shell.txt This example shows how to spawn a 'general' subagent and associate it with a task ID (T1) for progress tracking. ```shell actor spawn general "Implement auth" "build the login flow" --task T1 ``` -------------------------------- ### Install Clipboard Utilities on Linux (X11) Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/troubleshooting.mdx Install `xclip` or `xsel` on X11-based Linux systems for copy/paste functionality in OpenCode. ```bash apt install -y xclip # or apt install -y xsel ``` -------------------------------- ### Start OpenCode TUI for Specific Directory Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/tui.mdx Start the OpenCode TUI for a specified working directory. ```bash opencode /path/to/project ``` -------------------------------- ### Start OpenCode Server in WSL for Desktop App Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/windows-wsl.mdx Start the OpenCode server in WSL, binding to all interfaces (0.0.0.0) on a specific port. This allows the desktop app to connect externally. ```bash opencode serve --hostname 0.0.0.0 --port 4096 ``` -------------------------------- ### Create Opencode Client Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Create a default instance of the opencode client. This starts both a server and a client, allowing immediate interaction. ```javascript import { createOpencode } from "@mimo-ai/sdk" const { client } = await createOpencode() ``` -------------------------------- ### Example: Run Subagent for Specific Task Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/actor.shell.txt This example demonstrates running the 'explore' subagent to find error recovery mechanisms in a specific file. ```shell actor run explore "Find error recovery" "Scan src/parser.ts for catch blocks. Return file:line." ``` -------------------------------- ### Start a Task Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/task.shell.txt Transition a task to the 'in_progress' state using the 'task start' command. Optionally, provide a reason note. ```shell task start T1 [--reason ""] ``` -------------------------------- ### Install MiMoCode via npm Source: https://github.com/xiaomimimo/mimo-code/blob/main/README_npm.md Install the MiMoCode CLI globally using npm. This command is used for setting up the tool on your system. ```bash npm install -g @mimo-ai/cli ``` -------------------------------- ### Example AGENTS.md Content Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/rules.mdx This example demonstrates the structure and content of an AGENTS.md file, including project overview, structure, code standards, and monorepo conventions. Commit this file to Git for consistent agent behavior. ```markdown # SST v3 Monorepo Project This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management. ## Project Structure - `packages/` - Contains all workspace packages (functions, core, web, etc.) - `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts) - `sst.config.ts` - Main SST configuration with dynamic imports ## Code Standards - Use TypeScript with strict mode enabled - Shared code goes in `packages/core/` with proper exports configuration - Functions go in `packages/functions/` - Infrastructure should be split into logical files in `infra/` ## Monorepo Conventions - Import shared modules using workspace names: `@my-app/core/example` ``` -------------------------------- ### Example: Run Subagent with Model Selection Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/actor.shell.txt Specify a model or tier (e.g., 'lite') for the subagent to use during execution. ```shell actor run explore "Quick scan" "find catch blocks" --model lite ``` -------------------------------- ### Initialize OpenCode for Project Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Run the /init command to analyze your project and create an AGENTS.md file. ```bash /init ``` -------------------------------- ### Prompt TUI for Summary Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/tui.mdx Example of a text prompt to get a codebase summary from the TUI. ```text Give me a quick summary of the codebase. ``` -------------------------------- ### Run MiMoCode Source: https://github.com/xiaomimimo/mimo-code/blob/main/README_npm.md Execute the MiMoCode application from the terminal after installation. The first launch will guide you through the configuration process. ```bash mimo ``` -------------------------------- ### Run File Creation Command Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/commands.mdx Shows how to execute the file creation command, passing values for filename, directory, and content using positional arguments. ```bash /create-file config.json src "{ \"key\": \"value\" }" ``` -------------------------------- ### Check Server Health Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Use this to verify the server is running and to get its current version. No specific setup is required beyond having an initialized client. ```javascript const health = await client.global.health() console.log(health.data.version) ``` -------------------------------- ### Create a New SolidStart Project Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/console/app/README.md Use this command to initialize a new SolidStart project. It can be run in the current directory or specify a directory name for the new project. ```bash npm init solid@latest # create a new project in my-app npm init solid@latest my-app ``` -------------------------------- ### Glob Pattern Bash Permissions Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/agents.mdx Use glob patterns to set permissions for a group of bash commands. This example grants 'ask' permission for all commands starting with 'git '. ```json { "$schema": "https://opencode.ai/config.json", "agent": { "build": { "permission": { "bash": { "git *": "ask" } } } } } ``` -------------------------------- ### Verify Agents SDK Installation Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/test/fixture/skills/agents-sdk/SKILL.md Check if the 'agents' package is installed in your project. If not, install it using npm. ```bash npm ls agents # Should show agents package ``` ```bash npm install agents ``` -------------------------------- ### Run the Web App for UI Testing Source: https://github.com/xiaomimimo/mimo-code/blob/main/CONTRIBUTING.md Start the web application's local development server to test UI changes. Ensure the OpenCode server is running first. ```bash bun run --cwd packages/app dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/app/README.md Installs project dependencies using npm, pnpm, or yarn. Ensure you have one of these package managers installed. ```bash npm install # or pnpm install or yarn install ``` -------------------------------- ### AGENTS.md Example for Grep by Vercel Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/mcp-servers.mdx An example of how to instruct an agent to use the 'gh_grep' tool for searching code examples, as might be configured in an AGENTS.md file. ```markdown If you are unsure how to do something, use `gh_grep` to search code examples from GitHub. ``` -------------------------------- ### Create a New SolidStart Project Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/enterprise/README.md Use `npm init solid@latest` to create a new SolidStart project. You can initialize it in the current directory or specify a project name. ```bash # create a new project in the current directory npm init solid@latest # create a new project in my-app npm init solid@latest my-app ``` -------------------------------- ### Connect to OpenCode Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Run the /connect command in the TUI to initiate the connection process with OpenCode. ```txt /connect ``` -------------------------------- ### Connect to Groq Provider Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/providers.mdx Initiate the connection to the Groq provider by running the /connect command and entering the API key when prompted. ```bash /connect ``` ```bash ┌ API key │ │ └ enter ``` -------------------------------- ### Install OpenCode with Chocolatey on Windows Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode on Windows using the Chocolatey package manager. ```powershell choco install opencode ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Change your current directory to the project you want to work on. ```bash cd /path/to/project ``` -------------------------------- ### Programmatic ACP Server Start Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/acp/README.md Import and start the ACPServer programmatically within your TypeScript application. ```typescript import { ACPServer } from "./acp/server" await ACPServer.start() ``` -------------------------------- ### Connect to Baseten Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/providers.mdx Connect to Baseten by using the /connect command and entering your Baseten API key when prompted. After connecting, use /models to select your desired model. ```txt /connect ``` ```txt ┌ API key │ │ └ enter ``` ```txt /models ``` -------------------------------- ### Configure Custom Provider with API Key, Headers, and Model Limits Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/providers.mdx This example demonstrates advanced configuration for a custom provider, including setting an API key via environment variables, adding custom authorization headers, and specifying model input/output token limits. This is useful for providers that require specific authentication or have known token constraints. ```json { "$schema": "https://opencode.ai/config.json", "provider": { "myprovider": { "npm": "@ai-sdk/openai-compatible", "name": "My AI ProviderDisplay Name", "options": { "baseURL": "https://api.myprovider.com/v1", "apiKey": "{env:ANTHROPIC_API_KEY}", "headers": { "Authorization": "Bearer custom-token" } }, "models": { "my-model-name": { "name": "My Model Display Name", "limit": { "context": 200000, "output": 65536 } } } } } } ``` -------------------------------- ### List Themes Command Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/tui.mdx List available themes. Keybind: ctrl+x t. ```bash /themes ``` -------------------------------- ### Install xsel for WSL clipboard issues Source: https://github.com/xiaomimimo/mimo-code/blob/main/README.md If you encounter garbled text when copying on WSL, install the 'xsel' package. ```bash sudo apt install xsel ``` -------------------------------- ### Get Task Details Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/tool/task.shell.txt Retrieve detailed information about a specific task by its ID using the 'task get' command. ```shell task get T1 ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/app/README.md Installs the necessary browser binaries for Playwright end-to-end testing. This command is required before running tests. ```bash bunx playwright install chromium ``` -------------------------------- ### Ask OpenCode to Explain Codebase Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Use the @ key to fuzzy search for files and ask OpenCode to explain specific parts of your codebase. ```txt @packages/functions/src/api/index.ts How is authentication handled in @packages/functions/src/api/index.ts ``` -------------------------------- ### Preview Production Build Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/README.md Use this command to preview your production build locally before deploying. It serves the contents of the `./dist/` directory. ```bash npm run preview ``` -------------------------------- ### Example PR Titles Source: https://github.com/xiaomimimo/mimo-code/blob/main/CONTRIBUTING.md Illustrative examples of PR titles adhering to conventional commit standards, including optional scopes. ```markdown docs: update contributing guidelines ``` ```markdown fix: resolve crash on startup ``` ```markdown feat: add dark mode support ``` ```markdown feat(app): add dark mode support ``` ```markdown fix(desktop): resolve crash on startup ``` ```markdown chore: bump dependency versions ``` -------------------------------- ### Install OpenCode on Arch Linux Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode on Arch Linux using pacman for the stable version or paru for the latest from AUR. ```bash sudo pacman -S opencode # Arch Linux (Stable) paru -S opencode-bin # Arch Linux (Latest from AUR) ``` -------------------------------- ### Install OpenCode with Homebrew Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/index.mdx Install OpenCode using Homebrew on macOS and Linux. It's recommended to use the anomalyco/tap for the latest releases. ```bash brew install anomalyco/tap/opencode ``` -------------------------------- ### Run the Native Desktop App Source: https://github.com/xiaomimimo/mimo-code/blob/main/CONTRIBUTING.md Launch the native desktop application using Tauri. This command starts the web dev server and opens the native window. Additional Tauri prerequisites may be required. ```bash bun run --cwd packages/desktop tauri dev ``` -------------------------------- ### Setup Virtual Display for Headless Linux Environments Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/troubleshooting.mdx Configure a virtual display using `xvfb` for copy/paste functionality in headless Linux environments when using OpenCode. ```bash apt install -y xvfb # and run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=:99.0 ``` -------------------------------- ### Running the Slack Bot Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/slack/README.md Use this command to start the Slack bot after configuring your environment variables. Ensure your .env file contains the necessary Slack app credentials. ```bash # Edit .env with your Slack app credentials bun dev ``` -------------------------------- ### Example SKILL.md Frontmatter and Content Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/skills.mdx Demonstrates the required YAML frontmatter and Markdown content for a skill definition. Includes name, description, license, compatibility, and metadata in the frontmatter, followed by a description of what the skill does and when to use it. ```markdown --- name: git-release description: Create consistent releases and changelogs license: MIT compatibility: opencode metadata: audience: maintainers workflow: github --- ## What I do - Draft release notes from merged PRs - Propose a version bump - Provide a copy-pasteable `gh release create` command ## When to use me Use this when you are preparing a tagged release. Ask clarifying questions if the target versioning scheme is unclear. ``` -------------------------------- ### Install Helicone Session Plugin Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/providers.mdx Install the opencode-helicone-session plugin via npm to enable automatic session tracking for OpenCode conversations in Helicone. ```bash npm install -g opencode-helicone-session ``` -------------------------------- ### Run Development Server Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/app/README.md Starts the application in development mode. The app will be accessible at http://localhost:3000 and will hot-reload on file changes. ```bash npm run dev ``` -------------------------------- ### Start ACP Server via Command Line Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/opencode/src/acp/README.md Use this command to start the ACP server in the current directory. You can also specify a different working directory. ```bash opencode acp ``` ```bash opencode acp --cwd /path/to/project ``` -------------------------------- ### Create Opencode Client Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Instantiate a client to connect to a running OpenCode instance. Ensure the baseUrl points to your OpenCode server. ```javascript import { createOpencodeClient } from "@mimo-ai/sdk" const client = createOpencodeClient({ baseUrl: "http://localhost:4096", }) ``` -------------------------------- ### Start OpenCode Server with Password in WSL Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/windows-wsl.mdx Secure your OpenCode server running in WSL by setting a password environment variable before starting the serve command with hostname 0.0.0.0. ```bash OPENCODE_SERVER_PASSWORD=your-password opencode serve --hostname 0.0.0.0 ``` -------------------------------- ### Path Information Retrieval Source: https://github.com/xiaomimimo/mimo-code/blob/main/packages/web/src/content/docs/sdk.mdx Get information about the current path. ```APIDOC ## path.get() ### Description Get information about the current path. ### Method `path.get()` ### Response #### Success Response (200) - (Path) - The current path information. ### Request Example ```javascript const pathInfo = await client.path.get() ``` ```