Guide Overview
Welcome to the Code2Prompt
installation guide. This document provides
step-by-step instructions for installing it on various platforms, including
Windows, macOS, and Linux.
Guide Overview
Welcome to the Code2Prompt
installation guide. This document provides
step-by-step instructions for installing it on various platforms, including
Windows, macOS, and Linux.
TL;DR
# Cargo$ cargo install code2prompt
# Homebrew$ brew install code2prompt
Make sure Rust and cargo are installed on your system.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
This is the official way to install the latest stable version of Rust and Cargo.
Make sure to refresh your PATH
variable after installing Rust. Restart your terminal or run the instructions proposed by the installer.
source $HOME/.cargo/env
You can check that everything is installed correctly by running:
cargo --versiongit --version
# Cargo$ cargo install code2prompt
# Homebrew$ brew install code2prompt
If you want the latest features or fixes before they’re released on crates.io:
cargo install --git https://github.com/mufeedvh/code2prompt
Ideal for developers that want to build from source or contribute to the project.
🛠️ Install Prerequisites :
📥 Clone the repository :
git clone https://github.com/mufeedvh/code2prompt.gitcd code2prompt
📦 Install the binary :
To build and install from source:
cargo install --path crates/code2prompt
To build the binary without installing it:
cargo build --release
The binary will be available in the target/release
directory.
🚀 Run it :
code2prompt --help
Best for users that want to use the latest version without building from source.
Download the latest binary for your OS from Releases.
⚠️ Binary releases may lag behind the latest GitHub version. For cutting-edge features, consider building from source.
Specifically for Arch Linux users, code2prompt
is available in the AUR.
code2prompt
is available in the AUR
. Install it via any AUR helpers.
paru/yay -S code2prompt
If you’re using Nix, you can install it using either nix-env or nix profile.
# without flakes:nix-env -iA nixpkgs.code2prompt# with flakes:nix profile install nixpkgs#code2prompt
You can download the python bindings from Pypi
pip install code2prompt_rs
🛠️ Install Prerequisites :
📥 Clone the repository :
git clone https://github.com/mufeedvh/code2prompt.gitcd code2prompt/crates/code2prompt-python
📦 Install the dependencies :
The rye
command will create a virtual environment and install all the dependencies.
rye sync
⚙️ Build the package :
You will develop the package in the virtual environment located in .venv
folder at the root of the project.
rye run maturin develop -r
The code2prompt
MCP server will soon be available in MCP registries.
The code2prompt
MCP server is still a prototype and will be integrated to the main repository soon.
To run the MCP server, locally to use it with Cline
, Goose
or Aider
:
🛠️ Install Prerequisites :
📥 Clone the repository :
git clone https://github.com/odancona/code2prompt-mcp.gitcd code2prompt-mcp
📦 Install the dependencies :
The rye
command will create a virtual environment and install all the dependencies in the .venv
folder.
rye sync
🚀 Run the server :
The MCP server is now installed. You can run it using:
. .venv/bin/activatepython -m src/code2prompt_mcp/main.py
🔌 Integrate with Agents :
For instance, you can integrate it with Cline
, using a similar configuration:
{ "mcpServers": { "code2prompt": { "command": "bash", "args": [ "-c", "cd /home/olivier/projet/code2prompt-mcp && rye run python /home/olivier/projet/code2prompt-mcp/src/code2prompt_mcp/main.py" ], "env": {} } }}