Alpaca is a command line utility for building Alfred workflow bundles.
An alpaca project is an alpaca.yml file that defines the workflow, alongside any supporting files, such as scripts or images.
Note: Alpaca is still in the proof-of-concept phase. Huge portions of Alfred functionality are unimplemented.
Contents
Download the latest release, or:
$ go get github.com/jclem/alpacaPack an Alpaca project into an Alfred workflow. The workflow will be output into the current directory.
$ alpaca pack .This workflow uses a trigger "say" to say words passed as arguments. For example, the user might type "say hello world" into Alfred.
name: Say
objects:
trigger:
type: keyword
config:
keyword: say
argument: required
then: say
say:
type: script
config:
script:
content: say {query}
type: bashnameThe name of the projectversionThe version of the projectauthorThe author of the project (i.e.Jonathan Clem <jonathan@example.com>)bundle-idThe Alfred workflow bundle IDdescriptionA short description of the workflowreadmeA longer description of the workflow, seen when users import iturlA homepage URL for the workflowiconA project-relative path to an icon to use for the worflowvariablesA map of variable names and their default valuesobjectAn map of objects in the Alfred workflow. Each key is an object name.
iconA project-relative path to an icon for the objecttypeThe type of object this is. Currently partial support exists for:configA type-specific configuration object, see each type schema for detailsthenA string, list of strings, or a list of objects representing other objects to connect to, each objects having this schema:objectThe name of the object to connect to
cache(bool, defaulttrue) Whether to cache the compiled AppleScriptcontent(string) The content of the AppleScript
text(string, default"{query}") The text to copy to the clipboard—use"{query}"for the exact query
keyword(string) The keyword that triggers this objectwith-space(bool, defaulttrue) Whether a space is required with this objecttitle(string) The title of the objectsubtitle(string) The subtitle of the objectargument(string) A string determining whether an argument is required. One of:requiredThe argument is requiredoptionalThe argument is optionalnoneNo argument is accepted
url(string) The URL to open. Use"{query}"for the exact query
scriptA script configuration object
argument(string) A string determining whether an argument is required. One of:requiredThe argument is requiredoptionalThe argument is optionalnoneNo argument is accepted
argument-trim(string) Whether to trim the argument's whitespace. One of:autoArgument automatically trimmedoffArgument not trimmed
escaping([]string) A list of strings to escape in the query text, if the script object'sarg-typeisquery. Any of:spacesbackquotesdouble-quotebracketssemicolonsdollarsbackslashes
ignore-empty-argument(bool) Whether an empty argument (whenarg-typeisargvin script config) is omitted fromargv(whenfalse, it will be an empty string)keyword(string) The keyword that triggers this objectrunning-subtitle(string) A subtitle to display while this filter runssubtitle(string) A subtitle for this objecttitle(string) A title for this objectwith-space(bool, defaulttrue) Whether a space is required with this objectalfred-filters-resultsAn object describing how Alfred filters results (it does not if this is omitted):mode(string) The mode Alfred uses to filter results. One of:exact-boundaryexact-startword-match
run-behaviorAn object describing behavior of the script runimmediate(bool) Whether to run immediately always for the first character typedqueue-mode(string) A mode for how script runs are queued. One of:waitWait for previous run to completeterminateTerminate previous run immediately and start a new one
queue-delay(string) A delay mode for queueing script runs. One of:immediateNo delayautomaticAutomatic after last character typed100ms100ms after last character typed200ms200ms after last character typed300ms300ms after last character typed400ms400ms after last character typed500ms500ms after last character typed600ms600ms after last character typed700ms700ms after last character typed800ms800ms after last character typed900ms900ms after last character typed1000ms1000ms after last character typed
scriptA script configuration object
There are a few types of script schemas possible, in addition to these options:
This version executes the script at the given path (it must be executable).
path(string) The path to the script
This version executes an inline script.
arg-type(string) The way the argument is passed to the script. One of:queryInterpolated as (query)argvPassed into process arguments
content(string) The content of the scripttype(string) The type of script, one of:bashphprubypythonperlzshosascript-asosascript-js