Installation¶
KNL supports multiple installation modes and formats for maximum flexibility.
Requirements¶
Source Installation (Default)¶
- Python 3.8+ for installer (uses only stdlib)
- Python 3.14+ for KNL itself (uses modern Python features)
- UV (Python package manager - installer can install it for you)
- Git repository (optional, but recommended)
Compiled Binary Installation (Portable)¶
- Python 3.8+ to run the compiled binary
- Git repository (optional, but recommended)
- No UV or virtual environment needed
Installation Modes¶
Repo-Local Installation (Default)¶
When running the installer inside a git repository, KNL installs to .knl/ in the current directory. This keeps KNL isolated per project.
Benefits:
- Each repository has its own isolated KNL installation
- No PATH pollution
- Easy to version-control KNL version per project
- Minimal impact on repository (only
.knl/and.knowledge/folders)
After installation:
# Add to PATH for this session
export PATH="$(pwd)/.knl/bin:$PATH"
# Or add to your shell config for persistence
echo 'export PATH="$(pwd)/.knl/bin:$PATH"' >> ~/.bashrc
User-Local Installation¶
For system-wide installation, use the --user-local flag or run outside a git repository:
This installs KNL to ~/.local/knl/ and automatically adds it to your PATH.
Benefits:
- Available globally across all projects
- Only need to install once
- Automatically added to PATH
Compiled Binary Installation¶
For maximum portability and minimal dependencies:
# Install latest compiled binary (requires only Python 3.8+)
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --compiled
# Install specific version
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --compiled --version v1.2.0
# Install from local binary (for offline/airgapped environments)
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --compiled --binary-path /path/to/knl.pyz
# User-local compiled installation
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --compiled --user-local
Benefits:
- Portable - Single ~52MB self-contained file
- Minimal Requirements - Only Python 3.8+ needed (vs 3.14+ for source)
- No Dependencies - No UV or virtual environment required
- Fast Deployment - Perfect for CI/CD and distribution
- Offline Ready - Use
--binary-pathfor airgapped environments
Version Management¶
Install specific versions or refs:
# Install specific version (source)
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --version v1.2.0
# Install from branch or tag
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --ref develop
# Install from custom repo
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --repo yourname/knl
# Combine options (compiled + version + user-local)
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --compiled --version v1.2.0 --user-local
What the Installer Does¶
The installer is smart and adapts based on installation mode:
Source Installation (Default)¶
- Find Python 3.8+ to run the installer itself (uses only stdlib)
- Find Python 3.14+ for KNL from PATH and common locations:
- User installations (
~/.local,~/bin) - pyenv installations (
~/.pyenv/versions/) - Homebrew (macOS:
/opt/homebrew,/usr/local) - Conda/Miniconda environments
- System installations
- Detect git repository and choose appropriate installation location
- Install UV if needed (prompts if not found)
- Create isolated virtual environment for KNL
- Install KNL and dependencies using the detected Python
- Create wrapper scripts (
knlandkdtalias) - Deploy knowledge crumbs - curated development knowledge
- Update
.gitignore(repo-local only) - Create initial configuration in
~/.cache/knl/(XDG-compliant)
Compiled Binary Installation (--compiled)¶
- Find Python 3.8+ to run the binary (less restrictive than source)
- Download or copy binary:
- Downloads from GitHub releases (if
--versionspecified) - Copies from local path (if
--binary-pathspecified) - Uses latest release (if neither specified)
- Install binary to appropriate location
- Create wrapper scripts (
knlandkdtalias) - Deploy knowledge crumbs - curated development knowledge
- Update
.gitignore(repo-local only) - Create initial configuration
Knowledge Crumbs Deployment¶
Both installation modes deploy knowledge crumbs - curated, reusable development knowledge:
- Organized by category: DevOps, Testing, Security, Development
- LLM-friendly format with YAML frontmatter
- Self-contained, actionable guides
- Located in
<install-dir>/know-how/crumbs/
Example crumbs:
- devops/github-pages-setup.md - GitHub Pages deployment guide
- More crumbs added with each release
No sudo required
All installation happens in user directories. No root privileges needed.
Manual Installation¶
# Clone the repository
git clone https://github.com/akaliazin/knl.git
cd knl
# Option 1: Run the installer (recommended)
./install.sh
# Option 2: Install with UV directly
uv pip install -e .
# Option 3: Build and install compiled binary
make build-binary
./install.sh --compiled --binary-path ./dist/knl.pyz
Building Compiled Binary¶
To create your own compiled binary:
# Install shiv if not already installed
uv pip install shiv
# Build binary (creates dist/knl.pyz)
make build-binary
# Test the binary
./dist/knl.pyz --version
# Install from local binary
./install.sh --compiled --binary-path ./dist/knl.pyz
Verifying Installation¶
# Check KNL version
knl --version
# Check installation location
which knl
# View help
knl --help
# Browse available knowledge crumbs
ls ~/.local/knl/know-how/crumbs/ # for user-local
ls .knl/know-how/crumbs/ # for repo-local
# Read a crumb
cat ~/.local/knl/know-how/crumbs/devops/github-pages-setup.md
Upgrading¶
To upgrade KNL to the latest version:
# For repo-local installation
cd your-repo
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh
# For user-local installation
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh -s -- --user-local
Uninstalling¶
Repo-Local Installation¶
User-Local Installation¶
Global Configuration¶
Troubleshooting¶
Python Not Found¶
If the installer can't find Python 3.14+, it will guide you through installation options:
- pyenv (recommended for Linux/macOS)
- Homebrew (macOS)
- python.org installer
- Build from source
- Miniconda
UV Installation Fails¶
If UV installation fails:
# Install UV manually
curl -LsSf https://astral.sh/uv/install.sh | sh
# Then run KNL installer again
curl -LsSf https://akaliazin.github.io/knl/install.sh | sh
Permission Denied¶
If you get permission errors:
- Make sure you're not using
sudo- it's not needed - Check that your user has write permissions to the installation directory
- For repo-local: Make sure you own the repository directory
Next Steps¶
- Quick Start Guide - Learn how to use KNL
- Configuration - Customize KNL settings
- Task Management - Create and manage tasks