Package: halper
HalpHalp is a command line tool that reminds you how to use your custom shell commands. It finds aliases and functions from your dotfiles and indexes them so you can query them later. Simply typehalp <command>to see what it does orhalp --listto see all your custom commands.Point Halp at the appropriate dotfiles and it will index all your custom commands and add them to categories you specify. Then you can query it to find your commands and their usage.Key features:Understands your aliases, functions, and exported environment variablesCustomizable categoriesUses your inline comments to describe your commandsCustomizable regexes for matching commandsSQLite database used for fast queryingExplains builtin commands withTLDR pagesExplains builtin commands with options frommankier.comNote: To enable TLDR integration, you must have a TLDR client installed and in your PATH. I recommendTealDeerUsageRemind yourself what a command does (Your own aliases and functions or TLDR pages)halp<command>See full output of a commandhalp--full<command>List all your custom commandshalp--listView all commands in a particular categoryhalp--category<category>Index your dotfileshalp--indexHide commands that you don't want to seehalp--hide<commandID>,<commandID>,...Customize the description of a commandhalp--description<commandID>Edit the configuration filehalp--edit-configSearch for commands who's code matches a regex patternhalp--search-code<regexpattern>See all optionshalp--helpInstallationNote: Halp requires Python 3.10 or higher.Install withpipxpipxinstallhalperIf pipx is not an option, you can install Halp in your Python user directory.python-mpipinstall--userhalperFirst runBefore you can use Halp, you must firstCreate a configuration file by running `halp --edit-config``.Index your commands. You can do this by running `halp --index``.Known issuesDoes not associate comments with a command on the following lineIf your function is written with parentheses instead of curly braces, it will not be parsed. iefunc command() (some code)Does not resolve if statements. ieif [ -n "$BASH_VERSION" ]; then. Consequently, if a command is wrapped in an if statement, it will still be indexed. Use--hideto hide unwanted commands.Does not followsourceor.directives within filesTested on Bash and ZSH files only. Dotfiles for other shells may not work as expected.ConfigurationOn first run, a TOML configuration file will be created for you.IMPORTANT: You must add at least one path to thefile_globslist and then runhalp --index. Otherwise, no commands will be indexed.case_sensitive=false# Whether or not to match case sensitively with regexescommand_name_ignore_regex=''# Exclude commands who's names match this regexcomment_placement="BEST"# Where you place comments to describe your code. One of "BEST", "ABOVE", "INLINE"file_exclude_regex=''# Exclude files who's paths match this regexfile_globs=[]# Absolute path globs to files to parse for commandsuncategorized_name="uncategorized"# The name of the uncategorized category[categories]# Commands are matched against these categories[categories.example]name=""# The name of the categorycode_regex=''# Regex to match within the codecomment_regex=''# Regex to match a comment on the same line as an alias/function definition or a comment on the first line of a functiondescription=""# The description of this categorycommand_name_regex=''# Regex to match the name of the commandpath_regex=''# Regex to match the path of the fileHow halp finds descriptions for commandsThecomment_placementsetting determines where Halp looks for comments to describe your commands. It can be one of the following:BEST(default),ABOVE,INLINE. WhenBESTis used, Halp will look for comments in both places and use the inline comment when both are found.Here's how Halp looks for comments in each case:# Description                            <------ Abovealiascommand='some code'# Description  <------ Inline# Description                            <------ Abovefunccommand(){# Description                        <------ Inlinesomecode}ContributingSetup: Once per projectInstall Python 3.11 andPoetryClone this repository.git clone https://some.url/to/the/package.gitInstall the Poetry environment withpoetry install.Activate your Poetry environment withpoetry shell.Install the pre-commit hooks withpre-commit install --install-hooks.DevelopingThis project follows theConventional Commitsstandard to automateSemantic VersioningandKeep A ChangelogwithCommitizen.When you're ready to commit changes runcz cRunpoefrom within the development environment to print a list ofPoe the Poettasks available to run on this project. Common commands:poe lintruns all linterspoe testruns all tests with PytestRunpoetry add {package}from within the development environment to install a run time dependency and add it topyproject.tomlandpoetry.lock.Runpoetry remove {package}from within the development environment to uninstall a run time dependency and remove it frompyproject.tomlandpoetry.lock.Runpoetry updatefrom within the development environment to upgrade all dependencies to the latest versions allowed bypyproject.toml.