Categorygithub.com/simonski/kp
modulepackage
0.0.0-20240309070056-84548715b54f
Repository: https://github.com/simonski/kp.git
Documentation: pkg.go.dev

# README

KP

A terminal tool to manage key/pairs.

This is OSS - if you want to contribute please read the DEVELOPER_GUIDE.md.

Install

Install via go get

go get github.com/simonski/kp

This will install kp onto your $GOBIN. Please ensure $GOBIN is on your $PATH.

Setup

Once you've installed kp and can type kp version, you will need to configure kp.

kp verify

By default, kp stores keypairs to a ~/.kpfile. This can be controlled with the environment variable KP_FILE

Encryption

The ~/.kpfile itself is plaintext, the password is encrypted.

namepurposedefault value
KP_KEYFlename of private key~/.ssh/kp.id_rsa

Create your encryption key

ssh-keygen -b 2048 -t rsa -N "" -m pkcs8 -f ~/.ssh/kp.id_rsa

Or re-use one? - up to you:

export KP_KEY=~/path/to/id_rsa

Finally, confirm kp is setup properly:

kp verify

Assuming you get a "KP is setup correctly." message, you can then use kp in the following manner - if you don't, it will explain what needs changing in the verify command itself.

Usage

Store a key/value

kp put <keyname>
>> STDIN value

Retrieve the value of a key to your clipboard

kp get <keyname>

List all keys

kp ls

List all keys (including hidden)

kp ls -a

Search for an entry

kp ls widget

Update a key

kp update <key> 
 -type         "type"
 -url          "url"
 -username     "username"
 -description  "description"
 -notes        "notes"

Remove a key

kp rm <keyname>

Get help on any command:

kp

Hide a key

kp hide <keyname>

Show the key

kp show <keyname>

Environment variables

kp tries to run with sensible defaults. You can override them using the following envinronment variables:

namedescriptiondefault value
$KP_FILEThe file keypairs are stored~/.kpfile
$KP_KEYThe encryption key~/.ssh/kp.id_rsa
$KP_GUIRun in graphics mode (0 or 1)0

Releases

I use github actions to create a crossplatform release binary on a tag.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DoVerify performs verification of ~/.KPfile, encryption/decryption using specified keys.
No description provided by the author
Findfile looks in the current directory then "walks" upwards until it either finds a file matching the name or stops at $HOME If a file is not found, filename is returned as-is.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewKPDB constructor.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GLOBAL_USAGE - well, it tells me what to type.
KP_FILE the key for the env var pointint to the file we load/save.
KP_KEY the encypt/decrypt key.

# Variables

go:embed Buildnumber.

# Structs

DB is the thing that we serialise to JSON.
DBEntry represents the a single item in the DB.
No description provided by the author
KPDB helper struct holds the data and keys.