cabal-add

Extend Cabal build-depends from the command line

LTS Haskell 24.50:0.2@rev:1
Stackage Nightly 2026-07-16:0.2.1
Latest on Hackage:0.2.1

See all snapshots cabal-add appears in

BSD-3-Clause licensed by Bodigrim
Maintained by [email protected]
This version can be pinned in stack with:cabal-add-0.2.1@sha256:271df84390b8c35eec5a0462f69227a42b91624fbe9283dd3f4006123b06e43c,2382

Module documentation for 0.2.1

cabal-add Hackage Stackage LTS Stackage Nightly

Extend Cabal build-depends from the command line.

cabal-add does not have limitations of cabal-edit: it works on any sectioned Cabal file, supports stanzas and conditional blocks, and preserves original formatting.

Install the executable with

cabal install cabal-add

To add a dependency on foo, switch to a folder with your project and execute

cabal-add foo

If you are using Cabal 3.12+ which supports external commands, you can omit the dash:

cabal add foo

Command-line arguments:

  • --project-file FILE

    Set the path of the cabal.project file. Detect cabal.project or *.cabal in the current folder, if omitted.

  • ARGS

    Optional target (wildcards such as exe, test or bench are supported) to update, followed by a non-empty list of package(s) to add to build-depends section. Version bounds can be provided as well, use quotes to escape comparisons from your shell. E. g., 'foo < 0.2'.

Changes

0.2.1

  • Migrate the executable from cabal-install-parsers to cabal-install proper.
  • Do not attempt to rename entities inside comments.

0.2

  • Allow add not only dependencies, but also modules.
  • Allow to rename dependencies and modules.

0.1

  • Initial release.