Very simple package manager for ComputerCraft.
- Install packages from remote repositories, URLs, or local files.
- Uninstall packages.
- Manage remote repositories.
- Descriptive error messages.
- Simple package format.
- Easy to create and host packages.
wget run https://raw.githubusercontent.com/foopis23/cc-pack/refs/heads/main/install.lua
Install a package. Packages can be installed from three different sources:
-
Remote repository:
ccp add package_nameWhen installing by package name, cc-pack will search through configured remote repositories to find the package.
-
URL:
ccp add https://example.com/package.lua -
Local file:
ccp add file://path/to/package.lua
Remove an installed package.
ccp rm <package_name>
Manage remote package repositories.
ccp remote <command>
Available remote commands:
Add a remote package repository.
ccp remote add <url>
Remove a remote package repository.
ccp remote rm <url>
List all configured remote repositories.
ccp remote list
Packages are Lua files that return a table with the following structure:
{
name = "package_name", -- required: string
version = "1.0.0", -- optional: string (defaults to "0.0.0")
description = "Description", -- optional: string (defaults to "No description provided.")
author = "Author Name", -- optional: string (defaults to "Unknown")
base_path = "https://...", -- required: string - base URL for file downloads
file_map = { -- required: table mapping remote files to local paths
["/remote/path/file1.lua"] = "/local/path/file1.lua",
["/remote/path/file2.lua"] = "/local/path/file2.lua"
}
}Here's an example package definition that installs from a GitHub repository:
-- example_package.lua
return {
name = "example_package",
version = "1.0.0",
description = "An example package for testing.",
author = "Garfeud",
base_path = "https://raw.githubusercontent.com/Space-Boy-Industries/unicornpkg-repo/refs/heads/main",
file_map = {
["/sbi_software/startup.lua"] = "/startup/99_sbs_startup.lua",
},
}As of right now, packages are resolved by file name, not by the name field in the package table. This means that if you have a package file named example_package.lua, it will be installed as example_package regardless of the name field in the package table.
A remote repository is just a web server that hosts packages at a specific URL. The package manager will look for packages in the following format:
https://<repository_url>/<package_name>.lua
You can use GitHub to host your packages. Just create a new repository and add your package files. The package manager will be able to access them using the raw URL.
Base url format:
https://raw.githubusercontent.com/<account_or_org>/<repo_name>/refs/heads/<branch_name>
The package manager uses ComputerCraft's settings API for configuration. Available settings:
Configure the logging level using the cc-pack.log_level setting:
set cc-pack.log_level <level>
Log levels:
- 0 = DEBUG (verbose output)
- 1 = INFO (default, normal output)
- 2 = WARN (warnings only)
- 3 = ERROR (errors only)