{"id":17955914,"url":"https://github.com/utkuozdemir/kotlin-cli","last_synced_at":"2025-03-25T02:31:04.796Z","repository":{"id":44402684,"uuid":"437675897","full_name":"utkuozdemir/kotlin-cli","owner":"utkuozdemir","description":"Native Kotlin CLI","archived":false,"fork":false,"pushed_at":"2025-02-27T18:48:32.000Z","size":146,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T06:51:30.677Z","etag":null,"topics":["cli","detekt","example","graalvm","graalvm-native-image","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utkuozdemir.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T23:00:48.000Z","updated_at":"2025-02-27T18:48:35.000Z","dependencies_parsed_at":"2024-06-13T03:32:03.288Z","dependency_job_id":"e6d96515-ecc9-4a08-9c85-8f73103039b6","html_url":"https://github.com/utkuozdemir/kotlin-cli","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/utkuozdemir%2Fkotlin-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkuozdemir%2Fkotlin-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkuozdemir%2Fkotlin-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkuozdemir%2Fkotlin-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utkuozdemir","download_url":"https://codeload.github.com/utkuozdemir/kotlin-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245385320,"owners_count":20606647,"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":["cli","detekt","example","graalvm","graalvm-native-image","kotlin"],"created_at":"2024-10-29T10:33:30.586Z","updated_at":"2025-03-25T02:31:04.492Z","avatar_url":"https://github.com/utkuozdemir.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlin-cli\n\nSimple CLI written in Kotlin that compiles to native code using GraalVM Native Image.\n\n## Introduction\n\nI love [Go](https://go.dev/) - it is simple, compiles to a small, statically linked binary, starts\nand runs very fast with minimal resources.\n\nI also love [Kotlin](https://kotlinlang.org/) because it is a very expressive Java-based language\nwith great features and a strong standard library.\n\nOne of the most exciting things going on in the Java world is [GraalVM](https://www.graalvm.org/)\nand especially [GraalVM Native Image](https://www.graalvm.org/reference-manual/native-image/). It\ncompiles Java Bytecode ahead-of-time to produce native (\u0026 optionally statically linked) binaries similar to Go.\n\nIn this project, I write a simple CLI application in Kotlin and compile it using GraalVM Native\nImage, trying to get the best of both worlds - write Kotlin, get Go-like binaries.\n\nWorking with GraalVM Native Image is not very smooth, it takes long to compile and some things just\ndon't work with it and/or requires additional configuration (`reflect-config.json` etc.).\n\nThe goal of this project is for me to try to do different things with native-image and track its\nprogression. I can see what works out-of-the-box, what needs additional configuration and what does\nnot work at all.\n\nIt can also serve as an example of how to configure native-image builds for Kotlin in Maven.\n\nList of things I have tried so far:\n\n- Basic file IO :white_check_mark:\n- Basic network IO (HTTPS) :white_check_mark:\n- Data classes :white_check_mark:\n- Log4j2 :x:\n\n## Building\n\nMake sure you have [GraalVM \u003e=21.3.0](https://www.graalvm.org/downloads/) installed.\n\nIf you are using Mac \u0026 Homebrew:\n```bash\nbrew install --cask graalvm/tap/graalvm-ce-java17 \nsudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-*\n```\n\nPoint your `JAVA_HOME` and `GRAALVM_HOME` env variables are set to point to it.  \nExample (in your `.bashrc` or `.zshrc`):\n```\nexport GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-\u003cYOUR_GRAALVM_VERSION\u003e/Contents/Home\nexport JAVA_HOME=$GRAALVM_HOME\n```\n\nTo compile, test and produce a .jar (not a native binary):\n\n```bash\n./mvnw clean package\n```\n\nTo compile, run native tests and produce a native binary:\n\n```bash\n./mvnw -P native clean package\n```\n\nTo skip tests:\n\n```bash\n./mvnw -DskipTests -P native clean package\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkuozdemir%2Fkotlin-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futkuozdemir%2Fkotlin-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkuozdemir%2Fkotlin-cli/lists"}