diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2012, Monoid - Development and Consulting - Jan Christiansen
+
+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 Monoid - Development and Consulting - 
+Jan Christiansen 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/Main.hs b/Main.hs
new file mode 100644
--- /dev/null
+++ b/Main.hs
@@ -0,0 +1,135 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+
+module Main where
+
+import System.Environment (getArgs, withArgs)
+import System.Time
+import Data.Version (showVersion)
+import Network.HostName
+import Text.Twine
+import qualified Data.ByteString as BS
+import System.Console.CmdArgs
+import Paths_kif_parser
+
+import Text.KIF
+import Text.KIF.Parser
+
+data Params = Params {
+  output :: OutputType,
+  configuration :: String,
+  file :: FilePath
+}
+  deriving (Show, Data, Typeable)
+
+data OutputType = JUnit
+                | Markdown
+                | JSON
+  deriving (Show, Data, Typeable)
+
+params :: Params
+params = Params {
+  configuration = "" &= help "An optional text that is displayed as the test description",
+  output = JUnit &= argPos 0,
+  file = def &= typ "FILE" &= argPos 1
+}
+
+getParams :: IO Params
+getParams =
+  cmdArgs $ params
+          &= program "kif-parser"
+          &= versionArg [explicit, name "version", name "v", summary summaryText]
+          &= summary summaryText
+          &= details ["Process Keep It Functional log files"]
+
+summaryText :: String
+summaryText = "kif-parser " ++ showVersion version ++ ", Jan Christiansen"
+
+main :: IO ()
+main = do
+  args <- getArgs
+  params <- (if null args then withArgs ["--help"] else id) getParams
+  case output params of
+       JUnit    -> readKIF (file params) >>= kifToJUnit (configuration params) >>= BS.putStr
+       Markdown -> readKIF (file params) >>= kifToMarkdown (configuration params) >>= BS.putStr
+       JSON     -> readKIF (file params) >>= kifToJSON (configuration params) >>= BS.putStr
+
+kifToJUnit :: String -> KIFTest -> IO BS.ByteString
+kifToJUnit config kifTest = do
+  timeStamp <- getClockTime
+  hostName <- getHostName
+  context <- makeContext $ do
+    "configuration" =: config
+    "timeStamp"     =: show timeStamp
+    "hostName"      =: hostName
+    "test"          =: mapStrings escapeXML kifTest
+  filePath <- getDataFileName "templates/junit.tmpl"
+  evalTemplate filePath context
+
+escapeXML :: String -> String
+escapeXML = concatMap esc
+ where
+  esc c = case c of
+      '"'  -> "&quot;"
+      '\'' -> "&apos;"
+      '<'  -> "&lt;"
+      '>'  -> "&gt;"
+      '&'  -> "&amp;"
+      _    -> [c]
+
+kifToMarkdown :: String -> KIFTest -> IO BS.ByteString
+kifToMarkdown config kifTest = do
+  context <- makeContext $ do
+    "configuration" =: config
+    "test" =: kifTest
+  filePath <- getDataFileName "templates/markdown.tmpl"
+  evalTemplate filePath context
+
+kifToJSON :: String -> KIFTest -> IO BS.ByteString
+kifToJSON config kifTest = do
+  context <- makeContext $ do
+    "configuration" =: escapeJSON config
+    "test"          =: mapStrings escapeJSON kifTest
+  filePath <- getDataFileName "templates/json.tmpl"
+  evalTemplate filePath context
+
+escapeJSON :: String -> String
+escapeJSON str = "\"" ++ concatMap esc str ++ "\""
+ where
+  esc c = case c of
+      '"'    -> "\\\""
+      '\\'   -> "\\\\"
+      '/'    -> "\\/"
+      '\NUL' -> "\\u0000"
+      '\SOH' -> "\\u0001"
+      '\STX' -> "\\u0002"
+      '\ETX' -> "\\u0003"
+      '\EOT' -> "\\u0004"
+      '\ENQ' -> "\\u0005"
+      '\ACK' -> "\\u0006"
+      '\a'   -> "\\u0007"
+      '\b'   -> "\\b"
+      '\t'   -> "\\t"
+      '\n'   -> "\\n"
+      '\v'   -> "\\u000b"
+      '\f'   -> "\\f"
+      '\r'   -> "\\r"
+      '\SO'  -> "\\u000e"
+      '\SI'  -> "\\u000f"
+      '\DLE' -> "\\u0010"
+      '\DC1' -> "\\u0011"
+      '\DC2' -> "\\u0012"
+      '\DC3' -> "\\u0013"
+      '\DC4' -> "\\u0014"
+      '\NAK' -> "\\u0015"
+      '\SYN' -> "\\u0016"
+      '\ETB' -> "\\u0017"
+      '\CAN' -> "\\u0018"
+      '\EM'  -> "\\u0019"
+      '\SUB' -> "\\u001a"
+      '\ESC' -> "\\u001b"
+      '\FS'  -> "\\u001c"
+      '\GS'  -> "\\u001d"
+      '\RS'  -> "\\u001e"
+      '\US'  -> "\\u001f"
+      '\DEL' -> "\\u007f"
+      _      -> [c]
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
diff --git a/kif-parser.cabal b/kif-parser.cabal
new file mode 100644
--- /dev/null
+++ b/kif-parser.cabal
@@ -0,0 +1,33 @@
+name:                     kif-parser
+version:                  0.0.3
+cabal-version:            >= 1.6
+stability:                alpha
+description:              Converts KIF (Keep It Functional) iOS integration test logs into other formats, i.e., JUnit XML format 
+synopsis:                 Process KIF iOS test logs
+license:                  BSD3
+license-file:             LICENSE
+author:                   Jan Christiansen
+maintainer:               Jan Christiansen <j.christiansen@monoid-it.de>
+category:                 Distribution
+build-type:		  Simple
+bug-reports:              https://github.com/plancalculus/kif-parser/issues
+data-files:
+  templates/junit.tmpl,
+  templates/markdown.tmpl,
+  templates/json.tmpl
+
+source-repository head
+  type:      git
+  location:  https://github.com/plancalculus/kif-parser.git
+
+executable kif-parser
+  main-is:                  Main.hs
+  ghc-options:              -Wall -fno-warn-unused-do-bind
+  build-depends:
+    base >= 4 && < 5,
+    parsec,
+    twine,
+    bytestring,
+    old-time,
+    hostname,
+    cmdargs
diff --git a/templates/json.tmpl b/templates/json.tmpl
new file mode 100644
--- /dev/null
+++ b/templates/json.tmpl
@@ -0,0 +1,33 @@
+
+{
+  "test": {
+    "no-of-scenarios": {{test.noOfScenarios}},
+    "no-of-failures": {{test.noOfFailures}},
+    "duration": {{test.duration}},
+    "scenarios": [
+      {@|scenario <- test.scenarios|
+      "scenario" : {
+        "number": {{scenario.number}},
+        "description": {{scenario.description}},
+        "no-of-steps": {{scenario.noOfSteps}},
+        "duration": {{scenario.duration}},
+        "passed": {?|scenario.passed|true?}{?|scenario.failed|false?},
+        "steps": [
+          {@|step <- scenario.steps|
+          {?|step.passed|"pass": {
+            "description": {{step.description}},
+            "duration": {{step.duration}}
+          }
+          ?}
+          {?|step.failed|"fail": {
+            "description": {{step.description}},
+            "reason": {{step.reason}},
+            "duration": {{step.duration}}
+          }
+          ?}
+          @}
+      }
+      @}
+    ]
+  }
+}
diff --git a/templates/junit.tmpl b/templates/junit.tmpl
new file mode 100644
--- /dev/null
+++ b/templates/junit.tmpl
@@ -0,0 +1,7 @@
+<?xml version='1.0' ?>
+
+<testsuite name="{{configuration}}" errors="0" failures="{{test.noOfFailures}}" tests="{{test.noOfScenarios}}" time="{{test.duration}}" timestamp="{{timeStamp}}" hostname="{{hostName}}">
+{@|scenario <- test.scenarios|
+<testcase name="{{scenario.description}}" classname="KIFTestScenario" time="{{scenario.duration}}" />
+@}
+</testsuite>
diff --git a/templates/markdown.tmpl b/templates/markdown.tmpl
new file mode 100644
--- /dev/null
+++ b/templates/markdown.tmpl
@@ -0,0 +1,11 @@
+# Test Report {{configuration}}
+
+{@|scenario <- test.scenarios|
+## Test Case {{scenario.number}}: {{scenario.description}} {?|scenario.passed|(**Passed**)?}{?|scenario.failed|(**Failed**)?}
+Performs {{scenario.noOfSteps}} steps in {{scenario.duration}}
+
+{@|step <- scenario.steps|
+ * {{step.description}} {?|step.passed|(**Passed**)?}{?|step.failed|(**Failed**)?}
+@}
+
+@}
