A starter project to build command-line tools in Kotlin Multiplatform

Overview

A starter project to build command-line tools in Kotlin Multiplatform

Contains a re-implementation of a real world CLI tool: git-standup

jmfayard_kotlin-cli-starter__Life_is_too_short_for_Bash_programming_and_Telegram_and_GitHub_Desktop

Installation

You can install using one of the options listed below

Source Command
Node npm install -g kotlin-cli-starter
Installer curl -L https://raw.githubusercontent.com/jmfayard/kotlin-cli-starter/main/installer.sh | sudo sh
Tests ./gradlew allTests
Kotlin All Platforms Run ./gradlew allRun
Kotlin JVM Run ./gradlew run
Kotlin Native Run ./gradlew install then $ git standup
Kotlin Node.JS Run ./gradlew jsNodeRun

Why?

Being able to write your own command-line tools is a great skill to have. Automate all the things!

You can write the CLI tools in Kotlin and reap the benefits of using

  • a modern programming language
  • modern IDE support
  • modern practices such as unit testing and continuous integration
  • leverage Kotlin multiplatform libraries
  • run your code on the JVM and benefit from a wealth of Java libraries
  • or build a native executable, which starts very fast and can be deployed on a computer without the JVM

My strong opinion - weakly held - is that there are only two good kind of Bash scripts:

  • the ones that are five lines long or less
  • the ones that are written and maintained by others

Work in progress

We want to support Windows, publish on Homebrew and simplify support of shell completion.

Look at the issues https://github.com/jmfayard/kotlin-cli-starter/issues

What the template contains

The template

kotlin-cli-starter_–_nativeMain_…_Files_kt__kotlin-cli-starter_nativeMain__and_GitHub_Desktop_and_kamranahmedse_git-standup__Recall_what_you_did_on_the_last_working_day__Psst__or_be_nosy_and_find_what_someone_else_in_your_team_did__-_

The template reimplements git-standup

The template reimplements git-standup so that you can learn and find inspiration from a real world example.

Simply run it in and it will give you the output from the last working day

Open a directory having multiple repositories and run

$ ./gradlew install
$ git standup

git standup

This will show you all your commits since the last working day in all the repositories inside.

There is auto-completion to see the options

jmfayard_jmfayard____Downloads_and_kotlin-cli-starter_–_README_md__kotlin-cli-starter__and_README_·_Issue__7_·_jmfayard_kotlin-cli-starter

git standup --help
Usage: git-standup [OPTIONS]

  Recall what you did on the last working day ..or be nosy and find what
  someone else did.

Options:
  --generate-completion [bash|zsh|fish]
  -a, --author TEXT                Specify author to restrict search to
  -b, --branch TEXT                Specify branch to restrict search to
                                   (unset: all branches, "$remote/$branch" to
                                   include fetches)
  [... and much more options....]

Examples: git-standup -a "John Doe" -w "MON-FRI" -m 3

CUSTOMIZE_ME

So are you ready to write your own command-line tool?

Have you an idea of what you want to write yet?

You can find some inspiration in 15 Command Line Tools which Spark Joy in Your Terminal

Then click on Use this GitHub template

There are comments starting with CUSTOMIZE_ME in all places you need to customize

Find them with Edit > File > Find in Files

Built with kotlin-cli-starter

Have you used the template to build something? Please advertise it here 🙏🏻

You might also like...
Starter code for Android Basics in Kotlin

Inventory - Starter Code Starter code for Android Basics in Kotlin. Introduction This app is an stater code for an Inventory tracking app. Demos how t

Starter code for Android Basics in Kotlin

Inventory - Starter Code Starter code for Android Basics in Kotlin. Introduction This app is an stater code for an Inventory tracking app. Demos how t

Inventory-App - Starter code for Android Basics in Kotlin

Inventory - Starter Code Starter code for Android Basics in Kotlin. Introduction

kotlin eval command for minestom

k Kotlin debugging evaulator in Minestom. Usage /k is shorthand, /ko is longhand requires the permission "k.ok" and "k.store" for running scripts and

🐹 Kotlin microservice to aid slash command creation for Nino.

slash-commands 🐹 .Kotlin microservice to aid slash command creation for Nino. More of this README will be fixed up once the first release is here. Li

This is a Ktor project to build your own Url shortener
This is a Ktor project to build your own Url shortener

Ktor URL Shortner This project is a implementation for creating Short URL using Ktor + Kotlin + MongoDB Usage It contains two routes if you want to im

Project build to understand the concepts of Git and GitHub

Project build to understand the concepts of Git and GitHub. Summarizing the concepts learnt. Created a project in Android Studio Before installing And

A project to show the best way to build an Android app on 2022 (by me).
A project to show the best way to build an Android app on 2022 (by me).

Hello Architecture I create this project to show what's for me the best way to build an Android app on 2022. Architecture I use this diagram as and id

A forkable starter for building your own recipes and deploying them on the Moderne SaaS

Rewrite recipe starter This repository serves as a template for building your own recipe JARs and publishing them to a repository where they can be ap

Owner
null
A command-line student management system in Kotlin

Student Management System Done as a part of NITK GSDC Android Study Jams 2021 Th

Ranjana Kambhammettu 2 Dec 24, 2021
Android application compatible with ZX2C4's Pass command line application

Password Store Download Documentation We're in the process of rewriting our documentation from scratch, and the work-in-progress state can be seen her

Android Password Store 2.2k Dec 29, 2022
An interactive command line interface to a transactional key value store

Transactional Key-Value Store An interactive command line interface to a transactional key value store. Commands: SET <key> <value> // store the value

Eugene 0 Jan 14, 2022
Kotlin-phoenix - A set of tools aimed to bridge Phoenix with the Kotlin Multiplatform world

Kotlin Phoenix This project is aimed to allow developers to work with Phoenix Ch

Adrien Jacquier Bret 5 Sep 21, 2022
Starter project to create a simple RESTful web service in Kotlin

Modified: Adding Koin for DI Using JWT for authentication and authorization Dropping proprietary FlyAway tool Single Page Application support Starter

null 1 Oct 23, 2021
Buggy buggy kotlin MVVM starter project

贪吃蛇 - MVVM - Kotlin Introduciton project was inspired and initialized by youtube

null 0 Dec 28, 2021
A simple starter project for Minecraft Spigot Plugin using KotlinBukkitAPI.

KBAPI-StarterProject A simple starter project for Minecraft Spigot Plugin using KotlinBukkitAPI. The starter comes with the following KotlinBukkitAPI

null 0 Nov 2, 2021
Starter project with PEKK stack.

Running the project To run the project, you need to run the server and the frontend. Running the server In the terminal, run ./gradlew narcore-server:

Narbase Technologies 2 Sep 9, 2022
An Android template you can use to build your project with gradle kotlin dsl

Android Gradle KTS An Android template you can use to build your project with gradle kotlin dsl Build.gradle.kts You can use your project's build.grad

Deep 17 Sep 12, 2022
Generated with spring boot kotlin starter kit

Kotlin backend Generated with spring boot kotlin starter kit The idea is to: Get a microservice written in kotlin for managing users and roles. To be

Oriol Subirana 1 Oct 19, 2021