specrails-hub 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,10 +28,10 @@ npm install -g specrails-hub
28
28
 
29
29
  ```bash
30
30
  # Start the hub server
31
- specrails-hub hub start
31
+ specrails-hub start
32
32
 
33
33
  # Register a project
34
- specrails-hub hub add /path/to/your/project
34
+ specrails-hub add /path/to/your/project
35
35
 
36
36
  # Open in browser
37
37
  open http://localhost:4200
@@ -96,12 +96,12 @@ A single Express process (port 4200) manages all projects. Each project gets its
96
96
 
97
97
  | Command | Description |
98
98
  |---------|-------------|
99
- | `specrails-hub hub start [--port N]` | Start the hub server (default port 4200) |
100
- | `specrails-hub hub stop` | Stop the hub server |
99
+ | `specrails-hub start [--port N]` | Start the hub server (default port 4200) |
100
+ | `specrails-hub stop` | Stop the hub server |
101
101
  | `specrails-hub hub status` | Show hub state and registered projects |
102
- | `specrails-hub hub list` | List all registered projects |
103
- | `specrails-hub hub add <path>` | Register a project |
104
- | `specrails-hub hub remove <id>` | Unregister a project |
102
+ | `specrails-hub list` | List all registered projects |
103
+ | `specrails-hub add <path>` | Register a project |
104
+ | `specrails-hub remove <id>` | Unregister a project |
105
105
 
106
106
  ### Running commands
107
107
 
@@ -99,6 +99,15 @@ function parseArgs(argv) {
99
99
  if (args[0] === 'hub') {
100
100
  return { mode: 'hub', subArgs: args.slice(1), port };
101
101
  }
102
+ // Allow hub subcommands directly without the 'hub' prefix:
103
+ // specrails-hub start → specrails-hub hub start
104
+ // specrails-hub stop → specrails-hub hub stop
105
+ // specrails-hub add → specrails-hub hub add
106
+ // etc.
107
+ const HUB_SUBCOMMANDS = new Set(['start', 'stop', 'add', 'remove', 'list']);
108
+ if (HUB_SUBCOMMANDS.has(args[0])) {
109
+ return { mode: 'hub', subArgs: args, port };
110
+ }
102
111
  const first = args[0];
103
112
  // Slash-prefixed command: pass through unchanged
104
113
  if (first.startsWith('/')) {
@@ -124,7 +133,8 @@ ${bold('Usage:')}
124
133
  specrails-hub "any raw prompt" Pass a raw prompt directly to claude
125
134
  specrails-hub --status Print manager status and exit
126
135
  specrails-hub --jobs Print recent job history and exit
127
- specrails-hub hub <subcommand> Manage the hub (multi-project mode)
136
+ specrails-hub start|stop|add|list Manage the hub (shorthand, no 'hub' prefix needed)
137
+ specrails-hub hub <subcommand> Same, with explicit 'hub' prefix
128
138
  specrails-hub --port <n> Override default port (${DEFAULT_PORT})
129
139
  specrails-hub --help Show this help text
130
140
 
@@ -707,7 +717,7 @@ async function hubStatus(port) {
707
717
  async function hubAdd(projectPath, port) {
708
718
  const detection = await detectWebManager(port);
709
719
  if (!detection.running) {
710
- cliError('hub is not running. Start it first with: specrails-hub hub start');
720
+ cliError('hub is not running. Start it first with: specrails-hub start');
711
721
  return 1;
712
722
  }
713
723
  try {
@@ -805,15 +815,15 @@ async function handleHub(subArgs, port) {
805
815
  const sub = subArgs[0];
806
816
  if (!sub || sub === 'help' || sub === '--help' || sub === '-h') {
807
817
  process.stdout.write(`
808
- ${bold('specrails-hub hub')} — manage the specrails hub (multi-project mode)
818
+ ${bold('specrails-hub')} — hub management
809
819
 
810
820
  ${bold('Usage:')}
811
- specrails-hub hub start Start the hub server
812
- specrails-hub hub stop Stop the hub server
821
+ specrails-hub start Start the hub server
822
+ specrails-hub stop Stop the hub server
813
823
  specrails-hub hub status Show hub status and registered projects
814
- specrails-hub hub add <path> Register a project by path
815
- specrails-hub hub remove <id> Unregister a project by ID
816
- specrails-hub hub list List all registered projects
824
+ specrails-hub add <path> Register a project by path
825
+ specrails-hub remove <id> Unregister a project by ID
826
+ specrails-hub list List all registered projects
817
827
  `.trimStart());
818
828
  return 0;
819
829
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-hub",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "bin": {
5
5
  "specrails-hub": "cli/dist/specrails-hub.js"
6
6
  },