CLI frontend to the Cloogle API
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


cloogle-cli is a commandline frontend for the Cloogle API. At the moment, it supports the full API functionality plus some extra. This frontend talks directly to the CloogleServer as opposed to going through the PHP wrapper.


Simply run:

python install will be available in your path. This package is not yet avaliable through PyPI.

Usage [OPTIONS] <searchstring>

Some examples:

$ hd

Module              Function
------------------  --------------------------------------------
StdList             hd :: ([a] -> a)
Data.Tuple          appThd3 :: ((c -> d) (a, b, c) -> (a, b, d))
StdOverloadedList   Hd :: ((l e) -> e)
Data.Map            findWithDefault :: (a k (Map k a) -> a)
Data.IntMap.Strict  findWithDefault :: (a Int (IntMap a) -> a)

$ -U 'a -> String' ''

Module              Function
------------------  -------------------------------------------
genLibTest          show1 :: (a -> String)
GenPrint            printToString :: (a -> String)
Text.XML            toXMLString :: (a -> String)
Data.Serialization  serialize :: (a -> String)
Graphviz            digraphTitle :: (Digraph -> String)

$ catMaybes -m StdMaybe

Module    Function
--------  ----------------------------------------------------------
StdMaybe  catMaybes :: ([(Maybe a)] -> [a])
StdMaybe  mapMaybe :: ((x -> y) (Maybe x) -> (Maybe y))
StdMaybe  mapMaybe :: ((x -> y) (Maybe x) -> (Maybe y))
StdMaybe  accMaybe :: ((St x a) (Maybe x) -> ((Maybe a), (Maybe x)))
StdMaybe  listToMaybe :: ([a] -> (Maybe a))

Available options

  • -u --url URL: supply a custom API URL (default: "")
  • -p --port PORT: supply a custom API port (default: 31215)
  • -m --modules MODULE [MODULE [..]]: filters results on given module (WARNING: this is case sensitive). Note that when using this argument, argparse must have some way of deciding which values belong to it. Use last in your commands to be safe.
  • -U --unify FUNCSIG: function type to unify (e.g. a a -> Int will unify to String String -> Int)
  • -n --maxitems MAXITEMS: max number of items to display
  • -v --verbose: used to set the logger output level

cloogle-cli supports different output formats:

  • --table: tabulated output of search results
  • --minimal: minimal listing of results


Create aliases to reduce the length of commands! As an example:

alias ccls=clooglecli -n 999 -m

This allows you to easily list all functions for a certain module, or multiple:

$ ccls StdList
$ ccls StdList StdInt StdMaybe