Add Commands in Middleman 4 extensions

Hi,

I tried to use a middleman 3 extension, that extended middleman cli to have new commands, in middleman’s v4 tag versions without success.

I looked at the middleman v3.3.7 spec (3rd_party_cli.feature) and also tried that (without success either):

Feature: Allow config.rb and extensions to add CLI commands

Scenario: Command autoloaded from tasks/ directory
Given an empty app
And a file named “tasks/hello_task.rb” with:
“”"
class Hello < Thor
desc “hello”, “Say hello”
def hello
puts “Hello World”
end
end
“”"
When I run middleman hello
Then the output should contain “Hello World”

In middleman 4 specs I didn’t find any spec saying how should we do this.

  1. Does middleman 4+ support cli command extensions?
  2. If yes, how should we do it?

Thank you,
Vasco