Skip to content

Instantly share code, notes, and snippets.

@dcastro
Last active January 30, 2022 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcastro/2ad9b9a886997a82ef6482ed8cd1bb04 to your computer and use it in GitHub Desktop.
Save dcastro/2ad9b9a886997a82ef6482ed8cd1bb04 to your computer and use it in GitHub Desktop.
coffer example log
$ cabal run exe:coffer -- create diogo/google-work \
  --field user:dcastro@serokell.com \
  --field pw:123 \
  --field url:www.google.com

[SUCCESS] Entry created at '/diogo/google-work'

$ cabal run exe:coffer -- create diogo/google-home \
  --field user:mypersonalemail@google.com \
  --field pw:456 \
  --field url:www.google.com

[SUCCESS] Entry created at '/diogo/google-home'

$ cabal run exe:coffer -- create diogo/github \
  --field user:mypersonalemail@google.com \
  --field pw:789 \
  --field url:www.github.com

[SUCCESS] Entry created at '/diogo/github'
$ cabal run exe:coffer -- view /
/
  diogo/
    github - [TAGS] - 2022-01-30T17:02:51.238220618Z
      user: mypersonalemail@google.com - 2022-01-30T17:02:51.238220618Z
      pw: 789                          - 2022-01-30T17:02:51.238220618Z
      url: www.github.com              - 2022-01-30T17:02:51.238220618Z
    google-home - [TAGS] - 2022-01-30T17:02:16.846468722Z
      user: mypersonalemail@google.com - 2022-01-30T17:02:16.846468722Z
      pw: 456                          - 2022-01-30T17:02:16.846468722Z
      url: www.google.com              - 2022-01-30T17:02:16.846468722Z
    google-work - [TAGS] - 2022-01-30T17:02:11.110566922Z
      user: dcastro@serokell.com - 2022-01-30T17:02:11.110566922Z
      pw: 123                    - 2022-01-30T17:02:11.110566922Z
      url: www.google.com        - 2022-01-30T17:02:11.110566922Z
$ cabal run exe:coffer -- view / pw      
/
  diogo/
    github - [TAGS] - 2022-01-30T17:02:51.238220618Z
      pw: 789 - 2022-01-30T17:02:51.238220618Z
    google-home - [TAGS] - 2022-01-30T17:02:16.846468722Z
      pw: 456 - 2022-01-30T17:02:16.846468722Z
    google-work - [TAGS] - 2022-01-30T17:02:11.110566922Z
      pw: 123 - 2022-01-30T17:02:11.110566922Z
$ cabal run exe:coffer -- find /diogo --sort user:value:asc --filter-field url:value~google
/
  diogo/
    google-work - [TAGS] - 2022-01-30T17:02:11.110566922Z
      user: dcastro@serokell.com - 2022-01-30T17:02:11.110566922Z
      pw: 123                    - 2022-01-30T17:02:11.110566922Z
      url: www.google.com        - 2022-01-30T17:02:11.110566922Z
    google-home - [TAGS] - 2022-01-30T17:02:16.846468722Z
      user: mypersonalemail@google.com - 2022-01-30T17:02:16.846468722Z
      pw: 456                          - 2022-01-30T17:02:16.846468722Z
      url: www.google.com              - 2022-01-30T17:02:16.846468722Z
$ cabal run exe:coffer -- find --help
Usage: coffer find [PATH] [TEXT] [--sort SORT] [--filter FILTER] 
                   [--filter-field FILTERFIELD]
  Find and list entries, optionally filtering

Available options:
  -h,--help                Show this help text
  PATH                     If specified, only show entries within this path (use
                           `/` to find everything)
  TEXT                     The text to search for in the paths and tags of
                           entries
  --sort SORT              Sort the entries inside each directory.
                           Expected format is:
                            * to sort by entry name: 'name:<direction>',
                            * to sort by the entry's last modified date: 'date:<direction>',
                            * to sort by a field's value: '<fieldname>:value:<direction>',
                            * to sort by a field's last modified date: '<fieldname>:date:<direction>'.
                           Direction can be 'asc' or 'desc'.
                           Examples: 'name:desc', 'password:date:asc'.
  --filter FILTER          Filter entries.
                           Expected format is: 'name~<substring>' or `date<op><date>`.
                           <op> can be '<=', '>=', '<', '>', or '='.
                           <date> can be 'YYYY', 'YYYY-MM', 'YYYY-MM-DD', or 'YYYY-MM-DD HH:MM:SS'.
                           Examples: 'name~vault', 'date>2020-02'.
  --filter-field FILTERFIELD
                           Filter entries based on a field.
                           Expected format is: '<fieldname>:value~<substring>' or `<fieldname>:date<op><date>`.
                           <op> can be '<=', '>=', '<', '>', or '='.
                           <date> can be 'YYYY', 'YYYY-MM', 'YYYY-MM-DD', or 'YYYY-MM-DD HH:MM:SS'.
                           Examples: 'value~vault', 'date>2020-02'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment