Skip to content
/ kscript-template Public template

πŸ“œ Get started with kscript in a few seconds... with colored logs, github actions and more!

License

Notifications You must be signed in to change notification settings

cortinico/kscript-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

kscript-template πŸ“œ

Use this template Run Script License Language

A simple Github template that lets you create a kscript repository ready to run and share in a few seconds.

How to use πŸ‘£

Just click on Use this template button to create a new repo starting from this template.

Once created don't forget to update the:

  • Script name both the filename and the occurrencies inside the script.
  • The script name inside the Github Actions workflow file.

The templated script is just printing the list of files from a input directory. You can use this as a starting point to create your script around it:

Features 🎨

  • Cli Args parsing with picocli.
  • Logging functions info, warn, error, success with emoji support βœ…βš οΈβŒ.
  • Support for ASCII colored output 🎨.
  • CI Setup with GitHub Actions.
  • Publishing of bundled artifact out of the box.
  • Issues Template (bug report + feature request).
  • Pull Request Template.

CLI Args ⌨️

This project is using picocli to easily parse the CLI Options and Parameters. You can find more example on how to set up the flags on the official documentation page.

You can use the --help flag to get a nice report for the available flags:

If you want to see how a failure looks like, invoke with --fail or -f:

Logging πŸ“£

A couple of util functions are available for logging:

  • ℹ️ info to report a info message. You can optionally provide an emoji to enrich the log.
  • βœ… succ to report a green success message.
  • ⚠️ warn to report a yellow warning message.
  • ❌ error to report an error. Optionally you can provide also:
    • A Throwable that will be logged on the screen
    • An exit code Int. If not provided the default is 1

Calling error will also stop the script.

CI βš™οΈ

This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.

The workflow Run Script will take care of running the script and publishing the bundled version of it as an artifact (users can easily download it).

Contributing 🀝

Feel free to open a issue or submit a pull request for any bugs/improvements.

Releases

No releases published

Packages

No packages published

Languages