Skip to content

Create your own package

PentagonLP edited this page May 20, 2025 · 1 revision

On this page, you will find instructions on how to create your own package.

First of all, some conventions

Of corse I can't force you to use these conventions, but they make life easier for all of us by preventing two programs of interfearing with each other. Also, if you plan on appliing for adding your package to to the default package list, you will be rejected of you don't follow these conventions. Sorry, have to be strict on that one to prevent total chaos and buggage.

  • If your package is a program that is always running from boot to shutdown, it must be opened in a new tab. The first default tab must always stay the shell.
  • If your package is a library, it must be stored in the '/lib'-folder. If your library consists of multible files, a sub directory is required. This is the always case if you use the 'library' install type, but more on that later.
  • If your package requires an entry in the "startup"-file, it should not overwrite the whole thing but rather add itself to the end of the file.
  • Your package should be backwards compatible.
  • To be expanded

Create packageinfo

To create your own package, you have to create a packageinfo file and make it availible online.
By standard, this file should be called 'packageinfo.ccpt', although the program doesn't care.

Content of 'packageinfo.ccpt'

All data in 'packageinfo.ccpt' is stored in the lua array format.
It should look something like this:

{
    name = "<Packagename>",
    comment = "<Short Description>",
    author = "<Author>",
    website = "<Your website>",
    newestversion = "<Last released version>",
    dependencies = {
        <packageid> = "<minimum version>",
        ...
    },
    install = {
        type = "<Package Install Type>",
        <More install info>
    }
}

Packagename: Your Packages name. Not related to the package ID, you can choose any name. Has no functional purpose other then 'ccpt info'.
Short Description: Short description of your packages function. Should not be longer than 50 characters to still fit on a computercraft screen. Has no functional purpose other then 'ccpt info'.
Author: Your name! Yay! Has no functional purpose other then 'ccpt info'.
Your website (Optional): The website of your program/package, eg. link to the repository or pastebin page, your Twitter or personal website. Doesn't matter! Has no functional purpose other then 'ccpt info'.

Even though these have no functional purpose, they can not be nil (exept the ones marked with 'optional'), or 'ccpt info' will throw an error!

Ok, now lets get to the intresting stuff:

newestversion: The newest release version of your package. Your version must be numeric, otherwise things will break. If you have already developed a non-numeric version system, keep in mind that this number must not correlate with your actual (non numeric) version. But if you can somehow arrange it, it always should, because its displayed to the user at multible points in the program. And you know how users are, they get confused quite easily. Anyways, if you change this number to a higher one, ccpt will detect that a update is availible. You can change your packages dependencies with every update.
dependencies: List of all the packages and their version your package depends on, can not be nil but can be empty if your package depends on no other packages. Can be changed with every update.
install: Instructions for ccpt on how to install/update/remove your package. How to structure this section

Still a feeling bit lost?

Check out examples of some 'packageinfo.ccpt'-files:
'ccpt': https://github.com/PentagonLP/ccpt/blob/main/packageinfo.ccpt
'properprint': https://github.com/PentagonLP/properprint/blob/main/packageinfo.ccpt
If you still have any questions, just ask.

Where to host

Doesn't matter. Somewhere in the internet, maybe on Github or Pastebin, or on your own website. Only condition: It must be publicly availible. If your hosting on Github, make sure to always use the 'raw' link! That's my favorite mistake to make.

How to test wether your package is working

When you've completed all these steps, you are ready to test your package.
First of all, add it to ypur local package list:

ccpt add <some package id> <URL to 'packageinfo.ccpt'-file>

Then, the usual

ccpt update

And with that, you are ready to go!
You can now try installing, updating and uninstalling your package. I'll cross my fingers that it works!
If it doesn't at first, please remember that especially on public sites like Github or Pastebin, caching is something to consider.

Ok, that's all fun and games, but how do I add my package to the default packages list?

Well, thats a whole other topic: How to apply for the default package list for one of your packages