> ## Documentation Index
> Fetch the complete documentation index at: https://koharu.rs/llms.txt
> Use this file to discover all available pages before exploring further.

# Development setup

> Run the desktop app, choose a focused check, and regenerate derived bindings.

## Prerequisites

Koharu is developed against Rust 1.97.1 with the 2024 edition, Bun 1.3.14, and LLVM 22.1.8. The repository does not pin these versions. LLVM supplies the libclang that the `-sys` crates' bindings are generated with; the native libraries themselves are prebuilt packages downloaded at runtime, so no C++ build system is required.

> [tab] Windows
>
> Install the MSVC C/C++ build tools for native dependencies.

> [tab] Linux
>
> Install the packages the CI workflow uses: `build-essential`, `libgtk-4-dev`, `libxdo-dev`,
> `libssl-dev`, `libayatana-appindicator3-dev`, and `librsvg2-dev`. Tests also need
> `fonts-noto-cjk`, `dbus-x11`, and `gnome-keyring`.

> [tab] macOS
>
> Install the platform C/C++ development tools, and add the Rust targets CEF's helper processes
> build for: `rustup target add aarch64-apple-darwin x86_64-apple-darwin`.

## Start development

```bash theme={null}
git clone https://github.com/koharu-rs/koharu.git
cd koharu
bun install
bun dev
```

`bun install` also installs the Tauri CLI at the revision the workspace uses, with `cargo install`. `bun dev` runs `cargo tauri dev`, which starts the Next.js interface on port 3000 and the desktop app, and downloads CEF on the first build. Debug builds expose CEF remote debugging at `http://127.0.0.1:4000`.

> [!NOTE]
>
> The Tauri CLI sets `CEF_PATH` for the builds it runs. Plain `cargo` commands on crates that link
> CEF, such as `koharu` and `koharu-desktop`, need it set to the same folder, `tauri-cef` under the
> operating system's cache folder, or they download CEF again and rebuild it. On Windows that is
> `%LOCALAPPDATA%\tauri-cef`.

## Check the affected component

Run the smallest relevant debug check or focused test once. For example:

```bash theme={null}
cargo check -p koharu
cargo test -p koharu-pipeline <test_name>
cargo fmt --all --check
```

For interface work, `bun run test` runs the interface's Vitest suite and `bun run lint` runs its linter. `bun run check` checks formatting across the repository's TypeScript and JSON.

> [!NOTE]
>
> Do not run full suites, non-debug profiles, or end-to-end tests by default. Run them only when
> explicitly requested.

## Regenerate IPC bindings

Rust command signatures and their Specta types are authoritative:

```bash theme={null}
cargo run -p koharu-desktop --bin ipc
bun run format
```

Do not hand-edit `packages/ipc/src/protocol.ts`.

## Build an executable

When you need a release executable, `bun run build` runs `cargo tauri build --no-bundle` and writes to `target/release`. Installer packaging belongs to the release workflow.

> [card] [Work on the documentation](https://koharu.rs/development/documentation.md)
>
> Preview Mintlify and maintain the English, Japanese, and Chinese documentation.


## Related topics

- [Contribute to Koharu](https://koharu.rs/development/contributing.md)
- [Install Koharu](https://koharu.rs/installation.md)
- [Write and publish docs](https://koharu.rs/development/documentation.md)
- [Set up Koharu Agent](https://koharu.rs/agent/setup.md)
- [Architecture](https://koharu.rs/development/architecture.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.