keneil

KSL — Keneil Shell Language

keneil alpha.1 · accepted direction

KSL composes a context the way a shell composes a pipeline — but it does not stream bytes and does not execute system commands. It builds a working set: a set of files, digests, and context windows, ready to be sent to a local model.

Mental model

Every KSL line has three optional stages:

  1. select
  2. transform
  3. ask
@{src/router.js, src/api.js} | digest | ask "How are routes connected to handlers?"
select

@{...} Selects files for the current pipeline

transform

digest Builds a structural index of each file

ask

ask Sends the prepared context to the local model

Works now

Implemented in keneil alpha.1

Selectors

@src/file.js

Select a single file

@{file1, file2}

Select multiple files

@loaded

Select all files currently loaded

!@{file}

Exclude file(s) from set

Actions

load

Add files to context

focus

Set as active set

untrack

Remove from context

digest

Build structural index

context

Dry-run inspection

ask

Send to Ollama

Recipes

Common patterns

Compare two files

@{src/auth.js, src/session.js} | digest | ask "What does each file own?"

Compare ownership and patterns across related files.

Digest multiple files

@{src/router.js, src/api.js, src/db.js} | digest

Prepare the structural index for the core stack.

Remove a file from working set

@{src/config.js} | untrack

Stop tracking sensitive or irrelevant configuration files.

Inspect what gets sent to the model

@loaded | context

Inspect the current selected working set.

Exclude a file temporarily

@loaded !@{src/secrets.js} | ask "What does this codebase expose?"

Analyze the full set while masking specific sensitive paths.

Coming soon

Glob patterns

PLANNED
@{src/**/*.js} | digest | ask "Summarize the architecture"

Project-wide analysis

PLANNED
@{*} | !@{bin/**} | digest | ask "Explain the project"

Glob patterns and wildcard selectors are a future target. The core pipeline syntax (@, |, !, actions) is stable.