Good morning everyone!
I’ve started learning OCaml only recently, and I would like to share my OSS project with everyone:
I’ve been using
git for many years, and I came up with a workflow that works perfectly for me but it was tedious to type all the commands manually, and
.gitconfig aliases weren’t powerful enough. So I decided to package my workflow into a CLI tool. I also added prettier versions of some commands. Maybe you’ll enjoy them too
I started learning OCaml only recently; this is my first OSS project with OCaml. Before that, I was mostly using Haskell for the last 7 years. Still, I would greatly appreciate suggestions on improving the code, making it more idiomatic, utilizing OCaml tooling, and everything else. Feedback is welcome!
There’s still some work to be done in
zbg, so if you want to have fun and join the development, have a look at open issues.
This is a cool project, but what I really want is the details for your terminal prompt.
I’m using starship.rs for my terminal prompt. And here’s my
starship.toml config (currently supports only OCaml, Haskell and Rust languages).
What I especially like about this tool is that I don’t need to learn another shell like
fish to get pretty prompt. I can download a
starship executable to a directory inside my
$PATH, add a line to my
~/.bashrc and write a custom
starship.toml config, and it’ll work automagically!
Nice project! Will be trying it out over a few weeks (on my macOS; not sure if it works on Windows). I’ll be trying starship as well because it is cross-platform; two things I learned about today!
You may want to have something like the following instructions to help new users:
opam switch create x-zbg 4.14.0
opam pin --switch x-zbg -y 'git+https://github.com/chshersh/zbg.git#v0.1.0'
install -d ~/.local/bin
install -v "$(opam var --switch x-zbg bin)/zbg$(ocamlc -config-var ext_exe)" ~/.local/bin/zbg
(Wouldn’t it be nice if there was a
opamx git+https://github.com/chshersh/zbg.git#v0.1.0 or
dunex git+https://github.com/chshersh/zbg.git#v0.1.0 command that did the first two steps, just like npx?)
Also, you may want to consider using my https://github.com/diskuv/dkml-workflows to distribute native binaries. (There is also a static linking alternative floating around which works for Linux).
Thanks for these great suggestions! Always happy to learn from each other
Tbh, I’m still not too comfortable with the concept of switches in OCaml. I followed the installation instructions to get the compiler version 5.0.0 and been using it ever since. If you have any good recommendations of docs or articles to read, I’d be happy to hear from you!
I’m not sure
zbg even build with OCaml compiler version
4.14.0 but I believe it should be easy to test on CI.
dkml-workflows repo looks great! Indeed, I would like to distribute statically linked executables of
zbg eventually, but so far I’ve found only this blog post and haven’t read it thoroughly yet.