Skip to content

Cudane/MCX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 __  __  ______  __  ____            _                      __  __                                   
|  \/  |/ ___\ \/ / |  _ \ __ _  ___| | ____ _  __ _  ___  |  \/  | __ _ _ __   __ _  __ _  ___ _ __ 
| |\/| | |    \  /  | |_) / _` |/ __| |/ / _` |/ _` |/ _ \ | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
| |  | | |___ /  \  |  __/ (_| | (__|   < (_| | (_| |  __/ | |  | | (_| | | | | (_| | (_| |  __/ |   
|_|  |_|\____/_/\_\ |_|   \__,_|\___|_|\_\__,_|\__, |\___| |_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|   
                                               |___/                                 |___/           

MCX is a Rust-based package manager engine for Cudane Linux. It manages package installation, removal, dependency resolution, system profile reconciliation, and repository metadata using a lightweight JSON-backed state layer and async networking, provides a neutral package lifecycle runtime for Cudane Linux by:

  • resolving package dependencies with a topological solver
  • downloading package archives over HTTP
  • verifying archive integrity before installation
  • staging and extracting payloads safely
  • persisting package state and history in JSON
  • reconciling a declared system profile with the installed package set

Structure

  • src/main.rs — CLI entrypoint and subcommand routing
  • src/commands/ — implementation of install, remove, search, update, upgrade, query, clean, verify, fix, config, history, and build commands
  • src/core/ — package database, dependency solver, transaction history, changelog, and declarative profile handling
  • src/archive/ — archive extraction and collision detection
  • src/network/ — HTTP downloader with sequential and ranged chunked downloads
  • src/utils/ui.rs — terminal output helpers and progress rendering
  • Cargo.toml — build metadata, runtime dependencies, and release optimizations

How MCX Works

Package State

MCX stores registry and package state under the configured root path:

  • var/lib/mcx/local.json — installed and available package metadata
  • var/lib/mcx/history.jsonl — transaction history journal
  • var/cache/mcx — downloaded package archives
  • var/tmp/mcx/stage — extraction staging area

Package metadata includes package name, version, license, source URL, checksum data, dependency list, file manifest, provides, and conflicts.

Dependency Solving

The dependency solver:

  • loads package manifests from the local database
  • resolves recursive package dependencies
  • supports virtual providers via provides
  • detects cyclic dependency loops
  • verifies conflict constraints before install planning
  • produces a topologically ordered install plan

Transactions and Safety

Install and remove actions are wrapped in transactions that:

  • back up files before overwriting them
  • record staged file paths
  • track affected packages
  • commit JSON state only after successful completion
  • rollback automatically if a transaction is dropped without committing

This design reduces the risk of partial or inconsistent package installations.

CLI Usage

This is a complete user guide for the MCX modular and standalone package manager for the Cudane distribution, covering all aspects of system administration, from handling local packages generated by the rLine build tool to repository maintenance and core system performance management.

Note

MCX does not require typing sudo, it's prompts for the password automatically.

1. Handling Local Packages

Since the packaging system relies on the Zstd-compressed, high-performance, standalone package format, you can manage and install manually built packages as follows:

Installing a Local Package (.xcs)

When you build a package using rline and produce a file with the .xcs extension, you can install it directly into the system using the following command:

mcx -a /path/to/package.xcs

How it works: MCX decompresses the archive using the Zstd engine, reads metadata.json, and then dynamically checks and lists the package files to register them in the system database before integrating them into the system root.

2. Package & Repository Management

MCX allows you to interact with official Cudane distribution repositories or external repositories to fetch, update, and clean the system.

Sync Repositories

To update the list of available packages and link dependencies to the latest updates from the servers:

mcx -u

Install Packages from a Repository

To install one or more programmatically processed packages from the catalog:

mcx -i <package_name>

Or install multiple packages at once:

mcx -i <package1> <package2> <package3>

Upgrade the Entire System

To check for changes and update all installed packages to the latest build environment output:

mcx -U

Remove Packages

To cleanly uninstall packages; MCX relies on a dynamically generated file array during installation to completely delete files without leaving any residual files:

mcx -r <package_name>

Package Query

To view details of a specific package, check if it is installed, and review its logs:

mcx -q <package_name>

Package Search

To search local and external repositories for a specific package:

mcx -s <query>

File Verification

To compare current system files with the digital fingerprint and checksum stored in the database (to ensure no corruption or unauthorized modification has occurred):

mcx -v

3. System & Configuration

To open a fast, built-in text editor (similar to GNU Nano) To modify the main MCX configuration file without an external editor:

mcx -C

Ctrl+O: To save changes and write the file to disk. Ctrl+X: To exit and return to the terminal.

Cleanup of Junk and Temporary Files

To clean up the system and free up space by clearing the cache and old installation logs:

mcx -c

How it works: Emptys the Binary Footprint cache folders in var/cache/mcx and rebuilds clean logs for future transactions.

Fixing Dependencies and Isolating Links

If hyperlinks for libraries or workspaces become corrupted, this command automatically repairs them:

mcx -f

4. History & Rollback

MCX has a hierarchical tracking system that protects the Cudane distribution from crashing in case of an interrupted or failed installation.

View History

To view the history of previous operations to see when and how packages were installed:

mcx -h

Rollback

To roll back the entire system to a specific point in time or generation and restore the system to its previous state:

mcx -h --rollback <generation_id>

5. Building System

You can build a minimal distributions based on your own configuration(s)

Rebuild

To completely rebuild the system based on a central configuration file (such as Cudane's core settings):

mcx -b --config /path/to/config.json

Note

Default path if not specified: /etc/cudane/system.json

Notes (vol. 1)

  • MCX automatically creates a lock in the path /var/lib/mcx/lock when any process starts to prevent database conflicts. If the program is interrupted using Ctrl+C, the engine automatically removes the lock to prevent subsequent operations from freezing.
  • All package extraction and metadata.json file checks are performed within a temporary, isolated environment in var/tmp/mcx/stage/ to ensure that live system files are not affected until the check is successful and the correct checksum is met.

System Profile Format

MCX can reconcile the installed package set against a declarative JSON profile.

Example:

{
  "version": "1.0",
  "architecture": "x86_64",
  "packages": ["foo", "bar", "baz"]
}

The build command installs missing packages and removes packages not declared in the profile.

Build From Source and Run

Build the project with cargo:

cargo build --release

Run the compiled binary:

./target/release/mcx install foo

Use a custom root path:

./target/release/mcx --root /tmp/mcx-root install foo

Notes (vol. 2)

  • The implementation is written in Rust and uses tokio for async operations.
  • Package state is managed in JSON and persisted under the configured root.
  • The downloader supports both sequential downloads and ranged chunked downloads for larger files.
  • The configuration editor module provides a TUI editor implementation, though mcx config currently reports configuration state.
  • Some CLI commands currently act as workflow scaffolding or simulated progress UI while the core install/remove logic is fully implemented.

Contributing

To extend MCX or add new features, start with these files:

  • src/main.rs
  • src/commands/*.rs
  • src/core/database.rs
  • src/core/solver.rs
  • src/network/download.rs
  • src/archive/extract.rs
  • src/utils/ui.rs

For bug reports or feature requests, open an issue in the repository.


Credits

Myden - Cudane & MCX Founder. | Made with 🤍 and Rust.

Packages

 
 
 

Contributors

Languages