Skip to content

Commit e1ca9f5

Browse files
centdixclaude
andauthored
feat: add webmux serve command, bare webmux now shows help (#90)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5d313e8 commit e1ca9f5

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

bin/src/service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Description=webmux dashboard — ${config.projectName}
7474
7575
[Service]
7676
Type=simple
77-
ExecStart=${config.webmuxPath} --port ${config.port}
77+
ExecStart=${config.webmuxPath} serve --port ${config.port}
7878
WorkingDirectory=${config.projectDir}
7979
Restart=on-failure
8080
RestartSec=5
@@ -98,6 +98,7 @@ function generateLaunchdPlist(config: ServiceConfig): string {
9898
<key>ProgramArguments</key>
9999
<array>
100100
<string>${config.webmuxPath}</string>
101+
<string>serve</string>
101102
<string>--port</string>
102103
<string>${config.port}</string>
103104
</array>

bin/src/webmux.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function usage() {
1414
webmux — Dev dashboard for managing Git worktrees
1515
1616
Usage:
17-
webmux Start the dashboard
17+
webmux serve Start the dashboard server
1818
webmux init Interactive project setup
1919
webmux service Manage webmux as a system service
2020
webmux update Update webmux to the latest version
@@ -24,16 +24,18 @@ Usage:
2424
webmux close Close a worktree session without removing it
2525
webmux remove Remove a worktree
2626
webmux merge Merge a worktree into the main branch and remove it
27-
webmux --port N Set port (default: 5111)
28-
webmux --debug Show debug-level logs
29-
webmux --help Show this help message
27+
28+
Options:
29+
--port N Set port (default: 5111)
30+
--debug Show debug-level logs
31+
--help Show this help message
3032
3133
Environment:
3234
BACKEND_PORT Same as --port (flag takes precedence)
3335
`);
3436
}
3537

36-
type RootCommand = "init" | "service" | "update" | "add" | "list" | "open" | "close" | "remove" | "merge" | null;
38+
type RootCommand = "serve" | "init" | "service" | "update" | "add" | "list" | "open" | "close" | "remove" | "merge" | null;
3739

3840
interface ParsedRootArgs {
3941
port: number;
@@ -43,7 +45,8 @@ interface ParsedRootArgs {
4345
}
4446

4547
function isRootCommand(value: string): value is NonNullable<RootCommand> {
46-
return value === "init"
48+
return value === "serve"
49+
|| value === "init"
4750
|| value === "service"
4851
|| value === "update"
4952
|| value === "add"
@@ -180,7 +183,14 @@ if (isWorktreeCommand(parsed.command)) {
180183
process.exit(exitCode);
181184
}
182185

183-
// ── Check for .webmux.yaml ───────────────────────────────────────────────────
186+
// ── No command → show help ───────────────────────────────────────────────────
187+
188+
if (parsed.command === null) {
189+
usage();
190+
process.exit(0);
191+
}
192+
193+
// ── serve: Check for .webmux.yaml ────────────────────────────────────────────
184194

185195
if (!existsSync(resolve(process.cwd(), ".webmux.yaml"))) {
186196
console.error("No .webmux.yaml found in this directory.\nRun `webmux init` to set up your project.");

0 commit comments

Comments
 (0)