diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,63 @@
+# runhs
+
+Stack wrapper for single-file Haskell programs.
+
+Declare package dependencies in the source code of your single-file Haskell program. Easily and reliably run your program, compile it, or load it in GHCi or Ghcid.
+
+
+## Install
+
+1. First, install [Stack](https://haskellstack.org).
+
+2. Add Stack's install directory to your `PATH`.
+
+  * **Windows:** Installing Stack automatically adds its install directory to your `PATH`.
+
+  * **Most Linux:** `echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ~/.profile && export PATH="${HOME}/.local/bin:${PATH}"`
+
+  * **MacOS Pre-Catalina:** `echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ~/.bash_profile && export PATH="${HOME}/.local/bin:${PATH}"`
+
+  * **MacOS Catalina and newer:** `echo 'export PATH="${HOME}/.local/bin:${PATH}"' >> ~/.zshrc && export PATH="${HOME}/.local/bin:${PATH}"`
+
+3. Finally, install _runhs_: ~~`stack install runhs`.~~ Download the appropriate executable for your platform from the [Releases page](https://github.com/friedbrice/runhs/releases/).
+
+
+## Usage
+
+Add a block comment (the _front matter_) at the start of any single-file Haskell program in the following format:
+
+```
+{-
+resolver: lts-16.6
+packages:
+  - bytestring
+  - containers
+-}
+```
+
+The front matter must be the first block comment in your file, and the comment delimiters `{-` and `-}` must appear on their own lines, just as above.
+
+The `resolver` property is required and must be a valid [Stackage resolver](https://www.stackage.org/snapshots). The `packages` property is required if your Haskell program depends on external packages, but may be omitted if your Haskell program does not.
+
+Once you have the appropriate front matter at the top of your file, you may load your program in _Watch Mode_ or in _Interactive Mode_ (a.k.a. _REPL Mode_) in GHCi, or run your program as a script, or compile your program, using the following command format.
+
+```
+runhs (watch|repl|script|compile) <file> [<args>]
+```
+
+
+## Copyright and License
+
+Copyright Daniel Brice (c) 2020
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+  * Neither the name of Daniel Brice nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/runhs.cabal b/runhs.cabal
new file mode 100644
--- /dev/null
+++ b/runhs.cabal
@@ -0,0 +1,33 @@
+cabal-version: 2.2
+
+name: runhs
+version: 1.0.0.3
+synopsis: Stack wrapper for single-file Haskell programs.
+description:
+  Stack wrapper for single-file Haskell programs.
+  Declare package dependencies in the source code of your single-file Haskell program.
+  Easily and reliably run your program, compile it, or load it in GHCi or Ghcid.
+category: Tools
+homepage: https://github.com/friedbrice/runhs#readme
+bug-reports: https://github.com/friedbrice/runhs/issues
+author: Daniel Brice
+maintainer: danielbrice@gmail.com
+copyright: 2020 Daniel Brice
+license: BSD-3-Clause
+license-file: README.md
+build-type: Simple
+
+source-repository head
+  type: git
+  location: https://github.com/friedbrice/runhs
+
+executable runhs-exe
+  main-is: Main.hs
+  hs-source-dirs: src
+  build-depends:
+      base >=4.11 && <5
+    , bytestring >=0.10.8.2 && <1
+    , file-embed >=0.0.10.1 && <1
+    , process >=1.6.3.0 && <2
+    , yaml >=0.8.32 && <1
+  default-language: Haskell2010
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
--- /dev/null
+++ b/src/Main.hs
@@ -0,0 +1,101 @@
+{-
+resolver: nightly
+packages:
+  - bytestring
+  - file-embed
+  - process
+  - yaml
+-}
+{-# LANGUAGE ImplicitParams, OverloadedStrings, TemplateHaskell #-}
+
+module Main (main) where
+
+import Control.Monad (void)
+import Data.ByteString.Char8 (pack)
+import Data.FileEmbed (embedStringFile)
+import Data.Foldable (fold, toList)
+import Data.Yaml (Value, decodeThrow, parseMaybe, withObject, (.:), (.:?))
+import GHC.Exception (CallStack)
+import System.Environment (getArgs)
+import System.Exit (exitWith)
+import System.IO (BufferMode(NoBuffering), hSetBuffering, stdout)
+import System.Process (CreateProcess, createProcess, proc, waitForProcess)
+
+data RunSpec = RunSpec
+    { file :: FilePath
+    , resolver :: String
+    , packages :: [String]
+    }
+
+spec :: FilePath -> IO RunSpec
+spec path = do
+    let readHeader =
+            decodeThrow . pack
+            . unlines
+            . snd . break (/= "{-")
+            . fst . break (== "-}")
+            . fmap (filter (/= '\r'))
+            . lines
+    header <- readHeader =<< readFile path
+    (resolver, packages) <-
+        maybe (help "spec") pure
+        . flip parseMaybe header
+        . withObject "header"
+        $ \hdr -> do
+            resolver <- hdr .: "resolver"
+            packages <- fmap fold $ hdr .:? "packages"
+            return (resolver, packages)
+    return (RunSpec path resolver packages)
+
+stackArgs :: RunSpec -> [String]
+stackArgs spec =
+    ["--resolver", resolver spec]
+    <> (packages spec >>= \package -> ["--package", package])
+    <> [file spec]
+
+main :: IO ()
+main = do
+    hSetBuffering stdout NoBuffering
+    args <- getArgs
+    case args of
+        "watch":file:_ -> watch =<< spec file
+        "repl":file:_ -> repl =<< spec file
+        "compile":file:_ -> compile =<< spec file
+        "script":file:args' -> script args' =<< spec file
+        _ -> help "main"
+
+go :: CreateProcess -> IO ()
+go process = do
+    (_, _, _, h) <- createProcess process
+    code <- waitForProcess h
+    exitWith code
+
+watch :: RunSpec -> IO ()
+watch spec = go $
+    proc "stack"
+        [ "exec"
+        , "--resolver"
+        , resolver spec
+        , "ghcid"
+        , "--"
+        , "--command"
+        , unwords $ "stack" : "repl" : stackArgs spec
+        ]
+
+repl :: RunSpec -> IO ()
+repl spec = go $
+    proc "stack" ("repl" : stackArgs spec)
+
+compile :: RunSpec -> IO ()
+compile spec = go $
+    proc "stack" ("ghc" : stackArgs spec)
+
+script :: [String] -> RunSpec -> IO ()
+script args spec = go $
+    proc "stack" ("runhaskell" : stackArgs spec <> args)
+
+help :: (?loc :: CallStack) => String -> IO a
+help trace = do
+    putStrLn $(embedStringFile "README.md")
+    putStrLn ""
+    fail (trace <> ": " <> show ?loc)
