ghost-tab 2.6.0 → 2.7.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
@@ -9,10 +9,10 @@ A **`Ghostty`** + **`tmux`** wrapper that launches a four-pane dev session with
9
9
  ## Quick Start
10
10
 
11
11
  ```sh
12
- git clone https://github.com/JackUait/ghost-tab.git && cd ghost-tab && ./bin/ghost-tab
12
+ npx ghost-tab
13
13
  ```
14
14
 
15
- That's it — only requirement is **`macOS`**. Everything (**`Ghostty`**, **`tmux`**, **`lazygit`**, **`broot`**, **`Claude Code`**) is installed automatically.
15
+ That's it — only requirements are **`macOS`** and **`Node.js 16+`**. Everything (**`Ghostty`**, **`tmux`**, **`lazygit`**, **`broot`**, **`Claude Code`**) is installed automatically.
16
16
 
17
17
  ---
18
18
 
@@ -75,7 +75,7 @@ That's it — only requirement is **`macOS`**. Everything (**`Ghostty`**, **`tmu
75
75
  4. Sets up the **`Ghostty`** config (with merge option if you have an existing one)
76
76
  5. Walks you through adding your **project directories**
77
77
  6. Installs **`Node.js`** LTS (if needed) and sets up **Claude Code status line** showing git info and context usage
78
- 7. Auto-updates via **`git pull`** in the background notifies on next launch
78
+ 7. Auto-updates automatically just run `npx ghost-tab` again to get the latest version
79
79
 
80
80
  ---
81
81
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.6.0
1
+ 2.7.0
package/bin/ghost-tab CHANGED
@@ -130,7 +130,7 @@ if [ "$(uname)" != "Darwin" ]; then
130
130
  exit 1
131
131
  fi
132
132
  success "macOS detected"
133
- notify_if_updated
133
+ notify_if_update_available
134
134
 
135
135
  # ---------- Dependencies ----------
136
136
  header "Installing dependencies..."
package/lib/config-tui.sh CHANGED
@@ -10,14 +10,6 @@ _config_tui_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
10
  [ "$(type -t select_terminal_interactive 2>/dev/null)" = "function" ] || source "$_config_tui_dir/terminal-select-tui.sh"
11
11
  # shellcheck source=lib/terminals/registry.sh
12
12
  [ "$(type -t get_terminal_display_name 2>/dev/null)" = "function" ] || source "$_config_tui_dir/terminals/registry.sh"
13
- # shellcheck source=lib/project-actions-tui.sh
14
- [ "$(type -t add_project_interactive 2>/dev/null)" = "function" ] || source "$_config_tui_dir/project-actions-tui.sh"
15
- # shellcheck source=lib/project-actions.sh
16
- [ "$(type -t add_project_to_file 2>/dev/null)" = "function" ] || source "$_config_tui_dir/project-actions.sh"
17
- # shellcheck source=lib/ai-select-tui.sh
18
- [ "$(type -t select_ai_tool_interactive 2>/dev/null)" = "function" ] || source "$_config_tui_dir/ai-select-tui.sh"
19
- # shellcheck source=lib/settings-menu-tui.sh
20
- [ "$(type -t settings_menu_interactive 2>/dev/null)" = "function" ] || source "$_config_tui_dir/settings-menu-tui.sh"
21
13
 
22
14
  # Interactive config menu loop.
23
15
  # Calls ghost-tab-tui config-menu, dispatches on action, loops until quit.
