diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2015 André Barnabá
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/extract-dependencies.cabal b/extract-dependencies.cabal
new file mode 100644
--- /dev/null
+++ b/extract-dependencies.cabal
@@ -0,0 +1,34 @@
+name:                extract-dependencies
+version:             0.1.0.0
+synopsis:            Given a hackage package outputs the list of its dependencies.
+homepage:            https://github.com/yamadapc/stack-run-auto/extract-dependencies
+license:             MIT
+license-file:        LICENSE
+author:              André Barnabá
+maintainer:          asakeron@gmail.com
+copyright:           2015 André Barnabá
+category:            Development
+build-type:          Simple
+cabal-version:       >=1.10
+
+executable extract-dependencies
+  hs-source-dirs:      src
+  main-is:             Main.hs
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  build-depends:       base >= 4.8 && < 5
+                     , async
+                     , containers
+                     , Cabal >= 1.22 && < 2
+                     , package-description-remote
+  default-language:    Haskell2010
+
+library
+  hs-source-dirs:      src
+  exposed-modules:     Development.ExtractDependencies
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  build-depends:       base >= 4.8 && < 5
+                     , async
+                     , containers
+                     , Cabal >= 1.22 && < 2
+                     , package-description-remote
+  default-language:    Haskell2010
diff --git a/src/Development/ExtractDependencies.hs b/src/Development/ExtractDependencies.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/ExtractDependencies.hs
@@ -0,0 +1,18 @@
+module Development.ExtractDependencies where
+
+import           Distribution.Package
+import           Distribution.PackageDescription
+import           Distribution.PackageDescription.Parse
+import           Distribution.PackageDescription.Remote
+
+extractDependencies :: String -> IO [String]
+extractDependencies npkg = do
+    ppkg <- getPackageLatest npkg
+    case ppkg of
+        ParseOk _ info ->
+            case condLibrary info of
+                Just lib -> return $ dependencyName <$> condTreeConstraints lib
+                Nothing -> error "Package is not a library"
+        _ -> error "Failed to parse package description"
+  where
+    dependencyName (Dependency name _) = unPackageName name
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
--- /dev/null
+++ b/src/Main.hs
@@ -0,0 +1,20 @@
+module Main where
+
+import           Control.Concurrent.Async
+import           Control.Monad
+import qualified Data.Set                        as Set
+import           Development.ExtractDependencies
+import           System.Environment
+
+main :: IO ()
+main = do
+    npkgs <- getArgs
+    deps <- mapConcurrently extractDependencies npkgs
+    forM_ (uniq (concat deps)) putStrLn
+  where
+      uniq = uniq' Set.empty
+        where
+          uniq' _ [] = []
+          uniq' x (y:ys) = if Set.member y x
+                           then uniq' x ys
+                           else y : uniq' (Set.insert y x) ys
