summaryrefslogtreecommitdiff
path: root/Omni/Jr.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-26 05:48:07 -0500
committerBen Sima <ben@bensima.com>2025-11-26 05:48:07 -0500
commitc4e5e3791485b5dcb08066ab81e0157d6e70c1d2 (patch)
treee9a4a41f772c2df29d23ab79678a269958a230e0 /Omni/Jr.hs
parent01de0612b51b64077d10d05268e89f5e2b3b8001 (diff)
Add jr web command with Servant skeleton
Task-Id: t-1o2g8gugkr1.1
Diffstat (limited to 'Omni/Jr.hs')
-rw-r--r--Omni/Jr.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/Omni/Jr.hs b/Omni/Jr.hs
index 0cf22f6..f15a2b2 100644
--- a/Omni/Jr.hs
+++ b/Omni/Jr.hs
@@ -5,6 +5,10 @@
-- : out jr
-- : dep sqlite-simple
-- : dep sqids
+-- : dep warp
+-- : dep servant-server
+-- : dep lucid
+-- : dep servant-lucid
module Omni.Jr where
import Alpha
@@ -13,6 +17,7 @@ import qualified Data.Text as Text
import qualified Omni.Agent.Core as AgentCore
import qualified Omni.Agent.Worker as AgentWorker
import qualified Omni.Cli as Cli
+import qualified Omni.Jr.Web as Web
import qualified Omni.Task as Task
import qualified Omni.Task.Core as TaskCore
import qualified Omni.Test as Test
@@ -45,6 +50,7 @@ jr
Usage:
jr task [<args>...]
jr work [<task-id>]
+ jr web [--port=PORT]
jr review <task-id>
jr merge-driver <ours> <theirs>
jr test
@@ -53,11 +59,13 @@ Usage:
Commands:
task Manage tasks
work Start a worker agent on a task
+ web Start the web UI server
review Review a completed task (show diff, accept/reject)
merge-driver Internal git merge driver
Options:
- -h --help Show this help
+ -h --help Show this help
+ --port=PORT Port for web server [default: 8080]
|]
move :: Cli.Arguments -> IO ()
@@ -65,6 +73,11 @@ move args
| args `Cli.has` Cli.command "task" = do
let extraArgs = Cli.getAllArgs args (Cli.argument "args")
withArgs extraArgs Task.main
+ | args `Cli.has` Cli.command "web" = do
+ let port = case Cli.getArg args (Cli.longOption "port") of
+ Just p -> fromMaybe Web.defaultPort (readMaybe p)
+ Nothing -> Web.defaultPort
+ Web.run port
| args `Cli.has` Cli.command "work" = do
-- Always run in current directory
let path = "."