CLI overview

The sugar CLI is mainly the best entry point to the Coffeekraken ecosystem.

What is it offering?

Through the CLI you will have access to all the primary features that Coffeekraken has to offer. This mean:

  1. Full development environment
  2. Full production ready build stack for:
    • js/ts
    • css through PostCSS and our @coffeekraken/s-postcss-sugar-plugin
    • Images optimization and different resolutions generation
    • and more...
  3. Nice tooling like:
    • Sitemap generation
    • Static website generation for non-headless websites
    • Project scaffolding for different things like website templates, lit element, etc...
    • Utils like launching a command in multiple directories at once
    • Killing processes by id or by port
    • and more...

How to start using it?

The main thing is to install it like so:

Then you will have access to the sugar command that you can use first like so:

  1. sugar: Will launch a simple interactive process to guide you
  2. sugar --help: Display the complete sugar CLI commands list
  3. sugar {stack}.{action} --help: Display a particular stack/action help with detailed arguments list, etc...

These are the main entry points with the ones you can discover and try our features

Available commands

Here's a list of the available commands:

  • sugar sugarJson.list [arguments]

    • Search and list for sugar.json files
  • sugar new.project [arguments]

    • Init a new project
  • sugar dev.start [arguments]

    • Start the development stack
  • sugar prod.start [arguments]

    • Start the production testing stack
  • sugar build.prod [arguments]

    • Build for production
  • sugar fs.copy [arguments]

    • Copy a file/directory to a specified destination
  • sugar process.kill [arguments]

    • Kill a process by it's pid, port and more
  • sugar nvm.autoSwitch [arguments]

    • Add the necessary (zsh, bash) script to make your NVM automatically change the node version when detecting a .nvmrc file in your project
  • sugar carpenter.start [arguments]

    • Start a carpenter environment and display easily your components
  • sugar formatter.format [arguments]

    • Format your code using the SCodeFormatter class
  • sugar docmap.build [arguments]

    • Build the docmap.json file by searching for source files with a @namespace defined
  • sugar docmap.search [arguments]

    • Search the document for a specific item.
  • sugar docmap.read [arguments]

    • Get a special docmap entry
  • sugar favicon.build [arguments]

    • Build your favicon with all the sizes, etc...
  • sugar frontendServer.start [arguments]

    • Start a new frontend server process
  • sugar frontendServer.corsProxy [arguments]

    • Start a cors proxy server
  • sugar frontspec.build [arguments]

    • Build the frontspec.json file from configs specified in the config.frontspec.build.fromConfigs stack
  • sugar googleMap.styles [arguments]

    • Generate a google map json style depending on your theme colors
  • sugar images.build [arguments]

    • Compress your images and generate different resolutions as well as webp version of them
  • sugar kitchen.new [arguments]

    • Create a new project from a recipe (template) like the default one or for example the litElement one, etc...
  • sugar kitchen.run [arguments]

    • Run a recipe (or action) of the kitchen application into the current working directory
  • sugar kitchen.ls [arguments]

    • List either all the recipes available or particular recipe actions stack
  • sugar kitchen.add [arguments]

    • Add some ingredient(s) to your project like "frontspec", "favicon", etc...
  • sugar markdown.build [arguments]

    • Build your markdown using marked and some internal extensions like s-code-example and others
  • sugar mono.exec [arguments]

    • Exec a command in all the packages of the monorepo
  • sugar mono.list [arguments]

    • List all the repositories that compose the current mono repo
  • sugar mono.publish [arguments]

    • Publish all the repositories that compose the current mono repo
  • sugar mono.dev [arguments]

    • Launch the monorepo dev stack. Principally transpiling the packages typescript files
  • sugar mono.upgrade [arguments]

    • Upgrade the repositories informations depending on the mono repo ones
  • sugar package.rename [arguments]

    • Rename a package (folder, package.json, etc...
  • sugar package.install [arguments]

    • Install package dependencies like npm and composer
  • sugar package.checkDependencies [arguments]

    • Check package for unused, missing dependencies in the package.json file
  • sugar package.exports [arguments]

    • Generate automatically the 'exports' properties in the package.json file depending on the found 'exports.js' files
  • sugar postcss.build [arguments]

    • Build your css using postcss and some built-in tools like the sugar plugin.
  • sugar sitemap.build [arguments]

    • Build your sitemap depending ton configuration file 'sitemap.config.js'
  • sugar static.build [arguments]

    • Build your static website version
  • sugar config.cache [arguments]

    • Put the configuration in the cache to speed up subsequent calls
  • sugar typescript.build [arguments]

    • Build the ts and js files found in the repository
  • sugar vite.start [arguments]

    • Start the vite server and compilators development stack
  • sugar vite.build [arguments]

    • Build your assets like js, and css using vite
  • sugar vite.test [arguments]

    • Launch the tests using vitest
  • sugar command.run [arguments]

    • Run a line command either in current directory or in a(some) specific packages

For more information about these commands, simply use the sugar -h command, or the sugar docmap.build -h to have more insights about a particular one...

Bugs
are not our friends...

Don't hesitate to declare an issue if something does not works as expected.

Declare my issue on Github Talk about it on Discord

The more we are,
the stronger we become.

Don't hesitate to tell some words to you friends about us. The goal is to became more and more each days to help each others...

Support us on Patreon! Share on Facebook! Make a tweet!

The more we are,
the stronger we become.

Don't be afraid to join us on Discord.

Join us on discord!

We love,
Open source!

All of our codebase can be found on Github. We hope that you may contribute to help us make our tools even better!

Discover our codebase!

Welcome on