pennyworth

From their README

(toc) macro (toclevels) 5 :figure-caption!:

(bash_link) link:https://www.gnu.org/software/bash[Bash] (ruby_version_managers_link) link:https://www.alchemists.io/articles/ruby_version_managers[Ruby Version Manager]

= Pennyworth

Pennyworth is a command line interface and the perfect companion to link:https://www.alfredapp.com[Alfred]. With Pennyworth, you can unlock the full potential of the Ruby language by leveraging a modern version of Ruby through Alfred Workflows. Perfect for when you want to advance beyond the basic workflows Alfred provides by default.

toc::[]

== Features

== Screencast

video::https://www.alchemists.io/videos/projects/pennyworth/demo.mp4[poster=https://www.alchemists.io/images/projects/pennyworth/demo.png,width=706,height=632,role=focal_point]

== Requirements

. link:https://www.apple.com/macos[macOS] . {bash_link} . link:https://www.alfredapp.com[Alfred] . link:https://www.alfredapp.com/purchase[Alfred Powerpack] . link:https://www.ruby-lang.org[Ruby]

While using a {ruby_version_managers_link} is not a hard requirement, it is strongly encouraged since a version manager will give you the freedom to toggle between different Ruby versions since this gem has strict Ruby version requirements (especially in regards to using a modern version of Ruby).

All of the workflows, scripts, examples for this gem use {bash_link} syntax. That said, if you are comfortable with translating Bash syntax to your shell syntax of choice, you can make this gem work in different shells too. That is beyond the scope of this document, though, so leave that exercise up to you.

== Setup

To install, run:

[source,bash]

gem install pennyworth

When using the --git_hub CLI option, you'll want to supply your GitHub login and link:https://github.com/settings/tokens[Personal Access Token] with at least read access via the following environment variables:

[source,bash]

GITHUB_API_LOGIN= GITHUB_API_TOKEN=

You can configure these environment variables via link:https://direnv.net[direnv] if using the CLI or through the link:https://www.alfredapp.com/help/workflows/advanced/variables/#environment[Alfred Workflow Environment].

⚠️ When using Alfred Workflow environment variables, please ensure you check the Don't Export option for these variables so you don't expose your credentials when exporting/sharing workflows with others.

== Usage

=== Command Line Interface (CLI)

From the command line, type pennyworth to view usage:

.... Pennyworth - A command line interface that augments Alfred workflows.

USAGE: -c, --config ACTION Manage gem configuration. Actions: edit || view. --encodings Render Alfred encodings script filter. --git_hub Render Alfred GitHub repositories script filter. -h, --help Show this message. --http_statuses Render Alfred HTTP statuses script filter. --ruby_gems Render Alfred RubyGems script filter. --standard_errors Render Alfred standard errors script filter. --system_errors Render Alfred system errors script filter. --system_signals Render Alfred system signals script filter. --text CONTENT Render Alfred text script filter. -v, --version Show gem version.

GITHUB OPTIONS: --organization [HANDLE] Set organization. Default: "". --user [HANDLE] Set user. Default: "".

RUBYGEMS OPTIONS: --owner [HANDLE] Set owner. Default: "". ....

The following demonstrates how to use Pennyworth from the CLI or within an Alfred Script Filter:

[source,bash]

pennyworth --config edit pennyworth --config view

pennyworth --encodings

pennyworth --git_hub --organization alchemists pennyworth --git_hub --user bkuhlmann

pennyworth --http_statuses pennyworth --ruby_gems --owner bkuhlmann pennyworth --standard_errors pennyworth --system_errors pennyworth --system_signals

pennyworth --text demo pennyworth --text "An Example"

While the command line options are nice, the real power comes from using Pennyworth in conjunction with link:https://www.alfredapp.com/help/workflows/inputs/script-filter/json[Alfred Script Filters]. Without having Alfred wired up to consume the CLI output, you'll only get a JSON in your console. To explain better, continue reading or skip ahead to the Workflows section.

=== Customization

This gem can be configured via a global configuration:

.... ~/.config/pennyworth/configuration.yml ....

It can also be configured via link:https://www.alchemists.io/projects/xdg[XDG] environment variables.

The default configuration is as follows:

[source,yaml]

