Getting Started
Getting Started
Section titled “Getting Started”Get up and running with codeknit in under 5 minutes.
1. Prerequisites
Section titled “1. Prerequisites”You’ll need:
- Go 1.26+
- A C compiler (CGo is required for tree-sitter)
2. Installation from source
Section titled “2. Installation from source”git clone https://github.com/awslabs/codeknit.gitcd codeknitmake build# Binary is at ./bin/codeknit3. Add to PATH
Section titled “3. Add to PATH”Add the binary to your shell’s PATH:
# bash (~/.bashrc)export PATH="$PATH:$(pwd)/bin"
# zsh (~/.zshrc)export PATH="$PATH:$(pwd)/bin"
# fish (~/.config/fish/config.fish)fish_add_path $(pwd)/binReload your shell or run source ~/.bashrc (or ~/.zshrc) for the change to take effect.
4. Verify installation
Section titled “4. Verify installation”Check that codeknit is working:
codeknit --version5. First parse
Section titled “5. First parse”Run your first parse on a codebase:
codeknit parse ./myprojectThis command:
- Parses all source files in
./myproject - Extracts structural information (functions, classes, relationships)
- Writes chunked
.sktfiles to./skeleton/(default output directory)
If you re-run this command, use --clean to remove previous output:
codeknit parse ./myproject --clean6. Reading the output
Section titled “6. Reading the output”The .skt files contain structured code information. Here’s a small example:
[symbols]## src/main.goS1 module/package L1-L1 main {}S2 type/struct L5-L8 Server {exported}S3 callable/function L10-L12 NewServer(addr: string) -> *S2 {exported}S4 callable/method L14-L19 Start() {receiver=*Server}
[edges]S2 --contains--> S4S3 --returns--> S2Key sections:
[symbols]: Definitions grouped by file, showing name, line span, and metadata[edges]: Relationships likecontains,calls,inherits, orreturns
7. Next steps
Section titled “7. Next steps”Now that you’ve run your first parse:
- Learn more about the parse command: Parse command guide
- Explore structural analysis: Graph commands guide
- Understand duplicate detection: Fingerprint command guide
- Read the full output format: Output format reference
- See all available flags: CLI flags reference