Bash script utilities package to help developing Alfred workflows in command lines.
###Install
- Download the package to a dedicated scripts folder.
- Make sure this folder has been added to
$PATH
. - Put
source /your/path/to/this/package/config.sh
in.bashrc
,.zshrc
or other shell config files to enablecdwf
command.
###Command
-
createwf -- create a new alfred workflow
- Usage:
createwf workflow-name
- Description:
- A folder and an
info.plist
file will be generated for this new workflow in Alfred's directory system. This process is the same asAlfred -> Workflows -> + -> Blank Workflow
. - Workflow's attributes, which are name / bundleid / author / readme / website, are based on
workflow-name
and default setting inAlfred -> Workflows -> + -> Workflow Defaults...
.
- A folder and an
- Usage:
-
cdwf -- cd to the workflow folder
- Usage:
cdwf [-c|-d] [workflow-name|bundle-id]
- Description:
- Changing folder to workflow directory based on
workflow-name
orbundle-id
. If there is aninfo.plist
file in current folder, this command will also bring you to the corresponding workflow directory. When workflow cannot be found, you will be brought to~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows
. - -c Instead of workflow directory, changing directory to workflow cache folder under
~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data
- -d Instead of workflow directory, changing directory to workflow data folder under
~/Library/Application Support/Alfred 2/Workflow Data
.
- Changing folder to workflow directory based on
- Usage:
-
syncwf -- two way synchronization between current directory and workflow directory
- Usage:
syncwf -gp [-f] [-o rsync-options [-a]] [workflow-name|bundle-id]
- Description:
- Update content between current and workflow directory with
rsync
- -g (Get) Copy content from workflow directory to the current one.
- -p (Put) Copy content from current directory to the workflow one.
- -f (Force Mode) Synchronize without confirmation.
- -o (Options) Use custom options for
rsync
. Defalutrsync
options are-av --update --delete --exclude=.* --exclude-from=.gitignore
. - -a (Options) Append custom options to the default one instead of replacement.
- -n (Dry run) Show what would have been transferred by
rsync
. - [workflow-name|bundle-id] Use
workflow-name
,bundle-id
orinfo.plist
file (if exists in current folder) to determine the path of workflow directory. Another way is to read path from pipeline directly, e.g.echo $path_of_workflow_directory | syncwf
.
- Update content between current and workflow directory with
- Usage:
-
findwf -- print the path to workflow based on
workflow-name
,bundle-id
orinfo.plist
(if exists in current folder)- Usage:
findwf [workflow-name or bundle-id]
- Usage:
###Copyright and Licensing
- All code and documents are licensed under MIT