From 2c74c4d42435bfff1c08a182439a54f647eda239 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 10 Jan 2024 23:37:20 +0100 Subject: [PATCH] add faq to the readme, clean up the layout --- README.md | 72 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3e61a33..9ff2dfe 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,23 @@ there is always a question of distribution. You could ask your friends to downlo new binary from the releases page, however wouldn't it be cooler to have a cli that can report about updates and update itself? -This has been done a load of time, however kleiner allows to do that at scale +This has been done many times, however kleiner allows to do that at scale since it's so damn easy to generate yet another cli and have it's distribution set up immediately. All you need to do is to add your commands and you're done. We don't need to have another tool for scaffolding, hence please have [cobra-cli](https://github.com/spf13/cobra-cli) -installed +installed. -Local cobra config was used using: +Dependencies: -``` -cobra-cli init --config .cobra.yaml -``` - -We won't be building binaries ourselves either, the will be done by [goreleaser](https://goreleaser.com/install) - -Be sure to have it [installed](https://goreleaser.com/quick-start/), also [generate](https://github.com/settings/tokens/new?scopes=repo,write:packages) a github token and put it -in `GITHUB_TOKEN` variable - -## Installation - -curl -L | sh +* [goreleaser](https://goreleaser.com/install) to build binaries for us +* git && github to keep the project and do releases +* go to build the project +* [`GITHUB_TOKEN`](https://github.com/settings/tokens/new?scopes=repo,write:packages) in the shell environment ## Installation -## Install Script +### Install Script Download `kleiner` and install into a local bin directory. @@ -47,7 +39,10 @@ Specific version: curl -L https://raw.githubusercontent.com/can3p/kleiner/main/generated/install.sh | sh -s 0.0.4 ``` -## Manual download +The script will install the binary into `$HOME/bin` folder by default, you can override this by setting +`$CUSTOM_INSTALL` environment variable + +### Manual download Get the archive that fits your system from the [Releases](https://github.com/can3p/kleiner/releases) page and extract the binary into a folder that is mentioned in your `$PATH` variable. @@ -57,6 +52,49 @@ extract the binary into a folder that is mentioned in your `$PATH` variable. The code is inspired a lot and uses parts of the [flyctl](https://github.com/superfly/flyctl) code. The files with the borrowings mention this explicitly. +## FAQ + +### Why is the project named kleiner? + +Because it's a cool dutch word! It also bears some similarity with CLI acronym + +### Why another scaffolding tool? + +I think it's useful to be able to be able to start shipping tools in the smallest possible stretch of time. +Kleiner will help you to get going with no strings attached - the shared code is small, you can move it to +your project and have it under your full control if you want. + +### Why cobra? + +Decisions are hard and to be frank most of the cli handling packages are just fine and any of them would do. +You're not tied to cobra in any way, all the included commands are just tiny wrappers that can be replaced +by the wrappers that use any other library. + +### Why github? + +I keep my projects on github and github gives a nice API to create releases and upload artifacts. It +should be dead easy to add support for gitlab or any other service with comparable feature set. + +### Why not proper packaging? + +Since all the building and packaging is done by goreleaser, you are free to build any packages it supports. +The purpose of the structure generated by klein is to specifically bypass traditional packaging solutions +in order to deliver instant updates. + +If you want to build a cool tool for your company or your friends, you don't want to waste a week trying to +build proper packages for the whole zoo of operating systems and architectures available, decide where +to host repositories and so on. + +### Why not setup CI? + +The idea is to have the simplest setup possible, local setup fits this scenario + +## TODO + +* Windows support +* Dependencies check (goreleaser, go) +* Make it possible to generate scaffolding for other git hostings + ## License Apache 2.0