(alfred) (preferences) (inflections)

  • "Bkuhlmann": "bkuhlmann"
  • "Dry Auto Inject": "Dry AutoInject"
  • "Dry Cli": "Dry CLI"
  • "Flacsmith": "FLACsmith"
  • "Git Plus": "Git+"
  • "Http Fake": "HTTP Fake"
  • "Mac Os Config": "macOS Configuration"
  • "Mac Os": "MacOS"
  • "Pkce": "PKCE"
  • "Prawn Plus": "Prawn+"
  • "Rubocop Ast": "Rubocop AST"
  • "Rubocop Md": "Rubocop Markdown"
  • "Rubocop Rspec": "Rubocop RSpec"
  • "Tty Box": "TTY Box"
  • "Tty Color": "TTY Color"
  • "Tty Command": "TTY Command"
  • "Tty Config": "TTY Config"
  • "Tty Cursor": "TTY Cursor"
  • "Tty Editor": "TTY Editor"
  • "Tty File": "TTY File"
  • "Tty Font": "TTY Font"
  • "Tty Link": "TTY Link"
  • "Tty Logger": "TTY Logger"
  • "Tty Markdown": "TTY Markdown"
  • "Tty Option": "TTY Option"
  • "Tty Pager": "TTY Pager"
  • "Tty Pie": "TTY Pie"
  • "Tty Platform": "TTY Platform"
  • "Tty Progressbar": "TTY ProgressBar"
  • "Tty Prompt": "TTY Prompt"
  • "Tty Reader": "TTY Reader"
  • "Tty Screen": "TTY Screen"
  • "Tty Spinner": "TTY Spinner"
  • "Tty Table": "TTY Table"
  • "Tty Tree": "TTY Tree"
  • "Tty Which": "TTY Which"
  • "Xdg": "XDG" (git_hub) (api_url) "https://api.github.com" (organization) (user) (http) (statuses) (url) "https://developer.mozilla.org/docs/Web/HTTP/Status" (ruby_gems) (api_url) "https://rubygems.org/api/v1" (owner)

Feel free to take this default configuration, modify, and save as your own custom configuration.yml.

=== Themes

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/alchemists-theme.png[Alchemists Theme,width=706,height=632,role=focal_point]

The above is shared as the link:https://www.alfredapp.com/extras/theme/FSz9kjN1wX[Alchemists Alfred Theme] which can be link(alfred)//theme/?t=eyJhbGZyZWR0aGVtZSI6eyJyZXN1bHQiOnsidGV4dFNwYWNpbmciOjEwLCJzdWJ0ZXh0Ijp7InNpemUiOjEyLCJjb2xvclNlbGVjdGVkIjoiI0Q2RDZENkZGIiwiZm9udCI6IkhlbHZldGljYSIsImNvbG9yIjoiI0Q2RDZENkZGIn0sInNob3J0Y3V0Ijp7InNpemUiOjE2LCJjb2xvclNlbGVjdGVkIjoiI0ZGRkZGRkZGIiwiZm9udCI6IkhlbHZldGljYSIsImNvbG9yIjoiI0ZFRkNGRkZGIn0sImJhY2tncm91bmRTZWxlY3RlZCI6IiNBMDI2MThGRiIsInRleHQiOnsic2l6ZSI6MTYsImNvbG9yU2VsZWN0ZWQiOiIjRkZGRkZGRkYiLCJmb250IjoiSGVsdmV0aWNhIiwiY29sb3IiOiIjRTFERURFRkYifSwiaWNvblBhZGRpbmdIb3Jpem9udGFsIjo1LCJyb3VuZG5lc3MiOjAsInBhZGRpbmdWZXJ0aWNhbCI6NiwiaWNvblNpemUiOjQwfSwic2VhcmNoIjp7ImJhY2tncm91bmRTZWxlY3RlZCI6IiNCMkQ3RkZGRiIsInBhZGRpbmdIb3Jpem9udGFsIjo4LCJzcGFjaW5nIjoxMCwidGV4dCI6eyJzaXplIjozNiwiY29sb3JTZWxlY3RlZCI6IiMwMDAwMDBGRiIsImZvbnQiOiJIZWx2ZXRpY2EiLCJjb2xvciI6IiNGRkZGRkZGRiJ9LCJiYWNrZ3JvdW5kIjoiIzEyMTIxMkZGIiwicm91bmRuZXNzIjowLCJwYWRkaW5nVmVydGljYWwiOjJ9LCJ3aW5kb3ciOnsiY29sb3IiOiIjNzAwQTAwRkYiLCJwYWRkaW5nSG9yaXpvbnRhbCI6MTAsIndpZHRoIjo2MjAsImJvcmRlclBhZGRpbmciOjEwLCJib3JkZXJDb2xvciI6IiMwMDAwMDAzRiIsImJsdXIiOjAsInJvdW5kbmVzcyI6MTIsInBhZGRpbmdWZXJ0aWNhbCI6MTB9LCJjcmVkaXQiOiJCcm9va2UgS3VobG1hbm4iLCJzZXBhcmF0b3IiOnsiY29sb3IiOiIjMDAwMDAwNjYiLCJ0aGlja25lc3MiOjJ9LCJzY3JvbGxiYXIiOnsiY29sb3IiOiIjMDAwMDAwNjYiLCJ0aGlja25lc3MiOjJ9LCJuYW1lIjoiQWxjaGVtaXN0cyJ9fQ==[installed directly].

