#Function Hooks

Bashly provides you with three general purpose hooks that let you inject your own code. To use a hook, simply create one of the files listed below in your src directory.

Hook FileDescription
src/initialize.shExecute code inside the initialize() function, which is called before anything else.
src/before.shExecute code before calling any command, but after processing the command line input.
src/after.shExecute code after calling any command.

Hooks Example

#Alternatives

These hooks should be considered last resort, for any functionality that is not covered by more native means.

Below is a list of some related features that can be used instead of using these hooks: