Konclik is a library for the development of a CLI application.
0.6.0
Issues, contributions and suggestions are very welcome. Please report bugs, improvements and new features with an issue, so we can discuss the next steps.
This project uses the new MPP plugin,
the root contains Konclik's core source in the src
directory.
In addition to the core, the following submodules are available.
example
: An example, which demonstrates a Konclik app targeting MacOS, Linux, Windows, Jvm, and NodeJS.Konclik is published to bintray and can easily be integrated into an existing project.
repositories {
maven {
url "https://dl.bintray.com/dbaelz/konclik"
}
// Other repos like:
//jcenter()
}
dependencies {
// With Gradle Metadata enabled, all targets can depend on
implementation "de.dbaelz.konclik:konclik:0.6.0"
// All artifacts are available with the -target suffix
implementation "de.dbaelz.konclik:konclik-macos:0.6.0"
implementation "de.dbaelz.konclik:konclik-linux:0.6.0"
implementation "de.dbaelz.konclik:konclik-windows:0.6.0"
implementation "de.dbaelz.konclik:konclik-jvm:0.6.0"
implementation "de.dbaelz.konclik:konclik-js:0.6.0"
}
Note: If the Host machine does not support a specific target, that target's tasks will simply be ignored.
The following Gradle tasks are available:
jsTest
, macosTest
, jvmTest
, linuxTest
, windowsTest
publish
: Publish to bintray, replace the publishing url with your own repository.publishToMavenLocal
: Publish a version to your local machine, available in the mavenLocal()
repositoryexample:runMacos
, example:runJar
, example:runLinux
, example:runWindows
, example:runNodejs
This project provides an example, which shows the usage of the DSL.
The current DSL is WIP, but suitable to build effective CLI applications. It provides KDoc to explain the usage. A short overview of the components:
konclikApp
: The CLI app
metadata
(name, description and version)command
entriesrun()
to parse the provided CLI args and execute the command with these args--version
command
:
name
. The description
is optionalparameters
can be defined for the command. They evaluated in the following order:arguments
: Positional arguments, internally evaluated by the order of the listoptions
: Options are optional and could be switch or value parametersaction
consists of the logic to execute for the commandonError
this can be changed and custom error handling is possible--help
and returns