Home

Awesome

ChipiChat: LaunchBar🥂ChatGPT

A LaunchBar action to interact with the ChatGPT API. Responses are received directly in LaunchBar and can be browsed, opened, previewed with Quick Look, inserted, or sent to another action. Conversation history is preserved for context. Responses are cached on disk. Understands keyword modifiers and commands. ChatGPT system messages are configurable via personas. Requires an OpenAI API key.

Demo

Usage

Open ChipiChat in LaunchBar, hit the spacebar, enter a command or message, then hit return to send it to ChatGPT.

The input will be taken from the clipboard if no text is entered into LaunchBar. This enables a powerful workflow to quickly pass text through ChatGPT.

As an example, here’s how you can send text on the clipboard to ChatGPT using the rewrite persona, and immediately insert the response into the frontmost document (watch a screencast of this):

  1. Select and copy text in a document.
  2. Invoke ChipiChat.
  3. Type rewrite and hit ⇧ ↵.
  4. ChatGPT’s response replaces the selected text.

Response manipulation

Keyword modifiers

Prefix your message with one-or-more modifiers for enhanced functionality:

You can combine modifiers, e.g., “code copy 4 js uuid function” sends “js uuid function” to GPT-4 API with the code persona and copies the response. All modifiers must go at the beginning of the message.

Commands

Manage conversation history, settings, and personas by sending commands to ChipiChat:

Installation

Prerequisite: you must have LaunchBar installed.

Get an OpenAI API key

Before you can use ChatGPT, you must get an OpenAI API key:

  1. Create an OpenAI account.
  2. Add a credit card in Account → Billing → Payment methods.
  3. Create a new secret API key.

Install ChipiChat

  1. Download ChipiChat.lbaction.zip from releases.
  2. Unzip it, and double-click the resulting ChipiChat.lbaction file to install (or manually move it into ~/Library/Application Support/LaunchBar/Actions/).
  3. (optional) If you get this warning message, run the following command in Terminal.app to remove the Gatekeeper quarantine attribute:
xattr -d com.apple.quarantine ~/Library/Application\ Support/LaunchBar/Actions/ChipiChat.lbaction
  1. Open LaunchBar and type cc to invoke ChipiChat.
  2. Hit the spacebar, type config set api_key YOURAPIKEYHERE, and hit return to save your API key in LaunchBar:

config set api_key yourkeyhere

(Alternatively, you can use export OPENAI_API_KEY="…" in your shell profile.)

Now you’re ready to use ChipiChat!

Usage example

Invoke ChipiChat, hit the spacebar, then type a message and hit return:

Example Message

After a couple seconds, you receive the response:

Response

That’s a bit hard to read because not all the response text is visible, but if you press the right-arrow key, you can view it as a list:

Response As List

Or, you can view it in Quick Look (press the left-arrow key to go back, then press ⌘ Y or ⌃ ↵):

Response As Quick Look

ChipiChat has many features and myriad customizable options. Practice all the commands listed in usage and adjust the configuration options until ChipiChat works exactly how you want it to.

Updating

  1. Run the version command to check for new versions.
  2. Download the new ChipiChat.lbaction.zip file from releases, unzip it, and double-click it to install.
  3. Read the change log on the release page, which may have special instructions such as a requirement to run config reset after updating.

Personas

Use a persona to set the overall behavior of the assistant. Create your own or use one of the predefined personas (changelog, code, commit, complete, condense, expand, fix, list, reply, rewrite, safe, summarize, write). A default persona is used if no persona is specified when you send a message.

Manage personas with these commands:

The SYSTEM_MESSAGE is the system message that is included with the request to ChatGPT that influences the behavior of the assistant.

As an example, to create a persona named “Pierre” which translates user messages to French:

persona set pierre Translate the user message to French

To use a persona, add the persona’s NAME to the beginning of your message. So, to use the Pierre persona, just write “pierre retirement in france must be amazing” and the assistant will respond, “La retraite en France doit être incroyable.” The persona can be combined with other keyword modifiers, e.g., “copy list mexican zombie films” to use the list persona and copy the results to the clipboard automatically.

Configuration

The following options can be changed using the config set OPTION VALUE command. For example, to change the default_action:

config set default_action quicklook

To view currently-set values, send the config list command.

To reset all configuration options to default, send the config reset command.

Options

Default actions

Use the default_action and default_action_auto options to customize your preferred interface for receiving responses.

Set default_action_auto to true to automatically open the default action without needing to press return after receiving a response.

Tips

If you use a Quick Look plugin that formats markdown with syntax highlighting (such as Peek), these settings will open every response in Quick Look:

config set filename_extension md
config set default_action quicklook
config set default_action_auto true

The best settings to carry on a conversation is to use LaunchBar alerts, which has a Reply button:

config set default_action alert
config set default_action_auto true

The open and insert actions are best for generating content, such as generating blog posts or emails.

The open and quicklook actions are best for generating code. Also press the right-arrow on a response to view it as a list of items, then copy–paste just the few lines that you need.

Remember, you can override the default action behavior by holding command, shift, or control when you hit return to open, insert, or Quick Look the response.

Press the right-arrow to view a response as a list with icons representing parts of Markdown content (<img src="docs/icons/bug.svg" alt="🐞" style="width:1em;height:1em;vertical-align:-0.15em;box-shadow:none;background:none;margin:0;page-break-before:unset;"> for code, <img src="docs/icons/genderless.svg" alt="⚫️" style="width:1em;height:1em;vertical-align:-0.15em;box-shadow:none;background:none;margin:0;page-break-before:unset;"> for ordered list, <img src="docs/icons/caret-right.svg" alt="▶️" style="width:1em;height:1em;vertical-align:-0.15em;box-shadow:none;background:none;margin:0;page-break-before:unset;"> for unordered list, and <img src="docs/icons/comment.svg" alt="💬" style="width:1em;height:1em;vertical-align:-0.15em;box-shadow:none;background:none;margin:0;page-break-before:unset;"> for all other text).

If you’re annoyed that LaunchBar remains on the screen while waiting for a response, turn on hiding: config set hide true.

Alternatives

Support

Contact me on Twitter, the Fediverse, or create a GitHub issue.

Do you find this free software useful? Say thanks with a coffee!


ChipiChat icon