概要
Babashka CLIs
開発ツール計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルDescription
An assortment of handy Babashka CLIs: scripts and tasks. scripts strive to be compatible with Clojure.
Prerequisites
Babashka >= 1.13.219 is required.
Tasks
bb.edn contains global tasks i.e. tasks that are useful in any directory or project. To run these tasks from any directory, clone this repo and then use a shell function to reference the cloned directory:
function bbg() { BABASHKA_EDN=/path/to/this-repo/bb.edn bb --config
/path/to/this-repo/bb.edn $@ }
Run bbg tasks to see all the available tasks.
bbg can have task-specific completion thanks to the built-in bb completion. Here is my completion for it but note that it has my paths and would need to be updated to point to your path for this repo.
Scripts
Setup
Scripts are located in src/cldwalker/bb_clis/bin/. To install a script as a CLI, install bbin and then use it:
# For example, install logseq-graph-stats
$ bbin install https://github.com/cldwalker/bb-clis.git --as logseq-graph-stats --main-opts '["-m" "cldwalker.bb-clis.bin.logseq-graph-stats"]'
# Confirm that the CLI is installed
$ bbin ls
To install a different CLI, use different --as and --main-opts. If you're unsure of what to use for those values, see the :bbin/bin key in bb.edn.
If you want to install all scripts in this repo:
$ git clone https://github.com/cldwalker/bb-clis
$ bb bbin:install
Usage
See scripts.md which provides useful examples of several scripts.
Development
Code is organized as follows:
src/cldwalker/bb-clis/tasks/- Namespaces that are mainly run within babashka taskssrc/cldwalker/bb-clis/bin/- Namespaces that each represent a separate CLIsrc/cldwalker/bb-clis/cli/- Namespaces that are useful utils to CLIsrc/cldwalker/bb-clis/util/- Namespaces that are useful to any clojure or bb program, not just CLIs.
Misc bb tips
Preloads
Babashka supports $BABASHA_PRELOADS which allows arbitrary clojure to be run at the start of each invocation. This is handy for loading one's preferred set of vars and namespaces, especially when paired with an alias. For example, alias bbp="BABASHKA_PRELOADS='(load-file (str (System/getenv \"HOME\") \"/path/to/this-repo/preloads.clj\"))' bb"
Preloaded fns like pprint are then available on the commandline:
bbp '(->> (System/getenv) (into {}) pprint)'
License
See LICENSE.md
Additional Links
- For more bb setup and aliases, see my dotfiles repo
- See https://github.com/borkdude/babashka/blob/master/doc/examples.md for additional babashka cmd examples
関連プロジェクトを探す
読み込み中…