@abyrd9/harbor-cli 2.2.0 → 2.3.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/dist/index.js CHANGED
@@ -327,13 +327,15 @@ PREREQUISITES: harbor.json or harbor config in package.json.
327
327
  EXAMPLES:
328
328
  harbor launch # Start and attach to tmux session
329
329
  harbor launch -d # Start in background (headless mode)
330
- harbor launch --headless # Same as -d`)
330
+ harbor launch --headless # Same as -d
331
+ harbor launch --name my-session # Use custom session name`)
331
332
  .option('-d, --detach', 'Run in background without attaching (headless mode). Use "anchor" to attach later.')
332
333
  .option('--headless', 'Alias for --detach')
334
+ .option('--name <name>', 'Override tmux session name from config')
333
335
  .action(async (options) => {
334
336
  try {
335
337
  await checkDependencies();
336
- await runServices({ detach: options.detach || options.headless });
338
+ await runServices({ detach: options.detach || options.headless, name: options.name });
337
339
  }
338
340
  catch (err) {
339
341
  console.log('❌ Error:', err instanceof Error ? err.message : 'Unknown error');
@@ -815,6 +817,7 @@ async function runServices(options = {}) {
815
817
  const env = {
816
818
  ...process.env,
817
819
  HARBOR_DETACH: options.detach ? '1' : '0',
820
+ HARBOR_SESSION_NAME: options.name || '',
818
821
  };
819
822
  const command = spawn('bash', [scriptPath], {
820
823
  stdio: 'inherit', // This will pipe stdin/stdout/stderr to the parent process
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyrd9/harbor-cli",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "A CLI tool for orchestrating local development services in a tmux session. Perfect for microservices and polyglot projects with automatic service discovery and before/after script support.",
5
5
  "type": "module",
6
6
  "bin": {
package/scripts/dev.sh CHANGED
@@ -11,8 +11,8 @@ get_harbor_config() {
11
11
  fi
12
12
  }
13
13
 
14
- # Get session name from config or use default
15
- session_name=$(get_harbor_config | jq -r '.sessionName // "harbor"')
14
+ # Get session name from env, config, or use default
15
+ session_name="${HARBOR_SESSION_NAME:-$(get_harbor_config | jq -r '.sessionName // "harbor"')}"
16
16
 
17
17
  # Check if the session already exists and kill it
18
18
  if tmux has-session -t "$session_name" 2>/dev/null; then