Suppose that you are in a directory containing a single Cabal package which you wish to build (if you haven’t set up a package yet check out developing packages for instructions). You can configure and build it using Nix-style local builds with this command (configuring is not necessary):

$ cabal v2-build

To open a GHCi shell with this package, use this command:

$ cabal v2-repl

To run an executable defined in this package, use this command:

$ cabal v2-run <executable name> [ executable args ]