A command aliasing tool using symlinks and S-expression configuration.
ally [command]
ally provides command aliasing through symlinks. Commands are defined in an S-expression configuration file and executed when the binary is invoked under different names.
The tool operates in three modes:
- ally: Display help
- shim: Create symlinks for all configured aliases
- alias: Execute configured command (any other name)
Set the ALLY_CONF environment variable to specify the configuration file path.
Configuration uses S-expression syntax:
(config
(alias "ll" "ls -la")
(alias "gs" "git status")
(alias "gc" "git commit"))ALLY_CONF : Path to configuration file (required)
ALLY_SHIM_DIR
: Directory for symlink creation (required for automatic symlink creation)
ALLY_VERBOSE : Enable verbose output when set to "true"
SHELL : Shell to use for command execution (default: sh)
-
Create configuration file:
export ALLY_CONF=/path/to/config.conf -
Place executable in your
$PATH:mv ally ~/bin/ # if you have ~/bin in your $PATH
-
Create symlinks:
export ALLY_SHIM_DIR=/path/to/shims ally shim -
Use aliases:
ll /etc gs gc -m "commit message"
0: Success
1: Configuration error or unknown command
127: Command not found
Other exit codes are propagated from executed commands.
Configuration with arguments:
(config
(alias "build" "pnpm run build")
(alias "docker-ps" "docker ps --format table"))Execution passes additional arguments:
build # Executes: pnpm run build
docker-ps -a # Executes: docker ps --format table '-a'It works well with direnv.
Configure .envrc like this:
export ALLY_CONF=$(pwd)/.allyconf
export ALLY_SHIM_DIR=$(pwd)/.aliases
PATH=${PATH}:$ALLY_SHIM_DIRThen prepare configuration file:
(config
...)Finally set symlink and it works well:
ally shimRequires Scala Native. Use sbt for all build operations:
sbt compile # Compile source
sbt test # Run tests
sbt nativeLink # Build executable