Genie
Documentation

CLI & clipboard

The genie context command stores text against your account so it roams between machines. Optional flags also bridge your OS clipboard, and successful saves/loads fire a best-effort desktop notification.

Install

One line: the install URL becomes the configuration, so the CLI on disk talks to the cloud you curled it from. See the full /install flow for the device-code sign-in and manual (no-curl) path.

curl -fsSL https://api.genie.tech/install.sh | bash
genie auth login --device

Save a context

genie context save takes content from exactly one source: a positional string, --file PATH, --from-clipboard, or - (stdin). Mixing two sources is rejected: it exits non-zero rather than silently picking one. It prints the new context id (and the name, if you set one).

# Save text, prints the new context id
genie context save "deploy notes: bump worker concurrency to 8"

# Named pin: re-saving the same name overwrites it
genie context save --name release-checklist "1. tag  2. changelog  3. ship"

# Pin a file's contents
genie context save --file ./incident-postmortem.md

# Expiring pin: 1h / 30s / 7d / or bare seconds
genie context save --ttl 1h "one-time deploy token reminder"

# Read from stdin with -
git log --oneline -20 | genie context save -
  • --name <name>: a stable label you can fetch by later. Re-saving the same name overwrites the prior content.
  • --file <path>: pin the file's contents instead of a positional string.
  • --ttl <value>: expiring pin. Accepts 30s, 15m, 1h, 7d, or a bare number of seconds. A malformed value (e.g. 1hr) is an error, not a silent durable save.
  • -: read the content from stdin, so you can pipe into it.

Bridge the OS clipboard

Two independent flags connect genie context to your operating system clipboard:

  • -c / --clipboard on save or get: after the server confirms the operation, also copy the content to your OS clipboard.
  • --from-clipboard on save: read your OS clipboard and use it as the content. No positional argument is needed.
# Save AND copy the same content to your OS clipboard
genie context save -c "the snippet I want on both machines"

# Read the OS clipboard as the content (no positional argument)
genie context save --from-clipboard --name cb

The clipboard step is best-effort: if no OS helper is available the save still succeeds and a single warning is printed to stderr. Under the hood it shells out to the native helper for your platform, with no npm dependency:

  • macOS: pbcopy / pbpaste (ship with the OS).
  • Linux: wl-copy / wl-paste first, falling back to xclip. Install wl-clipboard (Wayland) or xclip (X11) if neither is present.
  • Windows: clip for write, powershell Get-Clipboard for read (ship with the OS).

Get a context

genie context get <id-or-name> prints the content to stdout (always newline-terminated, so piping stays clean). Add -c to also drop it on the OS clipboard.

# Fetch by id or by name, printed to stdout
genie context get release-checklist

# Fetch and also copy it to the OS clipboard
genie context get -c release-checklist

Desktop notifications

Every successful save and get fires a desktop notification when stdout is an interactive terminal. Pipelines and CI (non-TTY stdout) auto-suppress them. To silence them in interactive sessions too, set GENIE_NO_NOTIFY=1.

  • macOS: osascript display-notification.
  • Linux: notify-send (install libnotify-bin / libnotify if missing).
  • Windows: an inline PowerShell balloon tip (works on Win10+ without extra modules).
Notifications are best-effort, exactly like the clipboard step. A missing OS helper produces one stderr warning and never changes the command's exit code; the save or get itself still succeeded.

The cross-device shared clipboard

Combining --from-clipboard, a stable --name, and -c turns genie context into a clipboard that roams with your account. Add these two aliases on every machine:

# In ~/.bashrc / ~/.zshrc on every machine
alias gpush='genie context save --from-clipboard --name cb -c'
alias gpull='genie context get cb -c'

Why it works

  • gpush reads whatever you just copied (--from-clipboard), pins it under the fixed name cb, and re-copies it locally (-c).
  • gpull fetches that same cb pin and copies it to this machine's clipboard.
  • The stable --name cb is the whole trick: because re-saving a name overwrites it, cb is always your most-recent push, so gpull never needs an id and can be a single keystroke.

Bind gpush and gpullto OS hotkeys (e.g. a keyboard-shortcut tool or your terminal's key bindings) and copy-paste flows across laptops, SSH boxes, and VMs without a shared filesystem.

See also

Keeping the CLI itself current is a separate concern. See Auto-updates for how the binary stays up to date and how server-driven hints (gated by GENIE_HINTS_ENABLED) extend these side effects without a reinstall.