Skip to content

Installation

codeknit can be installed from source. The following steps will guide you through setting up codeknit on your system.

The primary installation method is building from source. You’ll need:

  • Go 1.26+
  • A C compiler (required for tree-sitter via CGo)

Clone the repository and build the binary:

Terminal window
git clone https://github.com/awslabs/codeknit.git
cd codeknit
make build

The compiled binary will be available at ./bin/codeknit.

To run codeknit from any directory, add the binary location to your system’s PATH.

For bash (~/.bashrc):

Terminal window
export PATH="$PATH:/path/to/codeknit"

For zsh (~/.zshrc):

Terminal window
export PATH="$PATH:/path/to/codeknit"

For fish (~/.config/fish/config.fish):

Terminal window
fish_add_path /path/to/codeknit

After updating your shell configuration, reload it by running source ~/.bashrc (or ~/.zshrc) or restart your terminal.

codeknit supports auto-completion for popular shells. Install completions using these commands:

For bash:

Terminal window
codeknit completion bash >> ~/.bashrc

For zsh:

Terminal window
codeknit completion zsh >> ~/.zshrc

For fish:

Terminal window
codeknit completion fish > ~/.config/fish/completions/codeknit.fish

For PowerShell:

Terminal window
codeknit completion powershell >> $PROFILE

After installation, verify codeknit is correctly set up:

Terminal window
codeknit --version

If you’re contributing to codeknit, run these additional commands:

Install development dependencies:

Terminal window
make deps

Set up git hooks:

Terminal window
make setup

Run the test suite:

Terminal window
make test