@@ -29,9 +21,23 @@ config_menu_interactive() {
29
21
 
30
22
  local config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/ghost-tab"
31
23
 
24
+ # Read VERSION from project root
25
+ local version=""
26
+ local version_file="$_config_tui_dir/../VERSION"
27
+ if [ -f "$version_file" ]; then
28
+ version="$(tr -d '[:space:]' < "$version_file")"
29
+ fi
30
+
32
31
  while true; do
32
+ # Resolve terminal display name from saved preference
33
+ local terminal_slug="" terminal_display=""
34
+ if [ -f "$config_dir/terminal" ]; then
35
+ terminal_slug="$(tr -d '[:space:]' < "$config_dir/terminal")"
36
+ terminal_display="$(get_terminal_display_name "$terminal_slug")"
37
+ fi
38
+
33
39
  local result
34
- if ! result=$(ghost-tab-tui config-menu 2>/dev/null); then
40
+ if ! result=$(ghost-tab-tui config-menu --terminal-name "$terminal_display" --version "$version" 2>/dev/null); then
35
41
  return 1
36
42
  fi
37
43
 
@@ -52,27 +58,6 @@ config_menu_interactive() {
52
58
  read -rsn1 -p "Press any key to continue..." </dev/tty
53
59
  fi
54
60
  ;;
55
- manage-projects)
56
- if add_project_interactive; then
57
- # shellcheck disable=SC2154
58
- add_project_to_file "$_add_project_name" "$_add_project_path" "$config_dir/projects"
59
- success "Added project: $_add_project_name"
60
- echo ""
61
- read -rsn1 -p "Press any key to continue..." </dev/tty
62
- fi
63
- ;;
64
- select-ai-tools)
65
- if select_ai_tool_interactive; then
66
- # shellcheck disable=SC2154
67
- echo "$_selected_ai_tool" > "$config_dir/ai-tool"
68
- success "Default AI tool set to $_selected_ai_tool"
69
- echo ""
70
- read -rsn1 -p "Press any key to continue..." </dev/tty
71
- fi
72
- ;;
73
- display-settings)
74
- settings_menu_interactive
75
- ;;
76
61
  reinstall)
77
62
  local script_dir
78
63
  script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
package/lib/update.sh CHANGED
@@ -1,52 +1,41 @@
1
1
  #!/bin/bash
2
- # Git-based auto-update for ghost-tab.
2
+ # npm-based update check for ghost-tab.
3
3
 
4
- # Show update notification if a previous background update wrote a flag file.
4
+ # Show update-available notification if a previous background check found a newer version.
5
5
  # Deletes the flag after displaying.
