hoytech / strfry

a nostr relay
GNU General Public License v3.0
489 stars 96 forks source link

Document all the secret strfry commands #58

Open alexgleason opened 1 year ago

alexgleason commented 1 year ago

I am motivated to build a CLI wrapper around the ./strfry command in my strfry-policies repo so I can control strfry programatically. But only a few of the commands are actually documented in the README. It would be good to get a list of everything that exists.

hoytech commented 1 year ago

Good idea! I will try to do this at some point. For now that you can use the --help flag to get a list of commands. For example, at top level:

$ strfry --help
...
    dbutils commands:
      compact
      delete
      dict
      export
      import
      info
      monitor
      scan

    relay commands:
      relay

    mesh commands:
      stream
      sync

You can also get the list of sub-commands for a command like this:

$ strfry dict --help
...
    Usage:
      dict stats [--filter=<filter>]
      dict train [--filter=<filter>] [--limit=<limit>] [--dictSize=<dictSize>]
      dict compress [--filter=<filter>] [--dictId=<dictId>] [--level=<level>]
      dict decompress [--filter=<filter>]

This data is actually what strfry uses for parsing the command-lines, so it's guaranteed to be up-to-date and in-sync with what your binary supports.