diff --git a/airgql.cabal b/airgql.cabal
--- a/airgql.cabal
+++ b/airgql.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           airgql
-version:        0.7.1.1
+version:        0.7.1.2
 synopsis:       Automatically generate a GraphQL API for an SQLite database
 description:    AirGQL automatically generates a GraphQL API for SQLite databases.
                 It analyses the database schema
@@ -28,6 +28,11 @@
 extra-source-files:
     readme.md
 
+flag lib-only
+  description: Only build/install the library and not the CLI tool.
+  manual: True
+  default: False
+
 library
   exposed-modules:
       AirGQL.Config
@@ -169,6 +174,10 @@
     , wai-cors >=0.2.7 && <0.3
     , warp >=3.3.31 && <3.4
   default-language: Haskell2010
+  if flag(lib-only)
+    buildable: False
+  else
+    buildable: True
 
 test-suite airgql-test
   type: exitcode-stdio-1.0
