cabal-add: Extend Cabal build-depends from the command line

[ bsd3, development, library, program ] [ Propose Tags ] [ Report a vulnerability ]

Extend Cabal build-depends from the command line. It works on any sectioned Cabal file, supports stanzas and conditional blocks, and preserves original formatting.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.2
Change log CHANGELOG.md
Dependencies base (<5), bytestring (<0.13), Cabal (>=3.8 && <3.15), cabal-add, cabal-install-parsers (>=0.4.1 && <0.7), Cabal-syntax (>=3.8 && <3.15), containers (<0.9), directory (<1.4), filepath (<1.6), mtl (<2.4), optparse-applicative (>=0.16 && <0.20), process (<1.7) [details]
Tested with ghc ==9.12.2, ghc ==9.10.2, ghc ==9.8.4, ghc ==9.6.7, ghc ==9.4.8
License BSD-3-Clause
Author Bodigrim
Maintainer [email protected]
Category Development
Source repo head: git clone https://github.com/Bodigrim/cabal-add.git
Uploaded by Bodigrim at 2025-06-16T20:14:02Z
Distributions LTSHaskell:0.1, Stackage:0.2
Executables cabal-add
Downloads 384 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-06-16 [all 1 reports]

Readme for cabal-add-0.2

[back to package description]

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'.