@atercates/claude-deck 0.2.11 → 0.2.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/install.sh +38 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atercates/claude-deck",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Self-hosted web UI for managing Claude Code sessions",
5
5
  "bin": {
6
6
  "claude-deck": "./scripts/claude-deck"
@@ -28,7 +28,7 @@ log_warn() { echo -e "${YELLOW}==>${NC} $1"; }
28
28
  log_error() { echo -e "${RED}==>${NC} $1"; }
29
29
 
30
30
  INSTALL_DIR="$HOME/.claude-deck"
31
- PKG="@atercates/claude-deck"
31
+ REPO_URL="https://github.com/ATERCATES/claude-deck.git"
32
32
  NODE_MIN=24
33
33
 
34
34
  # ─── Parse flags ──────────────────────────────────────────────────────────────
@@ -65,7 +65,6 @@ ask() {
65
65
  }
66
66
 
67
67
  ensure_node() {
68
- # Check PATH first, then ~/.n
69
68
  [[ -x "$HOME/.n/bin/node" ]] && export PATH="$HOME/.n/bin:$PATH"
70
69
 
71
70
  if command -v node &> /dev/null; then
@@ -95,12 +94,8 @@ ensure_pnpm() {
95
94
  fi
96
95
  }
97
96
 
98
- pkg_dir() {
99
- echo "$INSTALL_DIR/node_modules/$PKG"
100
- }
101
-
102
- pkg_version() {
103
- node -e "console.log(require('$(pkg_dir)/package.json').version)" 2>/dev/null || echo "unknown"
97
+ app_version() {
98
+ node -e "console.log(require('$INSTALL_DIR/package.json').version)" 2>/dev/null || echo "unknown"
104
99
  }
105
100
 
106
101
  # ─── Update ───────────────────────────────────────────────────────────────────
@@ -110,28 +105,28 @@ if [[ "$FLAG_UPDATE" == true ]]; then
110
105
  echo -e "${BOLD} ClaudeDeck Update${NC}"
111
106
  echo ""
112
107
 
113
- if [[ ! -d "$INSTALL_DIR/node_modules/$PKG" ]]; then
108
+ if [[ ! -d "$INSTALL_DIR/.git" ]]; then
114
109
  log_error "ClaudeDeck is not installed. Run without --update first."
115
110
  exit 1
116
111
  fi
117
112
 
118
113
  ensure_node
114
+ ensure_pnpm
119
115
  cd "$INSTALL_DIR"
120
116
 
121
- CURRENT=$(pkg_version)
117
+ CURRENT=$(app_version)
122
118
  log_info "Current version: $CURRENT"
123
119
 
124
- log_info "Updating..."
125
- pnpm update "$PKG" --latest 2>&1 | tail -3
120
+ log_info "Pulling latest..."
121
+ git pull --ff-only
126
122
 
127
- NEW=$(pkg_version)
123
+ NEW=$(app_version)
128
124
  if [[ "$CURRENT" == "$NEW" ]]; then
129
125
  log_success "Already on latest version ($NEW)"
130
126
  else
131
127
  log_success "Updated: $CURRENT -> $NEW"
132
128
  fi
133
129
 
134
- cd "$(pkg_dir)"
135
130
  log_info "Installing dependencies..."
136
131
  pnpm install > /dev/null 2>&1
137
132
 
@@ -162,6 +157,11 @@ echo ""
162
157
  # Prerequisites
163
158
  log_info "Checking prerequisites..."
164
159
 
160
+ if ! command -v git &> /dev/null; then
161
+ log_error "git is required. Install it with: sudo apt install git"
162
+ exit 1
163
+ fi
164
+
165
165
  if ! command -v tmux &> /dev/null; then
166
166
  log_warn "tmux is not installed (required for session management)"
167
167
  ask "Install tmux now? (y/n)" "y" INSTALL_TMUX
@@ -191,20 +191,18 @@ ask "SSH host for VS Code remote button (leave empty to skip)" "" SSH_HOST
191
191
  [[ -n "$SSH_HOST" ]] && ask "SSH port" "22" SSH_PORT
192
192
  echo ""
193
193
 
194
- # Install package
195
- mkdir -p "$INSTALL_DIR"
196
- cd "$INSTALL_DIR"
197
-
198
- if [[ ! -f "package.json" ]]; then
199
- echo '{"name":"claude-deck-instance","private":true}' > package.json
194
+ # Clone or update repo
195
+ if [[ -d "$INSTALL_DIR/.git" ]]; then
196
+ log_info "Updating existing installation..."
197
+ cd "$INSTALL_DIR"
198
+ git pull --ff-only
199
+ else
200
+ log_info "Downloading ClaudeDeck..."
201
+ git clone "$REPO_URL" "$INSTALL_DIR"
202
+ cd "$INSTALL_DIR"
200
203
  fi
201
204
 
202
- log_info "Installing $PKG from npm..."
203
- pnpm add "$PKG" 2>&1 | tail -3
204
-
205
- # Build inside the package directory
206
- cd "$(pkg_dir)"
207
-
205
+ # Dependencies
208
206
  log_info "Installing dependencies..."
209
207
  pnpm install > /dev/null 2>&1
210
208
 
@@ -218,12 +216,15 @@ if ! grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
218
216
  pnpm install > /dev/null 2>&1
219
217
  fi
220
218
 
221
- # .env
222
- log_info "Writing .env..."
223
- ENV_FILE="$(pkg_dir)/.env"
224
- echo "PORT=$PORT" > "$ENV_FILE"
225
- [[ -n "$SSH_HOST" ]] && echo "SSH_HOST=$SSH_HOST" >> "$ENV_FILE"
226
- [[ -n "$SSH_PORT" && "$SSH_PORT" != "22" ]] && echo "SSH_PORT=$SSH_PORT" >> "$ENV_FILE"
219
+ # .env (preserve existing)
220
+ if [[ ! -f "$INSTALL_DIR/.env" ]]; then
221
+ log_info "Writing .env..."
222
+ echo "PORT=$PORT" > "$INSTALL_DIR/.env"
223
+ [[ -n "$SSH_HOST" ]] && echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/.env"
224
+ [[ -n "$SSH_PORT" && "$SSH_PORT" != "22" ]] && echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/.env"
225
+ else
226
+ log_success ".env already exists, keeping current config"
227
+ fi
227
228
 
228
229
  # Build
229
230
  log_info "Building for production (this may take a minute)..."
@@ -235,14 +236,10 @@ if [[ ! -f "$HOME/.tmux.conf" ]] || ! grep -q "mouse on" "$HOME/.tmux.conf" 2>/d
235
236
  echo "set -g mouse on" >> "$HOME/.tmux.conf"
236
237
  fi
237
238
 
238
- # Copy install script for easy updates
239
- cp "$(pkg_dir)/scripts/install.sh" "$INSTALL_DIR/install.sh" 2>/dev/null || true
240
-
241
239
  # ─── Systemd ──────────────────────────────────────────────────────────────────
242
240
 
243
- APP_DIR="$(pkg_dir)"
244
241
  NODE_BIN=$(which node)
245
- TSX_BIN="$APP_DIR/node_modules/.bin/tsx"
242
+ TSX_BIN="$INSTALL_DIR/node_modules/.bin/tsx"
246
243
 
247
244
  SERVICE="[Unit]
248
245
  Description=ClaudeDeck
@@ -251,9 +248,9 @@ After=network.target
251
248
  [Service]
252
249
  Type=simple
253
250
  User=$USER
254
- WorkingDirectory=$APP_DIR
251
+ WorkingDirectory=$INSTALL_DIR
255
252
  Environment=NODE_ENV=production
256
- Environment=PATH=$(dirname "$NODE_BIN"):$APP_DIR/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
253
+ Environment=PATH=$(dirname "$NODE_BIN"):$INSTALL_DIR/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
257
254
  ExecStart=$TSX_BIN --env-file=.env server.ts
258
255
  Restart=on-failure
259
256
  RestartSec=5
@@ -282,7 +279,7 @@ fi
282
279
 
283
280
  # ─── Done ─────────────────────────────────────────────────────────────────────
284
281
 
285
- VERSION=$(pkg_version)
282
+ VERSION=$(app_version)
286
283
 
287
284
  echo ""
288
285
  echo -e "${GREEN}${BOLD} ClaudeDeck${VERSION:+ v$VERSION} installed!${NC}"
@@ -292,5 +289,5 @@ echo -e " ${BOLD}Local:${NC} http://localhost:$PORT"
292
289
  echo ""
293
290
  echo -e " ${DIM}First visit will prompt you to create an account.${NC}"
294
291
  echo -e " ${DIM}Manage: sudo systemctl {start|stop|restart|status} claudedeck${NC}"
295
- echo -e " ${DIM}Update: ~/.claude-deck/install.sh --update${NC}"
292
+ echo -e " ${DIM}Update: ~/.claude-deck/scripts/install.sh --update${NC}"
296
293
  echo ""