OpenLoreDocumentationGitHub ↗
Browse documentation
ReferenceOpenLore / Manual

Command Reference

On this page

OpenLore implements a bash-like command language over its virtual filesystem. Run help in a session for the command list available on that server.

Interactive SSH sessions support Tab completion for permitted command names, registered lore subcommands, and virtual filesystem paths. The first Tab extends a shared prefix; a second Tab lists matching candidates in columns. Directories retain a trailing /, hidden entries appear only after an explicit ., and candidate layout follows terminal resize events.

Filesystem

CommandDescription
lsList directory contents (-l, -a, -R, -S, -t, -F, -1, -h, -d)
catDisplay file contents (-n, -A)
headFirst N lines or bytes (-n N, -c N)
tailLast N lines or bytes (-n N, -c N, +N)
treeDirectory tree visualization (-L depth, -a, -d, -f)
statFile metadata
wcCount lines, words, bytes (-l, -w, -c, -m)
duEstimate file space usage (-a, -h, -s, -c)
diffCompare two files (-u, -q)
cd / pwdNavigate the virtual filesystem
CommandDescription
grepSearch patterns (-i, -n, -r, -v, -c, -l, -o, -L, -w, -x, -m)
findFind files (-name, -type f|d)

Text processing

CommandDescription
sortSort lines (-r, -n, -u, -f, -k N, -t SEP)
uniqFilter duplicate lines (-c, -d, -i, -u)
cutSelect fields or characters (-d DEL, -f FIELDS, -c CHARS, -s)
sedStream editor (-n, -e, s/pat/repl/flags, -i); replacement text supports \n (newline), \t (tab), \\ (backslash), escaped delimiters, and backslash-newline continuations
awkPattern scanning (-F SEP, -v VAR=VAL)
trTranslate characters (-d, -s, -c)
rev / tacReverse characters per line / reverse line order
nlNumber lines (-b, -n, -w, -s)
foldWrap lines (-w N, -s)
pasteMerge file lines (-d DEL, -s)
columnColumnate lists (-t, -s SEP)
joinJoin sorted files (-1, -2, -t)
commCompare sorted files (-1, -2, -3)
expand / unexpandConvert tabs and spaces (-t N, -a)

Data and utilities

CommandDescription
jqJSON processing (-r, -c, -e, -s, select, map, sort_by, add, length, and more)
xargsBuild commands from stdin (-I REPL, -d DEL, -n N, -0)
seqPrint a number sequence (-s SEP, -w)
printfFormat and print data
dateDisplay date/time (-u, +FORMAT)
basename / dirnameStrip directory or filename components
teePass stdin through to stdout or a writable file
base64Base64 encode/decode (-d)
md5sum / sha1sum / sha256sumCompute checksums (-c)
exprEvaluate arithmetic expressions
which / typeLocate or identify a command
time / timeoutTime a command or run with a timeout
whoami / hostnamePrint identity or host information
true / falseExit with status 0 / 1
sleep / clearSleep (stub) / clear screen
commandRun or locate a command (-v)
versionPrint the OpenLore version

Shell builtins

