Skip to content
Alfred workflow for running alias and functions in ~/.bash_profile
PHP Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Bash profile commands.alfredworkflow
README.md
alfred.png
functions.php
info.plist
run.php
test.php
test_sample.sh

README.md

Alfred bash profile workflow

This workflow enable Alfred run alias or functions that come from ~/.profile, ~/.zprofile, ~/.bash_profile and ~/my_bash/profile.sh (Common bash profile alias and functions template).

Install

Download and install the workflow in alfred.

Run

Type >

The workflow will auto display alias and functions from profiles. E.g. Alfred bash cmd

Add custom comment for alfred to read

You may need to add comment tags for your alias or functions in profiles for alfred to read with following format:

#alfred; command: XXX ; parameters: XXX or 'none', ('none' means no parameter); description: XXX

Where keyword

'command' is alias or function name.
'parameters' is alias or function parameters. If it doesn't have parameters, you need to give 'none'.
'description' is alias or function description.

Note

  1. If there has duplicate alias or function names, Alfred only display first one.
  2. Custom comment tag has higher priority then alias and functions.
  3. Support display recommendations from keyword in camelcase, underscore and hyphen.
  4. Add comment and parameter hint in alias functions as following:
    # Moves a file to the MacOS trash
    # parameters: path (or var: path | none)
    trash () { command mv "$@" ~/.Trash ; }
    
  5. Can define function parameters as 'parameters:', 'var:', 'parameter'. If function parameter contain 'none', so it will not require to have parameter.
  6. Start with _ for ignoring indexing in alfred. E.g. Inner function.

Test

In workflow source folder, run command:

# display alfred workflow output
php run.php help

# run some tests
php test.php 
You can’t perform that action at this time.