LCP (Lightweight CrisOS Packager) ships in two forms: a Python 3 CLI (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CRISTOP-bot/cris-os-v2/llms.txt
Use this file to discover all available pages before exploring further.
tools/lcp.py) for host-side package management during development, and an in-kernel C implementation (src/lcp.c) accessible via the lcp shell command at runtime. Both modes share the same package metadata format and the same five packages in the default main repository, so workflows familiar from one mode translate directly to the other.
Architecture
Host CLI (tools/lcp.py)
Full-featured Python 3 tool. Manages a persistent state directory at
~/.lcp/, supports remote and local repositories, version comparison, dependency resolution, and a package cache. Runs entirely on your development machine — no OS boot required.In-Kernel (src/lcp.c)
Lightweight C implementation compiled directly into the CrisOS kernel. Reads
lcp_repo.txt from the CRFS rootfs at boot, parses packages into an in-memory table, and exposes the lcp shell command. State is volatile — it resets on every reboot.Host CLI storage
The host CLI keeps all persistent data under~/.lcp/:
| Path | Purpose |
|---|---|
~/.lcp/repos.json | List of configured repositories (name, URL, enabled flag) |
~/.lcp/installed.json | Installed package records and held packages |
~/.lcp/cache/ | Per-repo cached index files downloaded by lcp update |
In-kernel repo loading
At boot,lcp_init() attempts to open lcp_repo.txt from the VFS. If the file is found and parses correctly, it becomes the live package database. If the file is missing or malformed, the kernel falls back to a hardcoded copy of the same five packages compiled into src/lcp.c. The in-kernel implementation supports up to 16 packages, 8 dependencies per package, and 8 files per package.
Package format
JSON (host CLI)
The host CLI reads and caches repository indexes as JSON. Each package entry inlcp_main_repo.json contains:
| Field | Type | Description |
|---|---|---|
name | string | Unique package identifier |
version | string | Semantic version string (e.g. 1.0.0) |
description | string | Short human-readable description |
arch | string | Target architecture (always i386 for CrisOS v2) |
maintainer | string | Package author or team |
license | string | SPDX license identifier |
dependencies | array | Names of required packages |
files | array | Relative paths installed by the package |
size | integer | Package size in bytes |
tools/lcp_main_repo.json:
Text format (in-kernel lcp_repo.txt)
The in-kernel parser reads a plain-text format where each package is a block of key:value lines separated by ---:
Available packages
| Package | Version | Description | License | Dependencies |
|---|---|---|---|---|
editor-lite | 0.5.0 | Lightweight text editor for CrisOS | MIT | — |
nano-cris | 1.0.0 | Simple text editor for CrisOS | MIT | libc, termcap |
textpad | 0.9.1 | Terminal-based text editor for CrisOS | Apache-2.0 | libc |
libc | 1.0.0 | Minimal standard library for CrisOS | MIT | — |
termcap | 1.2.3 | Terminal compatibility library for CrisOS | BSD-2-Clause | — |
Host CLI usage
Runpython tools/lcp.py <command> [args] from the repository root. All commands require tools/lcp_main_repo.json to be present alongside lcp.py (the default main repo uses a file: URL that resolves relative to the script directory).
help — print command reference
help — print command reference
search — find packages by keyword
search — find packages by keyword
info — show package metadata
info — show package metadata
name, version, description, size, dependencies, repository, author, and license for the named package.install — install a package
install — install a package
--force to reinstall an already-installed package. Use --no-deps to install only the named package without pulling in dependencies. Use --root <path> to install into a directory other than the current working directory.remove — uninstall a package
remove — uninstall a package
--purge, also deletes etc/<package>.conf if present.update — refresh repository metadata
update — refresh repository metadata
~/.lcp/cache/<name>.json. Run this before install or upgrade to pick up new package versions.upgrade — upgrade installed packages
upgrade — upgrade installed packages
list — list packages by state
list — list packages by state
files — show files owned by a package
files — show files owned by a package
depends — show package dependencies
depends — show package dependencies
verify — check installed package integrity
verify — check installed package integrity
5 (EXIT_INSTALL_FAIL) if any files are missing.clean — clear cached repository data
clean — clear cached repository data
~/.lcp/cache/. Run lcp update afterwards to rebuild the cache from scratch.Repository management
Enable or disable a repository
update, search, and install.main and points to the local JSON file:
The default repo URL uses a
file: scheme pointing to tools/lcp_main_repo.json relative to the script directory. To use a remote repository, add it with python tools/lcp.py repo add <name> https://... and run python tools/lcp.py update to cache its index.Exit codes
| Code | Constant | Meaning |
|---|---|---|
0 | EXIT_SUCCESS | Operation completed successfully |
1 | EXIT_ERROR | Generic error |
2 | EXIT_INVALID_COMMAND | Unknown or malformed command |
3 | EXIT_NOT_FOUND | Package not found in any repository or installed database |
4 | EXIT_DEP_MISSING | One or more dependencies could not be resolved |
5 | EXIT_INSTALL_FAIL | Install write failed, remove blocked by dependents, or verify found missing files |
6 | EXIT_PERMISSIONS | Insufficient filesystem permissions |
7 | EXIT_REPO_DOWN | Repository fetch failed (network or file not found) |
8 | EXIT_ALREADY_INSTALLED | Package is already installed (use --force to override) |
9 | EXIT_CORRUPT | Repository index or installed database is malformed |
In-kernel lcp command
Inside a running CrisOS v2 shell, the lcp command is dispatched to lcp_handle_command() in src/lcp.c. The in-kernel implementation exposes the following subcommands, as dispatched in lcp_handle_command():
| Command | Description |
|---|---|
lcp help | Print available commands |
lcp list | List installed packages (default) |
lcp list --available | List all packages from the repo |
lcp list --installed | List only installed packages |
lcp search <term> | Case-insensitive search across names and descriptions |
lcp info <pkg> | Show metadata for a package |
lcp install <pkg> | Mark a package as installed; auto-installs dependencies |
lcp install --no-deps <pkg> | Install without resolving dependencies |
lcp remove <pkg> | Mark a package as uninstalled |
lcp remove --purge <pkg> | Remove and note purge of configuration |
lcp update | Re-parse lcp_repo.txt from the VFS |
lcp upgrade [pkg] | Mark installed packages as upgraded |
lcp files <pkg> | List files associated with a package |
lcp depends <pkg> | Print dependencies for a package |
lcp verify <pkg> | Confirm package is installed and healthy |