6
- notify_if_updated() {
6
+ notify_if_update_available() {
7
7
  local config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
8
- local flag="${config_home}/ghost-tab/updated"
8
+ local flag="${config_home}/ghost-tab/update-available"
9
9
  [ -f "$flag" ] || return 0
10
10
 
11
11
  local version
12
12
  version="$(cat "$flag")"
13
13
  rm -f "$flag"
14
- echo " ↑ Updated to v${version}"
14
+ echo " ↑ Update available: v${version} — run 'npx ghost-tab' to update"
15
15
  }
16
16
 
17
- # Run a background git fetch + pull in share_dir.
18
- # If a new version is pulled, downloads the ghost-tab-tui binary and writes a flag file.
19
- # Args: share_dir
17
+ # Run a background check against the npm registry.
18
+ # If a newer version exists, writes a flag file for notify_if_update_available.
19
+ # Args: install_dir (where .version marker lives)
20
20
  check_for_update() {
21
- local share_dir="$1"
21
+ local install_dir="$1"
22
22
  local config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
23
- local flag="${config_home}/ghost-tab/updated"
23
+ local flag="${config_home}/ghost-tab/update-available"
24
24
 
25
- # Only works if share_dir is a git repo
26
- [ -d "$share_dir/.git" ] || return 0
25
+ # Need npm and a local version to compare
26
+ command -v npm &>/dev/null || return 0
27
+ local local_version
28
+ local_version="$(cat "$install_dir/.version" 2>/dev/null | tr -d '[:space:]')"
29
+ [ -n "$local_version" ] || return 0
27
30
 
28
31
  (
29
- local local_ref remote_ref
30
- git -C "$share_dir" fetch origin main --quiet 2>/dev/null || return
31
-
32
- local_ref="$(git -C "$share_dir" rev-parse HEAD 2>/dev/null)"
33
- remote_ref="$(git -C "$share_dir" rev-parse origin/main 2>/dev/null)"
34
- [ "$local_ref" = "$remote_ref" ] && return
35
-
36
- git -C "$share_dir" pull --rebase --quiet origin main 2>/dev/null || return
37
-
38
- local new_version arch
39
- new_version="$(tr -d '[:space:]' < "$share_dir/VERSION" 2>/dev/null)" || return
40
- [ -n "$new_version" ] || return
41
-
42
- arch="$(uname -m)"
43
- local bin_url="https://github.com/JackUait/ghost-tab/releases/download/v${new_version}/ghost-tab-tui-darwin-${arch}"
44
- mkdir -p "$HOME/.local/bin"
45
- curl -fsSL -o "$HOME/.local/bin/ghost-tab-tui" "$bin_url" 2>/dev/null && \
46
- chmod +x "$HOME/.local/bin/ghost-tab-tui" || true
32
+ local remote_version
33
+ remote_version="$(npm view ghost-tab version 2>/dev/null | tr -d '[:space:]')" || return
34
+ [ -n "$remote_version" ] || return
35
+ [ "$local_version" = "$remote_version" ] && return
47
36
 
48
37
  mkdir -p "${config_home}/ghost-tab"
49
- echo "$new_version" > "$flag"
38
+ echo "$remote_version" > "$flag"
50
39
  ) &
51
40
  disown
52
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghost-tab",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Terminal + tmux wrapper for AI coding tools (Claude Code, Codex CLI, Copilot CLI, OpenCode)",
5
5
  "bin": {
6
6
  "ghost-tab": "bin/npx-ghost-tab.js"
package/wrapper.sh CHANGED
@@ -6,8 +6,8 @@ SHARE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ghost-tab"
6
6
  # shellcheck source=/dev/null
7
7
  [ -f "$SHARE_DIR/lib/update.sh" ] && source "$SHARE_DIR/lib/update.sh"
8
8
 
9
- notify_if_updated
10
- check_for_update "$SHARE_DIR"
9
+ notify_if_update_available
10
+ check_for_update "${HOME}/.local/share/ghost-tab"
11
11
 
12
12
  # Show animated loading screen immediately in interactive mode (no args)
13
13
  _wrapper_dir_early="$(cd "$(dirname "$0")" && pwd)"
@@ -39,7 +39,7 @@ if [ ! -d "$_WRAPPER_DIR/lib" ]; then
39
39
  exit 1
40
40
  fi
41
41
 
42
- _gt_libs=(ai-tools projects process input tui menu-tui project-actions project-actions-tui tmux-session settings-menu-tui settings-json notification-setup tab-title-watcher)
42
+ _gt_libs=(ai-tools projects process input tui menu-tui project-actions project-actions-tui tmux-session settings-json notification-setup tab-title-watcher)
43
43
  for _gt_lib in "${_gt_libs[@]}"; do
44
44
  if [ ! -f "$_WRAPPER_DIR/lib/${_gt_lib}.sh" ]; then
45
45
  printf '\033[31mError:\033[0m Missing library %s/lib/%s.sh\n' "$_WRAPPER_DIR" "$_gt_lib" >&2
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
- # TUI wrapper for settings menu
3
- # Uses ghost-tab-tui settings-menu subcommand
4
-
5
- # Interactive settings menu using ghost-tab-tui
6
- # Returns action string (or empty if quit)
7
- settings_menu_interactive() {
8
- if ! command -v ghost-tab-tui &>/dev/null; then
9
- error "ghost-tab-tui binary not found. Please reinstall."
10
- return 1
11
- fi
12
-
13
- local result
14
- if ! result=$(ghost-tab-tui settings-menu 2>/dev/null); then
15
- return 1
16
- fi
17
-
18
- local action
19
- if ! action=$(echo "$result" | jq -r '.action' 2>/dev/null); then
20
- error "Failed to parse settings menu response"
21
- return 1
22
- fi
23
-
24
- # Validate null/empty (empty is OK for quit, but null is not)
25
- if [[ "$action" == "null" ]]; then
26
- error "TUI returned invalid action"
27
- return 1
28
- fi
29
-
30
- echo "$action"
31
- return 0
32
- }