The LCP host-side 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) is a Python 3 script that manages packages for CrisOS v2 development. It supports searching, installing, removing, upgrading, and verifying packages, as well as managing repository sources. All persistent state is stored under ~/.lcp/ on the host machine; the tool does not interact with a running CrisOS instance.
Global usage:
| Path | Purpose |
|---|---|
~/.lcp/repos.json | List of configured repository sources |
~/.lcp/installed.json | Installed package state and file manifests |
~/.lcp/cache/<name>.json | Cached repository index for each repo named <name> |
The host CLI and the in-kernel LCP share package concepts (names, versions,
dependencies, file lists) but are entirely independent implementations. The
host tool manages a file-system simulation on the development machine;
the in-kernel version parses a
lcp_repo.txt text file from the VFS at
runtime. Neither tool communicates with the other.Exit Codes
Alllcp commands exit with one of the following codes:
| Code | Constant | Meaning |
|---|---|---|
| 0 | EXIT_SUCCESS | Command succeeded |
| 1 | EXIT_ERROR | General error |
| 2 | EXIT_INVALID_COMMAND | Unknown or malformed command |
| 3 | EXIT_NOT_FOUND | Package not found |
| 4 | EXIT_DEP_MISSING | One or more dependencies not found in any repo |
| 5 | EXIT_INSTALL_FAIL | File system error during install or remove |
| 6 | EXIT_PERMISSIONS | Permission denied while writing files |
| 7 | EXIT_REPO_DOWN | Failed to fetch a repository index |
| 8 | EXIT_ALREADY_INSTALLED | Package is already installed (and --force was not passed) |
| 9 | EXIT_CORRUPT | Corrupt repository or package data |
Package Commands
help
Optional. Name of the command to get detailed help for, e.g.
install,
repo, list.search
Substring to search for. Matched against both the package
name and
description fields.info
3 (EXIT_NOT_FOUND) if the package is not found in any enabled repo.
Exact package name to look up.
| Field | Description |
|---|---|
name | Package identifier |
version | Version string |
description | Human-readable summary |
size | Estimated size in bytes |
dependencies | Comma-separated list, or none |
repository | Source repo name |
author | Maintainer name (maintainer field) |
license | SPDX license identifier |
install
--no-deps is set. Installation records the package in ~/.lcp/installed.json and writes stub files under the install root.
Name of the package to install.
Reinstall the package even if it is already recorded as installed. Without
this flag, attempting to reinstall exits with code
8
(EXIT_ALREADY_INSTALLED).Skip dependency resolution. Only the named package itself is installed.
Missing dependencies will not be detected or reported.
Alternate root directory for installing files. Defaults to the current
working directory when omitted. The directory is created if it does not
exist.
| Code | Condition |
|---|---|
| 0 | All packages installed successfully |
| 3 | Package not found in any enabled repo |
| 4 | One or more dependencies not found in any enabled repo |
| 5 | File system error while creating package files |
| 6 | Permission denied while writing to the install root |
| 8 | Package already installed and --force not specified |
remove
~/.lcp/installed.json. Refuses removal if any other currently installed package lists this package as a dependency.
Name of the installed package to remove.
Also delete the package configuration file at
etc/<package>.conf under the
install root, if it exists.| Code | Condition |
|---|---|
| 0 | Package removed successfully |
| 3 | Package is not installed |
| 5 | Another installed package depends on this one, or a file system error occurred |
| 6 | Permission denied while deleting package files |
update
file:// URLs) the latest package index for every enabled repository and stores the results in ~/.lcp/cache/<name>.json. Repositories that fail to fetch are reported individually but do not prevent successful repos from caching.
Returns exit code 0 (EXIT_SUCCESS) if all enabled repos updated successfully, or 7 (EXIT_REPO_DOWN) if any repo failed.
Example:
The default
main repository is a local file:// source pointing to
tools/lcp_main_repo.json in the project tree. No network connection is
required for the default setup.upgrade
., _, and - and compares each segment numerically (as integers) or lexicographically (as strings).
Optional. Name of a specific installed package to upgrade. When omitted, all
upgradable packages are processed.
| Code | Condition |
|---|---|
| 0 | Upgrade(s) applied, or already up to date |
| 3 | Specified package is not installed or not found in repos |
| 5 | File system error during reinstall |
| 6 | Permission denied |
list
--installed behavior.
List packages currently recorded in
~/.lcp/installed.json. This is the
default when no flag is given.List all packages present in the cached repository indexes (enabled repos
only).
List only installed packages for which a newer version is available in the
cached repos.
files
~/.lcp/installed.json. Exits with code 3 if the package is not installed.
Name of an installed package.
depends
package. Checks ~/.lcp/installed.json first; if the package is not installed, falls back to the cached repo index. Prints No dependencies. if the package has none. Exits with code 3 if the package cannot be found in either location.
Name of the package to query (installed or available).
verify
5 (EXIT_INSTALL_FAIL) if files are absent. Exits with code 3 if the package is not installed.
Name of an installed package to check.
clean
~/.lcp/cache/. Does not modify ~/.lcp/installed.json or ~/.lcp/repos.json. Run update afterwards to rebuild the cache.
Example:
Repository Commands
Repository management is handled through therepo subcommand group.
repo list
repo add
~/.lcp/repos.json. The repository is enabled by default. Returns exit code 1 (EXIT_ERROR) if a repo with the same name already exists.
Short identifier for the repository, e.g.
community.URL of the JSON index. May be an HTTP/HTTPS URL or a
file: path.repo remove
~/.lcp/repos.json. Returns exit code 3 (EXIT_NOT_FOUND) if no repo with that name exists.
Name of the repository to remove.
repo enable
enabled flag to true in ~/.lcp/repos.json. Enabled repos are included in update, search, install, and all package queries.
Name of the repository to enable.
repo disable
enabled flag to false. The entry is retained in ~/.lcp/repos.json but ignored by all package operations until re-enabled.
Name of the repository to disable.
In-Kernel LCP vs. Host CLI
How the in-kernel LCP differs from the host tool
How the in-kernel LCP differs from the host tool
The in-kernel LCP (
In-kernel If
src/lcp.c) is a fully separate C implementation that runs inside CrisOS v2 at runtime. It is invoked from the shell with lcp <subcommand>.Key differences:| Aspect | Host CLI (tools/lcp.py) | In-Kernel (src/lcp.c) |
|---|---|---|
| Language | Python 3 | C (i386 kernel-mode) |
| Repo format | JSON (lcp_main_repo.json) | lcp_repo.txt — custom line-oriented text format |
| Repo source | HTTP/HTTPS or file:// | VFS path lcp_repo.txt; falls back to compiled-in defaults |
| Persistence | ~/.lcp/installed.json on host | In-memory lcp_package_t array; state is lost on reboot |
| Supported subcommands | Full set (see above) | help, search, info, list, install, remove, update, upgrade, files, depends, verify |
list flags | --installed, --available, --upgradable | --installed, --available only (--upgradable is not dispatched) |
install flags | --force, --no-deps, --root <path> | --no-deps only (--force and --root are not supported) |
remove flags | --purge | --purge |
--root option | Supported | Not applicable |
| Dependency resolution | Full topological sort | Recursive install of known packages; no version comparison |
| Exit codes | Detailed (0–9) | Always returns 0; errors printed to console |
| Max packages | Unlimited (heap) | 16 (MAX_PACKAGES) |
lcp_repo.txt format:The in-kernel parser reads a plain-text stanza file. Each package is a block of key: value lines separated by --- on its own line:lcp_repo.txt is absent from the VFS, the kernel falls back to a compiled-in default set of five packages: nano-cris, editor-lite, textpad, libc, and termcap.