Skip to content

Quick Start ​

Editor Plugins ​

clice implements the Language Server Protocol. Any editor that supports this protocol can work with clice to provide features like code completion, diagnostics, hover, semantic highlighting, and more.

Beyond the standard protocol, clice also supports some protocol extensions. For better integration, using a dedicated clice plugin is recommended.

See Editor Setup for per-editor instructions: official plugins for Visual Studio Code, Neovim and Zed, plus configuration snippets for editors with generic LSP clients (Helix, Emacs, Sublime Text, Kate, Vim).

Installation ​

Download Prebuilt Binary ​

Download the latest binary from the Releases page.

Build from Source ​

See build from source for detailed instructions.

Project Setup ​

For clice to correctly understand your code (e.g., find header file locations), you need to provide a compile_commands.json file, also known as a compilation database. The compilation database provides compilation options for each source file.

By default, clice loads every compile_commands.json in your workspace root and its immediate subdirectories (e.g. build/), and the ones above a file when you open it — a nested project's database loads the first time one of its files is opened. This discovery is off as soon as any rule declares a source, a database or a default_command alike. You can name the databases explicitly with the compile_commands option in clice.toml, and describe files that have no database entry with a rule's default_command.

CMake ​

Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON during configuration:

shell
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

This generates compile_commands.json in the build directory.

WARNING

This option only works with Makefile and Ninja generators. For other generators (e.g., Visual Studio), use an alternative approach below.

Bazel ​

Use bazel-compile-commands-extractor:

bash
bazel run @hedron_compile_commands//:refresh_all

Visual Studio ​

For CMake projects in Visual Studio (2019 16.1+), configure in CMakeSettings.json:

json
{
  "configurations": [
    {
      "name": "x64-Debug",
      "generator": "Ninja",
      "buildRoot": "${projectDir}\\build",
      "cmakeCommandArgs": "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
    }
  ]
}

For MSBuild projects (.vcxproj), use catter to generate the compilation database.

Makefile ​

Use bear to intercept compilation commands:

bash
bear -- make

Run make clean before bear -- make to ensure all commands are captured.

Meson ​

Meson generates a compilation database automatically:

bash
meson setup build

Xmake ​

bash
xmake project -k compile_commands --lsp=clangd build

Or configure the Xmake VS Code extension to auto-generate:

json
"xmake.compileCommandsDirectory": "build"

Others ​

For any other build system, use catter — a fake-compiler approach that works with any build system.

Pre-build the Index (Optional) ​

Background indexing starts automatically when you open the project in an editor. For large projects you can also build the index ahead of time from the command line:

bash
clice index --workspace /path/to/project

The run is resumable — interrupting it with Ctrl-C saves progress, and the next invocation continues where it left off instead of starting over. clice index --stats prints what the persisted index currently contains.