Superdesk CLI

In superdesk/server folder you can find manage.py file which you can use to run commands from CLI:

$ python manage.py

With no other argument it will output list of all available commands. To run specific command you use its name and any params needed:

$ python manage.py users:create -u admin -p admin

Creating new command

You can create new commands extending superdesk.Command and registering it using superdesk.command() call:

import superdesk

class HelloWorldCommand(superdesk.Command):

    option_list = [
        superdesk.Option('--name', '-n', required=True),
    ]

    def run(self, name):
        print('hello {}'.format(name))


superdesk.command('hello:word', MyCommand())

We use Flask-Script under the hood so you can get more info there.

Superdesk commands

app:clean_images

app:deleteArchivedDocument

app:index_from_mongo

app:initialize_data

app:flush_elastic_index

app:prepopulate

app:populate

app:rebuild_elastic_index

app:run_macro

app:scaffold_data

app:updateArchivedDocument

archive:remove_expired

audit:purge

content_api:remove_expired

data:generate_update

data:upgrade

data:downgrade

ingest:clean_expired

ingest:provider

ingest:update

publish:enqueue

publish:transmit

session:gc

schema:migrate

Storage Dumps and Records

Note

You can check Database Recording for details on how to use following storage:… commands.