{"id":17384463,"url":"https://github.com/jakubriegel/kotlin-shell-examples","last_synced_at":"2026-05-06T07:33:40.264Z","repository":{"id":53536476,"uuid":"201905455","full_name":"jakubriegel/kotlin-shell-examples","owner":"jakubriegel","description":"Examples of Kotlin Shell","archived":false,"fork":false,"pushed_at":"2021-03-25T20:40:40.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T23:41:57.307Z","etag":null,"topics":["examples","kotlin","kotlin-script","shell"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakubriegel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-12T10:06:27.000Z","updated_at":"2023-11-24T08:10:49.000Z","dependencies_parsed_at":"2022-09-17T22:12:21.236Z","dependency_job_id":null,"html_url":"https://github.com/jakubriegel/kotlin-shell-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fkotlin-shell-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fkotlin-shell-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fkotlin-shell-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fkotlin-shell-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubriegel","download_url":"https://codeload.github.com/jakubriegel/kotlin-shell-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924500,"owners_count":20694731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["examples","kotlin","kotlin-script","shell"],"created_at":"2024-10-16T07:45:33.082Z","updated_at":"2026-05-06T07:33:35.240Z","avatar_url":"https://github.com/jakubriegel.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin Shell Examples\nThis repository provides examples on using [Kotlin Shell](https://github.com/jakubriegel/kotlin-shell) library\n\nThe examples can be run both via command line and Intellij IDEA.\n\nAll examples from `kotlin` can be executes as scripts and all examples from `kts` can be executed as part of Kotlin code. \n\n\u003e As scripting support in Intellij IDEA is still under development, examples may not run properly on every versions. \n\u003e Despite the highlighting and completion should work fine.\n\n## run it with command line\n### kotlin\n\ntype:\n```shell\n./gradlew -Psample=[RELATIVE-CLASS-PATH] -Plogs=true execute [--args=\"ARGS\"]\n```\n\nexample:\n```shell\n$ cd kotlin\n$ ./gradlew -Psample=basic.HelloKt execute\nhello world!\n```\n\nTo see logs add `-Plogs=true` parameter.\n\n### kts\nTo run scripts you need [kshell](https://github.com/jakubriegel/kshell) installed\n\ntype:\n```shell\ncd kts\nkshell src/kotlin/[PATH-TO-SAMPLE] [ARGS]\n```\n\nexample:\n```shell\n$ cd kts\n$ kshell src/kotlin/basic/hello.sh.kts\nhello world!\n```\n\n## run it with Intellij IDEA\n### kotlin\nAfter importing Gradle project you will be able to run `main()` functions in sample classes.\n\n### kts\nAfter importing Gradle project you will be able to run script files.\n\n### file template\nFile `kts/fileTemplate_sh_kts` contains template definition for Intellij. \nTo use it put this file in `~/Library/Preferences/IntelliJIdea/fileTemplates` with name `KotlinShell.sh.kts`.\n\n## logging\nKotlin Shell features `slf4j` logging interface. \nAll examples use NOP logger by default. Configurations for loggers can be found under `resources/log4j2.xml`.\n\n### kotlin\nBy default Gradle project imports NOP logger. To change it use these [instructions](#run-it-with-command-line).\n\n### kts\nBoth `kshell` and Gradle uses NOP logger by default. You can change this dependency manually to see the logs.\n\n## side by side examples\nIn `sidebyside` package there are located side by side examples of scripts written with Kotlin Shell and Bash. \nThey are always equal in terms of evaluation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fkotlin-shell-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubriegel%2Fkotlin-shell-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fkotlin-shell-examples/lists"}