Keepaste

Keepaste

The Keep & Paste Application

Complete Tutorial


Managing Keeps

A 'Keep' is a phrase you wish to keep (duh...) and paste somewhere later on.

Managing keeps is pretty straight forward, just right-click on any node on the tree to reveal the context-menu and possible options.

There are 2 types of nodes -
1. Keep Node - holding the actual Keep, will have an icon with the first letter of the phrase and distinguished color.
2. Keep-Group Node - holding a set of other Keeps and Keep-Groups, will have an icon of a folder.

context menu
Right-clicking on a Keep node will allow you to -
  • Execute with refreshed parameters - Will clear any saved values for global parameters and ask for those again.
  • Edit... - Edit the Keep.
  • Export Keep... - Export the selected Keep.
  • Delete - Delete the selected Keep.
Right-clicking on a Keep-Group node will allow you to -
  • Rename... - Rename the group.
  • Add group... - Add another group under the selected group.
  • Add Keep... - Add a Keep under the selected group.
  • Import Keeps... - Import Keeps from a JSON file.
  • Export Keeps... - Export all Groups and Keeps under the selected Group into a JSON file (to share or for backup).
  • Delete Group - Delete the selected group.

On the Keep editing dialog (see image below), you will have the following fields -

  • Name (mandatory) is a friendly name to be set as the text on the Keep node.
  • Description is a friendly description for you to understand what on earth you meant to do here.
  • Keep (mandatory) is the actual phrase you with to paste somewhere later on.
  • Parameters are the set of parameters in case you use any as part of your phrase.
  • Do not trigger 'Enter' after pasting - For different reasons, one may also choose to never have Keepaste simulate pressing the 'Enter' key after pasting this Keep's phrase anywhere (regardless the Flow settings, see below).
edit keep dialog

Executing a Keep

While normally working on your computer, you move between different windows, a Keep will be pasted on the currently worked-on window.

You know which window is considered the target window by looking at the bottom bar on the Keepaste window. It will show both the application name and its title (in case you're working on multiple windows of the same application). active window
Note: for Windows users, one can also enable locking on a specific target window of an application, regardless the currently worked-on window.

Now, let's say you have a Keep which holds a command-line command, and your active window is a terminal of some sort, by double-clocking on that Keep node Keepaste will switch to the active-window, paste your Keep's phrase and will press 'Enter' automatically. It will actually execute the command for you, you don't need to remember the syntax or anything else.
You should be warned though, that it is quite addictive...

You should not try to remember anything, by hovering with your mouse pointer over a Keep node you will see a tooltip with all the information for that Keep.
tooltip

Working with Parameters

In order to take the full advantage out of Keepaste, make sure you're aware of this strong feature, a Keep shouldn't always be a static one, meaning, a simple text phrase representing a command.

Think about having a command where you can dynamically change some of its parameters, good examples could be AWS EC2 instances names, S3 buckets and objects, Kubernetes namespaces and resources names, different environments, Docker images and containers, etc.

Setting a parameter is easy, when creating a Keep you can set a parameter inside triangular brackets holding the name for it and define as needed on the Parameters table when editing a Keep.

In the below image, we can see an example of a free-text parameter named some-name, notice that the Keep field holds a phrase containing "some-name" in triangular-brackets. This will tell Keepaste that this part of the phrase is dynamic, and it should go to the Parameters definitions to know how to handle this parameter. The parameter is defined on the Parameters table at the bottom of the dialog, notice the empty "Parameter value" field for the 'some-name' parameter, this makes 'some-name' a free-text parameter.
parameter

There are 3 types of Keep Parameters -
  1. Free Text
    An input dialog will be shown to the user to insert the desired parameter value (use-case examples: filenames, new resources names, etc.). To set it, on the Edit Keep Dialog, the 'Parameter Value' for that parameter should be left blank.
  2. A set of Predefined Values to choose from
    A dialog with a dropdown to choose from will be shown to the user (use-case examples: environment names, predefined namespaces etc.). To set it, the 'Parameter Value' should be set as [Option1,Option2,...].
  3. Command
    Write any command to be executed before pasting the Keep and have the output lines or JSON array represented as a dropdown to choose from (use-case examples: AWS resources, K8S namespaces or pod names, etc.). This is a very powerful feature to exploit and as time goes by you will see there are vast opportunities to use it.
If you haven't done so, it is recommended to go over the Quick Tutorial to better understand parameters. You can also download some examples from the Keeps Library and import those to your Keepaste to use.

Global Parameters
Any parameter can be marked as Global, this means that once set, its value will be kept when other Keeps holding that parameter name will be executed.
Think about a parameter which should be the same across multiple Keeps, instead of setting the same value over and over again, you set it only at the first time. The value ("tbtest" in the below image) is shown on the Keep tooltip when hovering over a Keep node with Global parameters, those will be also marked in Blue.
global parameters

In order to change the value of an already set Global parameter, right-click on a Keep node and select Execute with refreshed parameters.

Settings

Flow

When executing a Keep, the full flow is as follows -

  1. Copy Keep to clipboard.
  2. Focus on target window and paste.
  3. Press 'Enter'

In some cases one may choose to change the Keep execution flow, a good example could be working on a delicate environment (production?) and you want to be more careful by not allowing Keepaste to actually press 'Enter' to execute any of the Keeps, only pasting them.
Or even being more careful by only copying the Keep to the Clipboard (aka. no pasting on target window nor pressing 'Enter'), you will paste it whenever and wherever you want.

Changing the flow can be done from the top menu under Settings > Flow.

Themes

An app that respects its users must have this option, change between Light and Dark themes under Settings > Themes.

$PATH (only on Mac)

When working with Keep command-parameters on Mac, as those are being executed behind the scenes for you by Keepaste, then it should have the proper PATH variable set to hold the paths to relevant command line tools which are used as part of command-parameters.

You will identify when the $PATH is not set correctly or missing a path if when running a Keep that holds a command-parameter, you see a result which is unexpected such as "command not found" or similar when a dialog to select a desired value for that command-parameter.

For example: if you're using Kubectl or aws command line tools as part of your Keep parameters, then the PATH should hold the paths to where these command line tools reside on your machine, which are normally "/usr/local/bin/kubectl" and "/opt/homebrew/bin/aws".

The quickest way to set your path is to open your favorite terminal you usually use, and which has everything already working and run the following command - "echo $PATH", then just copy the output and paste into the $PATH settings on Keepaste.

Toggle Locking (only on Windows)

This should be enables when you wish Keepaste to only execute your Keeps on the current active-window. It will stop intercepting any other active windows as long as Locking is toggled on.

Example: Let's say you only use Keepaste for executing Keeps on your beloved terminal window, in this case, you can select Toggle Locking once your terminal window is the target-window on Keepaste. From now on, any of your Keeps will only execute on that terminal window.