@atercates/claude-deck 0.2.9 → 0.2.10

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
@@ -2,12 +2,6 @@
2
2
 
3
3
  Self-hosted web UI for managing Claude Code sessions.
4
4
 
5
- [![Discord](https://img.shields.io/badge/Discord-Join%20us-5865F2?logo=discord&logoColor=white)](https://discord.gg/cSjutkCGAh)
6
-
7
- https://github.com/user-attachments/assets/0e2e66f7-037e-4739-99ec-608d1840df0a
8
-
9
- ![ClaudeDeck Screenshot](screenshot-v2.png)
10
-
11
5
  ## Installation
12
6
 
13
7
  ### Quick Install
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atercates/claude-deck",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Self-hosted web UI for managing Claude Code sessions",
5
5
  "bin": {
6
6
  "claude-deck": "./scripts/claude-deck"
@@ -5,8 +5,11 @@
5
5
  # Usage:
6
6
  # curl -fsSL https://raw.githubusercontent.com/ATERCATES/claude-deck/main/scripts/install.sh | bash
7
7
  #
8
- # Or with options:
9
- # bash install.sh --port 3011 --ssh-host myserver.com --ssh-port 22
8
+ # Options:
9
+ # bash install.sh --port 3011 --ssh-host myserver.com --ssh-port 22 -y
10
+ #
11
+ # Update:
12
+ # bash install.sh --update
10
13
  #
11
14
 
12
15
  set -e
@@ -26,7 +29,7 @@ log_warn() { echo -e "${YELLOW}==>${NC} $1"; }
26
29
  log_error() { echo -e "${RED}==>${NC} $1"; }
27
30
 
28
31
  INSTALL_DIR="$HOME/.claude-deck"
29
- REPO_URL="https://github.com/ATERCATES/claude-deck.git"
32
+ PKG_NAME="@atercates/claude-deck"
30
33
  NODE_MIN_VERSION=24
31
34
 
32
35
  # ─── Parse CLI flags ──────────────────────────────────────────────────────────
@@ -35,6 +38,7 @@ FLAG_PORT=""
35
38
  FLAG_SSH_HOST=""
36
39
  FLAG_SSH_PORT=""
37
40
  FLAG_NONINTERACTIVE=false
41
+ FLAG_UPDATE=false
38
42
 
39
43
  while [[ $# -gt 0 ]]; do
40
44
  case "$1" in
@@ -42,6 +46,7 @@ while [[ $# -gt 0 ]]; do
42
46
  --ssh-host) FLAG_SSH_HOST="$2"; shift 2 ;;
43
47
  --ssh-port) FLAG_SSH_PORT="$2"; shift 2 ;;
44
48
  --yes|-y) FLAG_NONINTERACTIVE=true; shift ;;
49
+ --update|-u) FLAG_UPDATE=true; shift ;;
45
50
  *) shift ;;
46
51
  esac
47
52
  done
@@ -63,6 +68,67 @@ ask() {
63
68
  fi
64
69
  }
65
70
 
71
+ # ─── Update mode ──────────────────────────────────────────────────────────────
72
+
73
+ if [[ "$FLAG_UPDATE" == true ]]; then
74
+ echo ""
75
+ echo -e "${BOLD} ClaudeDeck Update${NC}"
76
+ echo ""
77
+
78
+ if [[ ! -d "$INSTALL_DIR" ]]; then
79
+ log_error "ClaudeDeck is not installed. Run without --update first."
80
+ exit 1
81
+ fi
82
+
83
+ # Ensure node/pnpm in PATH
84
+ [[ -x "$HOME/.n/bin/node" ]] && export PATH="$HOME/.n/bin:$PATH"
85
+
86
+ cd "$INSTALL_DIR"
87
+ CURRENT=$(node -e "console.log(require('./node_modules/$PKG_NAME/package.json').version)" 2>/dev/null || echo "unknown")
88
+ log_info "Current version: $CURRENT"
89
+
90
+ log_info "Updating $PKG_NAME..."
91
+ pnpm update "$PKG_NAME" --latest 2>&1 | tail -3
92
+
93
+ NEW=$(node -e "console.log(require('./node_modules/$PKG_NAME/package.json').version)" 2>/dev/null || echo "unknown")
94
+
95
+ if [[ "$CURRENT" == "$NEW" ]]; then
96
+ log_success "Already on latest version ($NEW)"
97
+ else
98
+ log_success "Updated: $CURRENT -> $NEW"
99
+ fi
100
+
101
+ # Copy source and rebuild
102
+ log_info "Copying source..."
103
+ rsync -a --delete \
104
+ --exclude='node_modules' --exclude='.next' --exclude='.env' --exclude='*.db' --exclude='*.db-journal' \
105
+ "$INSTALL_DIR/node_modules/$PKG_NAME/" "$INSTALL_DIR/app/"
106
+
107
+ cd "$INSTALL_DIR/app"
108
+ log_info "Installing dependencies..."
109
+ pnpm install > /dev/null 2>&1
110
+
111
+ log_info "Building..."
112
+ pnpm build 2>&1 | tail -5
113
+
114
+ # Restart service if running
115
+ if systemctl is-active --quiet claudedeck 2>/dev/null; then
116
+ log_info "Restarting service..."
117
+ sudo systemctl restart claudedeck
118
+ sleep 2
119
+ if systemctl is-active --quiet claudedeck; then
120
+ log_success "ClaudeDeck $NEW running"
121
+ else
122
+ log_error "Service failed to start. Check: sudo journalctl -u claudedeck -f"
123
+ fi
124
+ else
125
+ log_success "ClaudeDeck $NEW ready. Start with: sudo systemctl start claudedeck"
126
+ fi
127
+
128
+ echo ""
129
+ exit 0
130
+ fi
131
+
66
132
  # ─── Header ───────────────────────────────────────────────────────────────────
67
133
 
68
134
  echo ""
@@ -74,11 +140,6 @@ echo ""
74
140
 
75
141
  log_info "Checking prerequisites..."
76
142
 
77
- if ! command -v git &> /dev/null; then
78
- log_error "git is required. Install it with: sudo apt install git"
79
- exit 1
80
- fi
81
-
82
143
  if ! command -v tmux &> /dev/null; then
83
144
  log_warn "tmux is not installed (required for session management)"
84
145
  ask "Install tmux now? (y/n)" "y" INSTALL_TMUX
@@ -105,7 +166,6 @@ install_node() {
105
166
  log_success "Node.js $(node --version) installed"
106
167
  }
107
168
 
108
- # Check for existing node
109
169
  NODE_OK=false
110
170
  if command -v node &> /dev/null; then
111
171
  NODE_VERSION=$(node --version | sed 's/v//' | cut -d. -f1)
@@ -115,7 +175,6 @@ if command -v node &> /dev/null; then
115
175
  fi
116
176
  fi
117
177
 
118
- # Check ~/.n/bin as well
119
178
  if [[ "$NODE_OK" == false ]] && [[ -x "$HOME/.n/bin/node" ]]; then
120
179
  export PATH="$HOME/.n/bin:$PATH"
121
180
  NODE_VERSION=$(node --version | sed 's/v//' | cut -d. -f1)
@@ -157,27 +216,33 @@ fi
157
216
 
158
217
  echo ""
159
218
 
160
- # ─── Install ──────────────────────────────────────────────────────────────────
219
+ # ─── Install from npm ────────────────────────────────────────────────────────
161
220
 
162
- if [[ -d "$INSTALL_DIR/repo" ]]; then
163
- log_info "Updating existing installation..."
164
- cd "$INSTALL_DIR/repo"
165
- git pull --ff-only
166
- else
167
- log_info "Cloning ClaudeDeck..."
168
- mkdir -p "$INSTALL_DIR"
169
- git clone "$REPO_URL" "$INSTALL_DIR/repo"
170
- cd "$INSTALL_DIR/repo"
221
+ mkdir -p "$INSTALL_DIR"
222
+ cd "$INSTALL_DIR"
223
+
224
+ # Initialize pnpm project if first install
225
+ if [[ ! -f "package.json" ]]; then
226
+ echo '{"name":"claude-deck-instance","private":true}' > package.json
171
227
  fi
172
228
 
229
+ log_info "Installing $PKG_NAME from npm..."
230
+ pnpm add "$PKG_NAME" 2>&1 | tail -3
231
+
232
+ # Copy source to app directory (so we can build and run independently)
233
+ log_info "Setting up application..."
234
+ rsync -a --delete \
235
+ --exclude='node_modules' --exclude='.next' --exclude='.env' --exclude='*.db' --exclude='*.db-journal' \
236
+ "$INSTALL_DIR/node_modules/$PKG_NAME/" "$INSTALL_DIR/app/"
237
+
238
+ cd "$INSTALL_DIR/app"
239
+
173
240
  # Dependencies
174
241
  log_info "Installing dependencies..."
175
242
  pnpm install > /dev/null 2>&1
176
243
 
177
244
  # Approve native builds if needed
178
- if grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
179
- : # already configured
180
- else
245
+ if ! grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
181
246
  node -e "
182
247
  const pkg = require('./package.json');
183
248
  pkg.pnpm = pkg.pnpm || {};
@@ -189,15 +254,15 @@ fi
189
254
 
190
255
  # Write .env
191
256
  log_info "Writing .env..."
192
- cat > "$INSTALL_DIR/repo/.env" << EOF
257
+ cat > "$INSTALL_DIR/app/.env" << EOF
193
258
  PORT=$PORT
194
259
  EOF
195
260
 
196
261
  if [[ -n "$SSH_HOST" ]]; then
197
- echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/repo/.env"
262
+ echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/app/.env"
198
263
  fi
199
264
  if [[ -n "$SSH_PORT" ]] && [[ "$SSH_PORT" != "22" ]]; then
200
- echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/repo/.env"
265
+ echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/app/.env"
201
266
  fi
202
267
 
203
268
  # Build
@@ -213,7 +278,8 @@ fi
213
278
  # ─── Systemd service ─────────────────────────────────────────────────────────
214
279
 
215
280
  NODE_BIN=$(which node)
216
- TSX_BIN="$INSTALL_DIR/repo/node_modules/.bin/tsx"
281
+ TSX_BIN="$INSTALL_DIR/app/node_modules/.bin/tsx"
282
+ APP_DIR="$INSTALL_DIR/app"
217
283
 
218
284
  SERVICE_FILE="[Unit]
219
285
  Description=ClaudeDeck
@@ -222,9 +288,9 @@ After=network.target
222
288
  [Service]
223
289
  Type=simple
224
290
  User=$USER
225
- WorkingDirectory=$INSTALL_DIR/repo
291
+ WorkingDirectory=$APP_DIR
226
292
  Environment=NODE_ENV=production
227
- Environment=PATH=$(dirname "$NODE_BIN"):$INSTALL_DIR/repo/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
293
+ Environment=PATH=$(dirname "$NODE_BIN"):$APP_DIR/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
228
294
  ExecStart=$TSX_BIN --env-file=.env server.ts
229
295
  Restart=on-failure
230
296
  RestartSec=5
@@ -258,8 +324,10 @@ fi
258
324
 
259
325
  # ─── Done ─────────────────────────────────────────────────────────────────────
260
326
 
327
+ VERSION=$(node -e "console.log(require('./package.json').version)" 2>/dev/null || echo "")
328
+
261
329
  echo ""
262
- echo -e "${GREEN}${BOLD} ClaudeDeck installed!${NC}"
330
+ echo -e "${GREEN}${BOLD} ClaudeDeck${VERSION:+ v$VERSION} installed!${NC}"
263
331
  echo ""
264
332
  echo -e " ${BOLD}Local:${NC} http://localhost:$PORT"
265
333
  if [[ -n "$SSH_HOST" ]]; then
@@ -267,5 +335,6 @@ if [[ -n "$SSH_HOST" ]]; then
267
335
  fi
268
336
  echo ""
269
337
  echo -e " ${DIM}First visit will prompt you to create an account.${NC}"
270
- echo -e " ${DIM}Commands: sudo systemctl {start|stop|restart|status} claudedeck${NC}"
338
+ echo -e " ${DIM}Manage: sudo systemctl {start|stop|restart|status} claudedeck${NC}"
339
+ echo -e " ${DIM}Update: bash install.sh --update${NC}"
271
340
  echo ""