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 --deviceSave 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. Accepts30s,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/--clipboardonsaveorget— after the server confirms the operation, also copy the content to your OS clipboard.--from-clipboardonsave— 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 cbThe 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 — no npm dependency:
- macOS —
pbcopy/pbpaste(ship with the OS). - Linux —
wl-copy/wl-pastefirst, falling back toxclip. Installwl-clipboard(Wayland) orxclip(X11) if neither is present. - Windows —
clipfor write,powershell Get-Clipboardfor 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-checklistDesktop 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 —
osascriptdisplay-notification. - Linux —
notify-send(installlibnotify-bin/libnotifyif missing). - Windows — an inline PowerShell balloon tip (works on Win10+ without extra modules).
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
gpushreads whatever you just copied (--from-clipboard), pins it under the fixed namecb, and re-copies it locally (-c).gpullfetches that samecbpin and copies it to this machine's clipboard.- The stable
--name cbis the whole trick: because re-saving a name overwrites it,cbis always your most-recent push —gpullnever needs an id, so it 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.