Skip to content
acervPublic

About

AI harness for daily coding and studying, with a fully configurable sandbox.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

K-Luis logo

K-Luis

AI harness for daily coding and studying, with a fully configurable sandbox.

CI License: GPL-3.0 Platform: Linux

Why K-Luis

K-Luis is a mature harness for a daily coding and studying workflow. It is small and focused on security, but not limited: it guides you towards your goals instead of only running commands.

  • A strong native sandbox, on by default.
  • Bundled skills that help you write better code and think more critically.
  • The tools a coding agent needs: read, search and edit files, run commands, search the web, fetch pages, and ask you questions. See Tools.
  • One short config file, and an option for each setting. See Bundled skills.
  • A terminal UI with sessions, diffs, model switching and streaming replies.
  • Any provider supported by genai, plus a Claude subscription login.

K-Luis does neither. Commands run in a hakoniwa container, and:

  • You choose which folders and ports the model can touch.
  • .git stays read-only, so hooks and config cannot run code as you.
  • Your home directory is hidden, unless you expose folders explicitly.
  • API keys and ~/.kluis are never exposed to the sandbox.
  • There is no network unless you allow it: all of it, only some TCP ports, or only some hosts, through a proxy. web_fetch can be limited to a list of hosts.

A malicious instruction in a file or web page can only affect the folders you gave the model. See Sandbox for the details and the limits.

Install

K-Luis needs Linux and a recent stable Rust toolchain. Allowing individual TCP ports needs Linux 6.7 or later. On Ubuntu 23.10 and later, AppArmor needs a one-time setup: kl prints the commands, see Ubuntu.

cargo install --path harness-tui
export DEEPSEEK_API_KEY="sk-..."

Usage

kl "fix the typo in README.md"   # one task, one command
git diff | kl -p "review this"   # stdin appended to the prompt
kl --output-format json "list the TODOs"  # result, usage and session as JSON
kl --output-format stream "fix the tests" # one JSON line per event, then the result
kl --output-schema todo.json "list the TODOs"  # a JSON value matching a JSON Schema
kl                               # interactive chat, Ctrl-D to quit
kl --login anthropic             # use a Claude subscription instead
kl --install-skills              # install the skills that come with kl
kl --resume                      # continue a previous session
kl --resume --fork               # try another direction in a copy of it
kl --strict                      # make the project read-only
kl --sandbox-info                # show what commands can see and reach
kl --no-sandbox                  # run tools on the host

Settings live in ~/.kluis/config.toml:

[generic]
model = "ollama::qwen2.5-coder"   # a local model, no API key needed
thinking = "medium"               # default, off, low, medium, high, xhigh or max
theme = "light"                   # colors for a light terminal (default: dark)
code_theme = "solarized-dark"     # colors of code blocks

[sandbox]
read = ["~/.cargo", "~/.rustup"]  # extra folders the model can read; $HOME is empty otherwise
write = ["~/scratch"]             # extra folders the model can change
deny = ["~/work/secrets"]         # folders to hide
connect = [5432]                  # TCP ports commands can reach, e.g. a local PostgreSQL
max_memory = "4G"                 # memory limit per command

All settings are listed in Configuration.

Local and remote models

Every provider in ~/.kluis/auth.toml is available at the same time. Add a local Ollama server next to a remote provider:

[deepseek]
api_key = "sk-..."

[ollama]
endpoint = "http://localhost:11434"

Then pick the model per run, or switch inside a chat with /model:

kl --model ollama::qwen2.5-coder "explain this function"   # local
kl --model deepseek-flash "refactor the parser"             # remote

Security model

The sandbox limits what commands can read, write and connect to. It cannot vet what the model writes: build scripts, Makefiles, .cargo/config.toml, package.json scripts and editor settings run as you when you build, test or open the project. Review the changes like any patch.

Your own git, outside the sandbox, also runs repository hooks. See Sandbox for how to turn them off.

Documentation

  • Configuration: settings, options, environment variables and API keys
  • Sandbox: what is isolated, what is not, and git safety
  • Features: agent, tools and terminal UI
  • Architecture: crates, process model and design choices
  • Roadmap: planned features

License

GPL-3.0-or-later. See LICENSE.

About

AI harness for daily coding and studying, with a fully configurable sandbox.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages