From ef3c043f776060b7b2fd06c0a5c6b7a0b78dc016 Mon Sep 17 00:00:00 2001 From: Rob Prouse Date: Tue, 22 Oct 2024 17:02:19 -0400 Subject: [PATCH] Update README.md with pbpaste section --- README.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c6b0dc9f..0352ff736 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ - [Just use the Patterns](#just-use-the-patterns) - [Custom Patterns](#custom-patterns) - [Helper Apps](#helper-apps) +- [pbpaste](#pbpaste) - [Meta](#meta) - [Primary contributors](#primary-contributors) @@ -50,7 +51,7 @@ ## Updates -> [!NOTE] +> [!NOTE] September 15, 2024 — Lots of new stuff! > * Fabric now supports calling the new `o1-preview` model using the `-r` switch (which stands for raw. Normal queries won't work with `o1-preview` because they disabled System access and don't allow us to set `Temperature`. > * We have early support for Raycast! Under the `/patterns` directory there's a `raycast` directory with scripts that can be called from Raycast. If you add a scripts directory within Raycast and point it to your `~/.config/fabric/patterns/raycast` directory, you'll then be able to 1) invoke Raycast, type the name of the script, and then 2) paste in the content to be passed, and the results will return in Raycast. There's currently only one script in there but I am (Daniel) adding more. @@ -124,10 +125,10 @@ curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric # MacOS (arm64): curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-arm64 > fabric && chmod +x fabric && ./fabric --version -# MacOS (amd64): +# MacOS (amd64): curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-amd64 > fabric && chmod +x fabric && ./fabric --version -# Linux (amd64): +# Linux (amd64): curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 > fabric && chmod +x fabric && ./fabric --version # Linux (arm64): @@ -274,6 +275,8 @@ https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/syste ## Examples +> The following examples use the macOS `pbpaste` to paste from the clipboard. See the [pbpaste](#pbpaste) section below for Windows and Linux alternatives. + Now let's look at some things you can do with Fabric. 1. Run the `summarize` Pattern based on input from `stdin`. In this case, the body of an article. @@ -315,7 +318,7 @@ The wisdom of crowds for the win. You may want to use Fabric to create your own custom Patterns—but not share them with others. No problem! -Just make a directory in `~/.config/custompatterns/` (or wherever) and put your `.md` files in there. +Just make a directory in `~/.config/custompatterns/` (or wherever) and put your `.md` files in there. When you're ready to use them, copy them into: @@ -360,6 +363,29 @@ go install github.com/danielmiessler/fabric/to_pdf@latest Make sure you have a LaTeX distribution (like TeX Live or MiKTeX) installed on your system, as `to_pdf` requires `pdflatex` to be available in your system's PATH. +## pbpaste + +The [examples](#examples) use the macOS program `pbpaste` to paste content from the clipboard to pipe into `fabric` as the input. `pbpaste` is not available on Windows or Linux, but there are alternatives. + +On Windows, you can use the PowerShell command `Get-Clipboard` from a PowerShell command prompt. If you like, you can also alias it to `pbpaste`. If you are using classic PowerShell, edit the file `~\Documents\WindowsPowerShell\.profile.ps1`, or if you are using PowerShell Core, edit `~\Documents\PowerShell\.profile.ps1` and add the alias, + +```powershell +Set-Alias pbpaste Get-Clipboard +``` + +On Linux, you can use `xclip -selection clipboard -o` to paste from the clipboard. You will likely need to install `xclip` with your package manager. For Debian based systems including Ubuntu, + +```sh +sudo apt update +sudo apt install xclip -y +``` + +You can also create an alias by editing `~/.bashrc` or `~/.zshrc` and adding the alias, + +```sh +alias pbpaste='xclip -selection clipboard -o' +``` + ## Meta > [!NOTE]