Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Stack without a browser? List resolvers, search, etc.

Is there a way to use Stack as a proper command line tool without constantly trying to navigate and search in a browser on Stackage?

I often want to search for a tool that I might want to install globally to see what version, if any, is offered. Additionally, I sometimes want to see what resolver versions are available when considering upgrading a project.

As far as I can tell, this currently requires navigating to stackage.org, which is a very disruptive workflow. Have I overlooked some kind of search command?

like image 842
Karl Avatar asked Jul 13 '26 04:07

Karl


1 Answers

There is a soon-to-be-merged feature that will probably make it into the version after 1.6 https://github.com/commercialhaskell/stack/pull/3252 , it lists snapshots.

One option to see the latest snapshots is to use what stack build --resolver lts or --resolver nightly uses. You can also see what stack init chooses.

I don't think there are currently any direct ways to query what's in the snapshot from the CLI. One option would be to do stack build name-of-tool --dry-run, and it will tell you what would be installed.

Generally, yes, I think stack could do a better job of letting you query info. Some of it is tracked here - https://github.com/commercialhaskell/stack/issues/1614 . Please consider discussing design of such features on the issue tracker, and possibly implementing the features. That would be greatly appreciated and valuable to the community!

Also, you might like stack hoogle! Very handy for getting offline info / without web browser, but requires that you build everything with docs enabled.

like image 171
mgsloan Avatar answered Jul 15 '26 21:07

mgsloan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!