CommandDescription
echoPrint text (-n, -e)
export / unsetSet or remove variables
env / printenvPrint the environment
setSet or list shell variables (--)
test / [ / [[Conditional tests
readRead stdin (-p, -r, -a, -d, -n)
source / .Execute commands from a VFS file
evalEvaluate a command string
helpShow available commands
skillsList available skill commands
exit / quitClose the session

Writes and publishing

These commands are available only where configuration and identity grants permit them.

CommandDescription
write / > / >>Overwrite or append to a file
teeWrite stdin to a file while returning it
patchApply a unified diff atomically
sed -iEdit a file atomically
mkdirCreate a directory (-p for parents)
mvMove a file
rmRemove a file or tree (-r)
publishPublish stdin into a docset inbox
approveApprove a pending changeset when authorized
spawnRun configured external work asynchronously when explicitly trusted

Introspection

CommandDescription
loreIntrospection dispatcher
lore docsetsList accessible docsets, grants, paths, and attributes
lore meta [path]Emit document frontmatter as NDJSON, scoped to the current directory or path
lore meta --filter skills [path]Discover Agent Skills collections without scanning unrelated docs
lore package list / lore package doc <path>List compiled-in rule members or show a member’s parameters and example
lore validate [dir]Run folder rules over a docset or folder: file rules per file, bundle rules (OKF bundle structure, local links, alias portability) once at the root
lore size baseline <path>Show a file’s size-baseline history and current cap under max: initial rules
lore size baseline reset <path> [--note <text>]Append a new baseline from the file’s current content; needs a write grant on the path and a config.edit role

See Folder rules for the rules model. lore validate refuses to run from a directory above docsets that declare bundle rules (run lore validate per docset); name the docset or folder instead.

Example lore size baseline output:

/docs/backend/decisions/adr-001.md  (size/lines via adr-length @ /docs/backend/.lore/config.yaml, growth 1.1)
  2026-08-30T09:12:04Z  create      agent:claude@acme.com   412 lines  12 KiB  3900 tokens (estimate/v1)
  2026-09-02T14:01:37Z  reset       adil                    812 lines  21 KiB  6400 tokens (estimate/v1)  "ADR grew after review"
current cap: 893 lines

A file with no history prints no baseline recorded. A reset prints the previous and new baseline and the resulting cap, and is also recorded in the server audit log as rules.baseline.reset:

baseline reset: previous 412, new 812, new cap 893 lines

Skills management

These commands require plugins.skills.enabled: true. Mutating commands also require a named rw grant on the destination docset.

CommandDescription
skills status [folder]Report collection state and linked remote skills as NDJSON
skills enable [folder]Enable recursive Skills collection behavior
skills disable [folder]Disable collection behavior without deleting skills
skills validate [scope]Validate accessible Skills collections
skills import <github-spec> [parent-dir]Import and link a public GitHub skill
skills update [skill-folder]Force an imported skill to check and apply its remote
skills remove-remote [skill-folder]Keep imported files but stop tracking GitHub

Run bare skills for GitHub spec syntax, automatic branch tracking, pinning, and collection recovery.

Discover installed skills with the skills metadata filter, then read the chosen SKILL.md:

lore meta --filter skills | jq -r 'select((.name + " " + .description) | test("pdf"; "i")) | .path'

Example lore docsets output:

DOCSET    GRANTS      ATTRIBUTES   PATH             TARGET
public    ro          -            /docs/public     -
backend   publish,rw  inbox        /docs/backend    -
home      rw          home         /home/backend    -
home      rw          alias        /backend         /home/backend

GRANTS contains ro, publish, rw, or plugin-defined grants. ATTRIBUTES may include home, inbox, and alias; aliases point to their canonical path in TARGET.

Shell syntax

FeatureExample
Pipesgrep pattern file | sort | head -5
AND / ORtest -f x && echo yes || echo no
Semicolonsecho a; echo b
Subshells(echo a; echo b)
For loopsfor x in a b c; do echo $x; done
If/elseif test -f x; then cat x; else echo missing; fi
While/untilwhile test $i -lt 5; do echo $i; i=$(expr $i + 1); done
VariablesFOO=bar; echo $FOO
Expansion${VAR:-default}, ${VAR:+alt}, ${#VAR}, $(cmd)
QuotingSingle quotes are literal; double quotes allow expansion
GlobbingUnquoted * and ? patterns expand; bare relative patterns use the current directory, and absolute and ./ forms are supported. Quote patterns to pass them literally
Negation! false returns 0

Intentionally unsupported

A normal session cannot invoke cp, chmod, wget, curl, bash -c, or exec. The shell is an interpreter, not a real bash process. The write surface is limited to the whole-file operations listed above; there are no streaming, partial, or offset writes.

OpenLore CLI

Usage: openlore [command] [flags] [directory]

Commands:
  version           Print version
  export -o <dir>   Export embedded docs to a directory
  mcp [dir]         Run an MCP server over stdio
  mcpb [-o file]    Package the binary as an MCPB desktop extension
  identity add      Add an identity or public key to lore.json
  identity role     Add or remove an identity's role membership
  role              Manage roles, docset grants, denies, and capabilities
  token mint        Mint an access token for an identity
  token verify      Verify an access token and print its claims

Flags:
  -p, --port           SSH server port (default 2222)
  --http-port          HTTP port (default 8080, 0 to disable)
  --mcp-path           MCP-over-HTTP path (default /mcp)
  --metrics-port       Prometheus metrics port (default 3000, 0 to disable)
  --host-key           Host key path (default .ssh/openlore_ed25519)
  --motd               Inline MOTD
  --motd-file          MOTD file
  --auth               Path to lore.json
  -c, --config         Config path (default ./openlore.yml)
  --allowed            Comma-separated allowed file patterns
  --ignore             Comma-separated ignored patterns
  --tls-cert           HTTP TLS certificate
  --tls-key            HTTP TLS key
  --ca-keys            Trusted CA public keys for SSH certificate auth
  --host-cert          CA-signed SSH host certificate
  --skills-dir         Runtime skills directory
  --readonly           Global write lock (default true; use --readonly=false to enable writes)
  --debug              Enable debug-level server logging

Run openlore --help or a subcommand with --help for its current flags.

Edit this page on GitHub ↗Source: docs/commands.md

Search the manual

Search the project documentation. No external service.