https://github.com/elisamin/khell
a simple and powerful command line executor with kotlin dsl, coroutine and multiplatform supported
https://github.com/elisamin/khell
android android-library jvm kotlin kotlin-multiplatform
Last synced: 3 months ago
JSON representation
a simple and powerful command line executor with kotlin dsl, coroutine and multiplatform supported
- Host: GitHub
- URL: https://github.com/elisamin/khell
- Owner: ElisaMin
- Created: 2021-01-22T19:15:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T11:42:39.000Z (over 1 year ago)
- Last Synced: 2025-01-04T15:36:20.723Z (4 months ago)
- Topics: android, android-library, jvm, kotlin, kotlin-multiplatform
- Language: Kotlin
- Homepage:
- Size: 283 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kotlin Shell
a lib just package the process for unnecessary things etc. Async Flow and Coroutines.## Help this project
yes, it could be more powerful some how #2# QuickStart
## read the docs and code
it's a veeeeery simple lib with JUST 1 CORE FILE, and it's 200 lines code only. so [just read it](khell/src/commonMain/kotlin/me/heizi/kotlinx/shell/Shell.kt)
```kotlin
Shell("echo hello world").await() {
if (it is CommandResult.Success) it.let(::println)
}
Shell("ping xvidoes.com")
.collect(::println)val req = Shell {
if ( foo )
run("bar")
if ( foo2 ){
write("bar2")
run()
}
}
delay(3000)
req
.await()
.let(::doSth)
```
## there has a log lib
```kotlin
import me.heizi.koltinx.loggger.error
import me.heizi.koltinx.loggger.printlnclass `class name as tag` {
fun log(msg:String)
= this.println("msg-log",msg)
fun err(msg:String)
= this.error("msg-log",msg)
}```
## add to your project
### with Gradle & Jitpack
[](https://jitpack.io/#ElisaMin/Khell)
### maven
```kotlin
maven { url = uri("https://jitpack.io")}
```
### dependencies
```kotlin
// required: coroutine
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")// gradle.properties if you're
val khellVersion = extra["khell.version"] as String// Khell
implementation("com.github.ElisaMin:khell:$khellVersion")
// or Khell Android
implementation("com.github.ElisaMin:khell-android:$khellVersion")
// or Khell JVM
implementation("com.github.ElisaMin:khell-jvm:$khellVersion")// option: but JVM log impl must be
implementation("org.slf4j:slf4j-log4j12:+")// option: the LOG lib
//implementation("com.github.ElisaMin:khell-log:$khellVersion")
```### with Gradle & GithubRepo
.....