register_commands() plugin hook, closes #1449

This commit is contained in:
Simon Willison 2021-08-27 18:39:42 -07:00
commit 30c18576d6
4 changed files with 109 additions and 1 deletions

View file

@ -79,6 +79,11 @@ def register_routes(datasette):
"""Register URL routes: return a list of (regex, view_function) pairs"""
@hookspec
def register_commands(cli):
"""Register additional CLI commands, e.g. 'datasette mycommand ...'"""
@hookspec
def actor_from_request(datasette, request):
"""Return an actor dictionary based on the incoming request"""