=== Workflows

Not all workflows require Pennyworth to run properly (see the Other section below for details). For the workflows that do require Pennyworth support, the following assumptions are made:

  1. Your link:https://www.alchemists.io/projects/dotfiles[Dotfiles] are configured to use {bash_link} and load your environment appropriately. Bash is not a hard requirement, though. You can use any shell you are comfortable with as long as you teach Alfred to load your development environment before running the Alfred Workflow.
  2. You have the latest version of Alfred, Ruby, and Pennyworth installed.
  3. You are using a {ruby_version_managers_link} which ensures Ruby is on your load path. As mentioned in the Requirements section above, this is not a hard requirement so if you have the correct version of Ruby required by this gem on your path, that'll work too.

With the above requirements in mind, the following sections document how to download and install all Pennyworth workflows that are compatible with Alfred. Should you want to tweak any of these workflows, you'd only need to edit an existing workflow or build your own with these settings:

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/script_filter.png[Script Filter,width=776,height=635,role=focal_point]

Before diving into each workflow, I want to highlight that the following capabilities are available to all workflows depending on what kind of item is currently selected within the Alfred UI:

==== Alchemists

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/alchemists-projects.png[Alchemists Projects,width=706,height=632,role=focal_point]

Provides quick access to link:https://www.alchemists.io[Alchemists] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/alchemists.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

==== Dry RB

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/dry-gems.png[Dry Gems,width=706,height=632,role=focal_point]

Provides quick access to link:https://dry-rb.org[Dry RB] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/dry.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

==== RuboCop

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/rubocop-projects.png[Rubocop Projects,width=706,height=632,role=focal_point]

Provides quick access to link:https://docs.rubocop.org/rubocop[RuboCop] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/rubocop.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

==== Ruby

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby.png[Ruby workflow screenshot,width=706,height=632,role=focal_point]

Provides quick access to link:https://www.ruby-lang.org[Ruby] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/ruby.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

==== Other

The following workflows don't require this gem to use but are provided for convenience in case they are of aid to your own productivity.

===== Acronyms

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/acronyms.png[Acronyms workflow screenshot.,width=1001,height=610,role=focal_point]

Expands acronyms so you can think and type in terms of an acronym but appear as if you typed out the full definition each time.

  1. link:https://www.alchemists.io/public/alfred/workflows/acronyms.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Alpine

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/alpine.png[Alpine Linux workflow screenshot.,width=706,height=632,role=focal_point]

Provides quick access to link:https://www.alpinelinux.org[Alpine Linux] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/alpine.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Applications

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/applications.png[Applications workflow screenshot.,width=706,height=362,role=focal_point]

Launches your engineering environment but can be tweaked to your preferences. Using Alfred in this manner ensures your machine boots quickly so you have more control over what is launched.

  1. link:https://www.alchemists.io/public/alfred/workflows/applications.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Bash

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/bash.png[Bash workflow screenshot.,width=706,height=362,role=focal_point]

Provides quick access to link:https://www.gnu.org/software/bash[Bash] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/bash.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Bio

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/bio.png[Bio workflow screenshot.,width=706,height=200,role=focal_point]

Provides biographical calculations and information.

  1. link:https://www.alchemists.io/public/alfred/workflows/bio.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Browsers

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/browsers.png[Browsers workflow screenshot.,width=706,height=308,role=focal_point]

Provides quick access to browser resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/browsers.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Bundler

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/bundler.png[Bundler workflow screenshot.,width=706,height=524,role=focal_point]

Provides quick access to link:https://bundler.io[Bundler] related resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/bundler.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Circle CI

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/circle_ci.png[Circle CI workflow screenshot.,width=706,height=416,role=focal_point]

Provides quick access to link:https://circleci.com/[Circle CI] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/circle_ci.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Crystal

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/crystal.png[Crystal workflow screenshot.,width=706,height=632,role=focal_point]

