punctuations / popcorn

🍿 A command-line tool for command-line tools.
GNU General Public License v2.0
2 stars 2 forks source link

🍿 Popcorn

Say goodbye to complicated installation instructions and build steps.

So easy you can sit back and enjoy some popcorn.

Contents

Requirements

Back to contents

Terminology

Back to contents

Install

Linux/Mac:

curl -sSL cmdf.at/popcorn | bash

or with homebrew

brew tap punctuations/tap
brew install punctuations/tap/popcorn

Windows:

iwr -useb raw.githubusercontent.com/punctuations/popcorn/main/install.ps1 | iex

or with Chocolately

coming soon...

Back to contents

Updating

If installed with the installation script just re-run the script, and it will update the program.

Back to contents

How it works

popcorn is a cli tool to create a streamline development process for other command-line tools.

popcorn aims to help with the development process of not only clis using frameworks but also cli tools that have no frameworks, by creating and compiling an entry point to these types of files using the "unpacked" type.

Commands

Build:

The build command will compile the code in the current directory to the production directory, making a cli tool compiled and stored as a kernel.

Ex.

> popcorn build

output flag:

Using the output flag will fix any conflicts between kernel names by storing it a different parent directory.

> popcorn build -o raspberry
Dev:

The dev command will launch a development environment which will listen to the specified directory for any changes and hot reload the development version of the command, to test out the command up-to-date and without having to manually compile every time.

The development command will be accessible through the {kernel_name}{dev_node}, for example: popcorn-dev

Ex.

> popcorn dev

listen flag:

The listen flag specifies the directory that it is listening to for changes.

> popcorn dev -l ./foo/bar
Install:

The install command is to install your kernel to the path and initialize the environment for it, this command should be run if the kernel has not been installed yet.

Ex.

> popcorn install

dev flag:

the dev flag will install the development version of the command, the path will be saved to either shellrc file or .profile (on windows it will go straight to path)

> popcorn install -d
Remove:

The remove command is to remove already installed kernels.

Ex.

> popcorn remove foo

dev flag:

The dev flag is used to indicate the requested kernel is a development kernel, which will be removed from a separate place from the production kernels.

> popcorn remove foo -d
Init:

The init command initializes the config file for popcorn.

Ex.

> popcorn init

force flag:

The force flag will replace any existing config file with the base/skeleton one.

> popcorn init --force

packed flag:

The packed flag generates a different skeleton to that of the unpacked or default one and will only have necessary values.

> popcorn init --packed
Help:

The help command provides help for the commands, providing more detail about them.

Ex.

> popcorn help dev

Back to contents

Kernel Examples

Some examples of how to construct a kernel can be seen at the following:

Back to contents

Config

The config (.kernelrc) is used for all kernels, and is required, you can use the init command which will generate a skeleton config to edit for the user.

Skeleton config file:
{
    "kernel_name": "popcorn",
    "kernel_type": "unpacked",
    "unpacked_husk": "python @local/popcorn.py @args",
    "dev_cmd": "popcorn dev",
    "seed_cmd": "cp -r * @dest",
    "advanced": {
        "os": ["mac", "windows", "linux"],
        "dev_node":  "-dev"
    }
}
Values:
Variables:

Back to contents