2

I'm trying to use @hug.extend_api() for CLI routes but it's not working.

Calling hug -f run.py -c something, the command list is empty. The same code works fine for HTTP routing.

This is my main script (run.py):

import hug
from apitest import api


@hug.extend_api()
def apis():
    return [api]

This is apitest/api.py:

import hug


@hug.cli()  # cli route doesn't work
@hug.get('/')  # get route works fine
def root():
    return 'hello'
Eduardo Marinho
  • 446
  • 4
  • 14

0 Answers0