Provides quick access to link:https://crystal-lang.org[Crystal] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/crystal.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== CSS

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/css.png[CSS workflow screenshot.,width=706,height=470,role=focal_point]

Provides quick access to link:https://www.w3.org/Style/CSS/specs.en.html[CSS] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/css.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Docker

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/docker.png[Docker workflow screenshot.,width=706,height=470,role=focal_point]

Provides quick access to link:https://www.docker.com[Docker] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/docker.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Elm

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/elm.png[Elm workflow screenshot.,width=706,height=470,role=focal_point]

Provides quick access to link:https://elm-lang.org[Elm] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/elm.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== GitHub

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/github.png[GitHub workflow screenshot.,width=706,height=632,role=focal_point]

Provides quick access to link:https://github.com[GitHub] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/github.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Hanami

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/hanami.png[Hanami workflow screenshot.,width=706,height=632,role=focal_point]

Provides quick access to link:https://hanamirb.org[Hanami] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/hanami.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Jitsi

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/jitsi.png[Jitsi workflow screenshot.,width=706,height=254,role=focal_point]

Provides quick access to link:https://jitsi.org[Jitsi] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/jitsi.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== macOS

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/mac_os.png[macOS workflow screenshot.,width=706,height=200,role=focal_point]

Provides quick access to macOS resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/mac_os.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Rack

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/rack.png[Rack workflow screenshot.,width=706,height=470,role=focal_point]

Provides quick access to link:https://github.com/rack/rack[Rack] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/rack.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== RSpec

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/rspec.png[RSpec workflow screenshot.,width=706,height=362,role=focal_point]

Provides quick access to link:https://rspec.info[RSpec] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/rspec.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Ruby on Rails

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby_on_rails.png[Ruby on Rails workflow screenshot.,width=706,height=524,role=focal_point]

Provides access to link:https://https://rubyonrails.org[Ruby on Rails] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/ruby_on_rails.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Slack

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/slack.png[Slack workflow screenshot.,width=706,height=524,role=focal_point]

Provides quick access to link:https://slack.com[Slack] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/slack.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== SSL

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ssl.png[SSL workflow screenshot.,width=706,height=362,role=focal_point]

Provides quick access to SSL resources for the security conscious.

  1. link:https://www.alchemists.io/public/alfred/workflows/ssl.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Terraform

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/terraform.png[Terraform workflow screenshot.,width=706,height=632,role=focal_point]

Provides quick access to link:https://www.terraform.io[Terraform] resources.

  1. link:https://www.alchemists.io/public/alfred/workflows/terraform.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

===== Text

image:https://www.alchemists.io/images/projects/pennyworth/screenshots/text.png[Text workflow screenshot.,width=1000,height=610,role=focal_point]

Provides general text manipulation utilities beyond the Pennyworth powered text macro which is part of the Ruby workflow (mentioned earlier).

  1. link:https://www.alchemists.io/public/alfred/workflows/text.alfredworkflow[Download] and double click to install.
  2. Click on Configure Workflow to configure the workflow and view documentation.

=== Troubleshooting

  • link:https://github.com/ruby/psych[Psych] 4.0.0 has a link:https://github.com/ruby/psych/issues/490[bug] which prevents loading of YAML configurations that use symbols as keys. If you get caught by this, please upgrade to Psych 4.0.1 for the fix.
  • When your Alfred Workflow yields no output, you might want to open the link:https://www.alfredapp.com/help/workflows/utilities/debug[Alfred Debugger], rerun your workflow, and check for errors. You can also jump to the CLI and run Pennyworth directly.
  • If you get GitHub authorization errors, make sure you have defined the appropriate credentials (mentioned earlier) for both within your shell where you are running Pennyworth or within the Alfred Workflow environment.

== Development

To contribute, run:

[source,bash]

git clone https://github.com/bkuhlmann/pennyworth cd pennyworth bin/setup

You can also use the IRB console for direct access to all objects:

[source,bash]

bin/console

=== Architecture

The following documents the workflow used to process all actions from Alfred.

image::https://www.alchemists.io/images/projects/pennyworth/doc/architecture.svg[Architecture Diagram]

== Tests

To test, run:

[source,bash]

bundle exec rake

== link:https://www.alchemists.io/policies/license[License]

== link:https://www.alchemists.io/policies/security[Security]

== link:https://www.alchemists.io/policies/code_of_conduct[Code of Conduct]

== link:https://www.alchemists.io/policies/contributions[Contributions]

== link:https://www.alchemists.io/projects/pennyworth/versions[Versions]

== link:https://www.alchemists.io/community[Community]

== Credits