def METHOD_NAME(func):
    @click.pass_context
    def new_func(ctx, *args, **kw):
        runtime = ctx.obj
        if require_project and runtime.project_config is None:
            raise runtime.project_config_error
        if require_keychain:
            runtime._load_keychain()
        func(runtime, *args, **kw)
    return functools.update_wrapper(new_func, func)