Access collections in Middleman console

I’m using Middleman 4.1.11.

Is it possible to access collections (described in the Upgrading to Middleman 4 guide) in the console?

I have defined a collection named :articles in my config.rb and I tried this:

$ bundle exec middleman console
[1] pry(#<Middleman::Application>)> collection(:articles)
NoMethodError: undefined method `collection' for #<Middleman::Application:0x70213557097120>
Did you mean?  caller_locations
from (pry):1:in `__pry__'
[2] pry(#<Middleman::Application>)> sitemap.collection(:articles)
NoMethodError: undefined method `collection' for #<Middleman::Sitemap::Store:0x007fb7bc2d8978>
Did you mean?  caller_locations
from (pry):2:in `__pry__'

I can use collection(:articles) in my templates so the error shouldn’t be with the collection itself.

Answering myself: I don’t know if there is a more convenient way, but this, however clunky, works inside the console:

extensions[:collections].collector_value(:articles)

Hello @ole

Great news! You find yourself the anwser :smiley:
Just to complete for other users, sometimes I use the gem better_error