The past few months I have been writing/vibe coding small tools and helpers. Naturally in Kotlin my language of choice.

Using this small wrapper script in the bin/ directory of the repository:

#!/usr/bin/env bash
# runs the project from anywhere, keeping $PWD as the app's working dir
set -euo pipefail
project="$(realpath $(dirname "$(realpath "${BASH_SOURCE[0]}")")/..)"
exec "$project/kotlin" run --project-dir "$project" -- "$@"

I can create a symlink from $HOME/bin to the checkout of the project and always run the latest version.

cd $HOME/bin
ln -s asdf $HOME/dev/asdf/bin/wrapper

And since $HOME/bin shows up pretty early in my $PATH variable, I can then just execute asdf anywhere and the current working directory will be preserved.