RepositoryKotlin
AJ

ajalt/clikt

Multiplatform command line interface parsing for Kotlin

3.0kstars
136forks
28issues
5views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: argument-parser

#1 Repository of the week

1
TINIX TRENDING·Topic: argument-parsing

#1 Repository of the week

1
TINIX TRENDING·Topic: option-parser

#1 Repository of the week

Clikt (pronounced "clicked") is a multiplatform Kotlin library that makes writing command line interfaces simple and intuitive. It's the "Command Line Interface for Kotlin".

It is designed to make the process of writing command line tools effortless while supporting a wide variety of use cases and allowing advanced customization when needed.

Clikt has:

  • arbitrary nesting of commands
  • composable, type safe parameter values
  • generation of help output and shell autocomplete scripts
  • multiplatform packages for JVM, Node.js, and native Linux, Windows and macOS

What does it look like? Here's a complete example of a simple Clikt program:

class Hello : CliktCommand() {
    val count: Int by option().int().default(1).help("Number of greetings")
    val name: String by option().prompt("Your name").help("The person to greet")

    override fun run() {
        repeat(count) {
            echo("Hello $name!")
        }
    }
}

fun main(args: Array<String>) = Hello().main(args)

And here's what it looks like when run:

The help page is generated for you:

Errors are also taken care of:

Documentation

The full documentation can be found on the website.

There are also a number of sample applications. You can run them with the included runsample script.

Installation

Clikt is distributed through Maven Central.

dependencies {
   implementation("com.github.ajalt.clikt:clikt:5.1.0")

   // optional support for rendering markdown in help messages
   implementation("com.github.ajalt.clikt:clikt-markdown:5.1.0")
}

There is also a smaller core module available. See the docs for details.

If you're using Maven instead of Gradle, use <artifactId>clikt-jvm</artifactId>

Multiplatform

Clikt supports most multiplatform targets. See the docs for more information about functionality supported on each target. You'll need to use Gradle 6 or newer.

Snapshots

Snapshot builds are also available

Sonatype has instructions for consuming snapshots

You'll need to add the Central Portal snapshots repository:

repositories {
    maven {
        url = uri("https://central.sonatype.com/repository/maven-snapshots/")
    }
}

License

Copyright 2018 AJ Alt

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
clap-rs/clap

A full featured, fast Command Line Argument Parser for Rust

16.9k
Nov 24, 2026
RepositoryKotlin
xenomachina/kotlin-argparser

Easy to use and concise yet powerful and robust command line argument parsing for Kotlin

497
May 31, 2022
RepositoryC++
Taywee/args

A header-only C++ argument parser library. Supposed to be flexible and powerful, and attempts to be compatible with the functionality of the Python standard argparse library (though not necessarily the API).

1.6k
Oct 23, 2026
RepositoryC++
badaix/popl

Header-only C++ program options parser library

179
Mar 16, 2023
RepositoryC++
Fytch/ProgramOptions.hxx

Single-header program options parsing library for C++11

132
Apr 28, 2022
RepositoryGo
DavidGamba/go-getoptions

Fully featured Go (golang) command line option parser with built-in auto-completion support.

59
Apr 15, 2025
RepositoryC++
hasherezade/paramkit

A small library helping to parse commandline parameters (for C/C++)

59
Apr 7, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026