Skip to content
Edith

Docs

Command reference

ed machines snippets ls

Lists the saved commands a machine offers: the ones saved against it, plus every shared one. list is an accepted alias, and ls is the group's default, so ed machines snippets <machine> runs it. The group itself answers to snippet as well as snippets.

Output
ed machines snippets ls <machine> [--json]

Arguments

Name Type / values Default What it does
<machine> string, required none Machine name, ssh alias, id or unambiguous prefix.

Options

Name Type / values Default What it does
--json flag off Emit JSON on stdout instead of the table.
--help, -h flag off Print the help for this command on stdout and exit 0.

Snippets are numbered from 1 in the order they were saved. Nothing is sorted, and shared snippets sit in the same numbering as this machine's own:

Output
$ ed machines snippets ls devbox#  TITLE  SCOPE    COMMAND1  logs   machine  journalctl -xe --no-pager

A machine with none prints Devbox has no snippets on stderr and exits 0.

--json shape

JSON
[  {    "command": "journalctl -xe --no-pager",    "id": "F8D5CE93-C9B4-4A05-9109-9AEB1BD806BA",    "index": 1,    "sharedAcrossMachines": false,    "title": "logs"  }]

sharedAcrossMachines is true for a snippet with no machine of its own, which is the shared value in the SCOPE column.

Examples

Output
ed machines snippets ls devboxed machines snippets devboxed machines snippets ls devbox --json | jq -r '.[] | select(.sharedAcrossMachines) | .title'

Behaviour notes

Read only, straight out of snippets.json, with no connection opened. Run an entry by its displayed number with ed machines snippets run <machine> <index>.

Where to go next