Skip to content

edit

Changes one item.

Terminal window
sefy edit <REFERENCE> [OPTIONS]
Option Applies to Meaning
--title <TITLE> all New title.
-t, --text <TEXT> notes New body.
-e, --editor notes Open the current body in $EDITOR.
--set <NAME=VALUE> records Set a field. Repeat for several.
--set-secret <NAME> records Prompt for a field’s value and mark it secret.
--unset <NAME> records Remove a field.
--tag <TAG> all Replace the item’s tags.
--clear-tags all Remove every tag.
Terminal window
$ sefy edit bank --title "bank card"
updated 1

A record — a login, a card, an SSH key — is a set of named fields, and --set writes one of them:

Terminal window
sefy edit mail --set url=https://mail.example.com
sefy edit mail --set login=someone@example.com --set notes="work account"

A field the record does not have yet is added, which is how a record grows past what its kind suggested:

Terminal window
sefy edit "deploy key" --set fingerprint=SHA256:…

A value passed this way is public: it has already been through the shell history, so calling it secret would be a promise sefy cannot keep. A field that already exists keeps whatever secrecy it was stored with — changing a password’s value does not expose it.

For a value that must stay off the command line, --set-secret asks for it the way the master password is asked for, and marks the field secret:

Terminal window
$ sefy edit mail --set-secret password
New value for password:
updated 2

--unset removes a field. A record cannot be left with none — an item with no contents is a rm in disguise:

Terminal window
$ sefy edit mail --unset url
updated 2

An item’s kind is fixed for its lifetime: a note stays a note. To change kind, add a new item and remove the old one.

Flags meant for another kind are an error rather than a silent no-op:

Terminal window
$ sefy edit bank --set login=someone
error: this item is a note; --set, --set-secret and --unset apply to records

An edit that would change nothing is an error too, so a mistyped flag cannot look like a successful save:

Terminal window
$ sefy edit "bank card"
error: nothing to change; pass --title, --tag, or a field to edit

A change to a note’s text or a record’s fields keeps what it replaced as a version of the item — history lists them and restore brings one back. A new title or new tags are labels, not contents, and keep nothing: renaming an item is not something to go back from.

--tag sets the item’s tags to exactly what you list — it does not append. To add one tag to an item that has two, name all three.

A tag left on no items disappears from tags by itself; there is nothing to clean up by hand.

--editor opens the current body in $VISUAL, or $EDITOR if that is unset; a value carrying its own arguments (EDITOR="code --wait") works. With none set, sefy says so rather than opening something you did not ask for.

While the editor is open, the note sits in a temporary file in the clear. sefy overwrites and deletes that file as soon as the editor exits, but an editor’s own swap, undo and backup files are its business and outside sefy’s reach. If that matters for a particular note, use --text.

  • add — the fields each kind carries
  • rm — removing an item instead
  • history — what an edit replaced