summaryrefslogtreecommitdiff
path: root/internal/cli
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-03 22:56:24 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-03 22:56:24 +0000
commitb28cfc6ff288d083f6c8e9c055b69bfcadbceccc (patch)
treefb5e16fa588494bb400126a3ea774ae7bd34be1a /internal/cli
parent476a3136a9f55e151ae689cd098795ec865e7850 (diff)
feat: add --base-path flag so UI routes API calls to correct prefix
Allows running multiple instances (e.g. /claudomator and /claudomator-oss) behind a reverse proxy. The server rewrites the base-path meta tag in index.html at request time rather than baking it into the embed. Also adds --branch support to deploy script for isolated branch builds via git worktrees. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/cli')
-rw-r--r--internal/cli/serve.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/cli/serve.go b/internal/cli/serve.go
index dae66d6..ae42780 100644
--- a/internal/cli/serve.go
+++ b/internal/cli/serve.go
@@ -21,6 +21,7 @@ import (
func newServeCmd() *cobra.Command {
var addr string
var workspaceRoot string
+ var basePath string
cmd := &cobra.Command{
Use: "serve",
@@ -29,11 +30,12 @@ func newServeCmd() *cobra.Command {
if cmd.Flags().Changed("workspace-root") {
cfg.WorkspaceRoot = workspaceRoot
}
- return serve(addr)
+ return serve(addr, basePath)
},
}
cmd.Flags().StringVar(&addr, "addr", ":8484", "listen address")
+ cmd.Flags().StringVar(&basePath, "base-path", "/claudomator", "URL prefix the UI is served under (e.g. /claudomator-oss)")
cmd.Flags().StringVar(&workspaceRoot, "workspace-root", "/workspace", "root directory for listing workspaces")
cmd.Flags().StringVar(&cfg.ClaudeImage, "claude-image", cfg.ClaudeImage, "docker image for claude agents")
cmd.Flags().StringVar(&cfg.GeminiImage, "gemini-image", cfg.GeminiImage, "docker image for gemini agents")
@@ -41,7 +43,7 @@ func newServeCmd() *cobra.Command {
return cmd
}
-func serve(addr string) error {
+func serve(addr, basePath string) error {
if err := cfg.EnsureDirs(); err != nil {
return fmt.Errorf("creating dirs: %w", err)
}
@@ -153,6 +155,7 @@ func serve(addr string) error {
pool.RecoverStaleBlocked()
srv := api.NewServer(store, pool, logger, cfg.ClaudeBinaryPath, cfg.GeminiBinaryPath)
+ srv.SetBasePath(basePath)
// Configure notifiers: combine webhook (if set) with web push.
notifiers := []notify.Notifier{}