Command Line InterfaceΒΆ

Sosse provides a sosse-admin command that is based on the Django management command. It can be called with sosse-amdin help, to list all commands available, and sosse-admin help <command> to get help a specific command. The help for Sosse specific commands is also provided below:

clear_html_archive:

Clears archived HTML snapshots.

usage: sosse-admin clear_html_archive [-h]

options:
  -h, --help  show this help message and exit

convert_screens_to_jpeg:

Convert all PNG screenshots to JPEG format.

usage: sosse-admin convert_screens_to_jpeg [-h] [--dry-run]

options:
  -h, --help  show this help message and exit
  --dry-run   Show what would be done without actually converting

crawl:

This command starts one or multiple crawlers, depending on the crawler count option set in the configuration file.

usage: sosse-admin crawl [-h] [--one-shot] [--collection COLLECTION] [urls ...]

positional arguments:
  urls                  Optionnal list of URLs to add to the crawler queue.

options:
  -h, --help            show this help message and exit
  --one-shot            Quit when the queue is empty.
  --collection COLLECTION
                        Collection ID to use for URLs added to the queue.

default_admin:

Creates a default admin superuser with admin password, does nothing if at least one user already exists in the database.

usage: sosse-admin default_admin [-h]

options:
  -h, --help  show this help message and exit

default_conf:

Outputs default configuration file to stdout.

usage: sosse-admin default_conf [-h]

options:
  -h, --help  show this help message and exit

delete_documents:

Mass delete documents.

usage: sosse-admin delete_documents [-h] [--dry-run] [-i] [--exclude EXCLUDE] url regex

positional arguments:
  url regex

options:
  -h, --help         show this help message and exit
  --dry-run          Prints the count of documents that would be deleted.
  -i, --ignore-case  Case insensitive matching.
  --exclude EXCLUDE  Regex pattern to exclude URLs from deletion.

dumpdata_sosse:

Output the contents of the database as a fixture of the given format (using each model’s default manager unless –all is specified).

usage: sosse-admin dumpdata_sosse [-h] [--format FORMAT] [--indent INDENT]
                      [--database DATABASE] [-e EXCLUDE] [--natural-foreign]
                      [--natural-primary] [-a] [--pks PRIMARY_KEYS]
                      [-o OUTPUT]
                      [app_label[.ModelName] ...]

positional arguments:
  app_label[.ModelName]
                        Restricts dumped data to the specified app_label or
                        app_label.ModelName.

options:
  -h, --help            show this help message and exit
  --format FORMAT       Specifies the output serialization format for
                        fixtures.
  --indent INDENT       Specifies the indent level to use when pretty-printing
                        output.
  --database DATABASE   Nominates a specific database to dump fixtures from.
                        Defaults to the "default" database.
  -e, --exclude EXCLUDE
                        An app_label or app_label.ModelName to exclude (use
                        multiple --exclude to exclude multiple apps/models).
  --natural-foreign     Use natural foreign keys if they are available.
  --natural-primary     Use natural primary keys if they are available.
  -a, --all             Use Django's base manager to dump all models stored in
                        the database, including those that would otherwise be
                        filtered or modified by a custom manager.
  --pks PRIMARY_KEYS    Only dump objects with given primary keys. Accepts a
                        comma-separated list of keys. This option only works
                        when you specify one model.
  -o, --output OUTPUT   Specifies file to which the output is written.

extract_doc:

Displays code-defined documentation on stdout.

usage: sosse-admin extract_doc [-h] {conf,cli,se}

positional arguments:
  {conf,cli,se}  "conf" for the configuration file, "cli" for the CLI, "se"
                 for search engines

options:
  -h, --help     show this help message and exit

generate_secret:

Generates a secret key that can be used in the Configuration file.

usage: sosse-admin generate_secret [-h]

options:
  -h, --help  show this help message and exit

load_se:

Loads a External search engine shortcuts from an OpenSearch Description formatted XML file.

Most search engines provide such a file, defined in the HTML of their web page. It can be found inside a <link> element below the <head> tag, for example Brave Search defines it as:

<link rel="search" type="application/opensearchdescription+xml" title="Brave Search" href="https://cdn.search.brave.com/opensearch.xml">
usage: sosse-admin load_se [-h] opensearch_file

positional arguments:
  opensearch_file  OpenSearch Description formatted XML file.

options:
  -h, --help       show this help message and exit

queue_status:

Display the crawling queue status.

usage: sosse-admin queue_status [-h] [--format {text,json}]

options:
  -h, --help            show this help message and exit
  --format {text,json}  Output format (text or json)

update_mime:

This updates MIME handlers in the database based on their definition in the filesystem.

usage: sosse-admin update_mime [-h]

options:
  -h, --help  show this help message and exit

update_se:

This updates External search engine shortcuts in the database based on their definition in the source code.

usage: sosse-admin update_se [-h]

options:
  -h, --help  show this help message and exit