@atercates/claude-deck 0.2.8 → 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.8",
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,14 +140,16 @@ 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
- log_error "tmux is required. Install it with: sudo apt install tmux"
84
- exit 1
144
+ log_warn "tmux is not installed (required for session management)"
145
+ ask "Install tmux now? (y/n)" "y" INSTALL_TMUX
146
+ if [[ "$INSTALL_TMUX" == "y" ]]; then
147
+ sudo apt install -y tmux
148
+ log_success "tmux installed"
149
+ else
150
+ log_error "tmux is required. Install it manually and re-run."
151
+ exit 1
152
+ fi
85
153
  fi
86
154
 
87
155
  # ─── Node.js ──────────────────────────────────────────────────────────────────
@@ -98,7 +166,6 @@ install_node() {
98
166
  log_success "Node.js $(node --version) installed"
99
167
  }
100
168
 
101
- # Check for existing node
102
169
  NODE_OK=false
103
170
  if command -v node &> /dev/null; then
104
171
  NODE_VERSION=$(node --version | sed 's/v//' | cut -d. -f1)
@@ -108,7 +175,6 @@ if command -v node &> /dev/null; then
108
175
  fi
109
176
  fi
110
177
 
111
- # Check ~/.n/bin as well
112
178
  if [[ "$NODE_OK" == false ]] && [[ -x "$HOME/.n/bin/node" ]]; then
113
179
  export PATH="$HOME/.n/bin:$PATH"
114
180
  NODE_VERSION=$(node --version | sed 's/v//' | cut -d. -f1)
@@ -150,27 +216,33 @@ fi
150
216
 
151
217
  echo ""
152
218
 
153
- # ─── Install ──────────────────────────────────────────────────────────────────
219
+ # ─── Install from npm ────────────────────────────────────────────────────────
154
220
 
155
- if [[ -d "$INSTALL_DIR/repo" ]]; then
156
- log_info "Updating existing installation..."
157
- cd "$INSTALL_DIR/repo"
158
- git pull --ff-only
159
- else
160
- log_info "Cloning ClaudeDeck..."
161
- mkdir -p "$INSTALL_DIR"
162
- git clone "$REPO_URL" "$INSTALL_DIR/repo"
163
- 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
164
227
  fi
165
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
+
166
240
  # Dependencies
167
241
  log_info "Installing dependencies..."
168
242
  pnpm install > /dev/null 2>&1
169
243
 
170
244
  # Approve native builds if needed
171
- if grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
172
- : # already configured
173
- else
245
+ if ! grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
174
246
  node -e "
175
247
  const pkg = require('./package.json');
176
248
  pkg.pnpm = pkg.pnpm || {};
@@ -182,15 +254,15 @@ fi
182
254
 
183
255
  # Write .env
184
256
  log_info "Writing .env..."
185
- cat > "$INSTALL_DIR/repo/.env" << EOF
257
+ cat > "$INSTALL_DIR/app/.env" << EOF
186
258
  PORT=$PORT
187
259
  EOF
188
260
 
189
261
  if [[ -n "$SSH_HOST" ]]; then
190
- echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/repo/.env"
262
+ echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/app/.env"
191
263
  fi
192
264
  if [[ -n "$SSH_PORT" ]] && [[ "$SSH_PORT" != "22" ]]; then
193
- echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/repo/.env"
265
+ echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/app/.env"
194
266
  fi
195
267
 
196
268
  # Build
@@ -206,7 +278,8 @@ fi
206
278
  # ─── Systemd service ─────────────────────────────────────────────────────────
207
279
 
208
280
  NODE_BIN=$(which node)
209
- 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"
210
283
 
211
284
  SERVICE_FILE="[Unit]
212
285
  Description=ClaudeDeck
@@ -215,9 +288,9 @@ After=network.target
215
288
  [Service]
216
289
  Type=simple
217
290
  User=$USER
218
- WorkingDirectory=$INSTALL_DIR/repo
291
+ WorkingDirectory=$APP_DIR
219
292
  Environment=NODE_ENV=production
220
- 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
221
294
  ExecStart=$TSX_BIN --env-file=.env server.ts
222
295
  Restart=on-failure
223
296
  RestartSec=5
@@ -251,8 +324,10 @@ fi
251
324
 
252
325
  # ─── Done ─────────────────────────────────────────────────────────────────────
253
326
 
327
+ VERSION=$(node -e "console.log(require('./package.json').version)" 2>/dev/null || echo "")
328
+
254
329
  echo ""
255
- echo -e "${GREEN}${BOLD} ClaudeDeck installed!${NC}"
330
+ echo -e "${GREEN}${BOLD} ClaudeDeck${VERSION:+ v$VERSION} installed!${NC}"
256
331
  echo ""
257
332
  echo -e " ${BOLD}Local:${NC} http://localhost:$PORT"
258
333
  if [[ -n "$SSH_HOST" ]]; then
@@ -260,5 +335,6 @@ if [[ -n "$SSH_HOST" ]]; then
260
335
  fi
261
336
  echo ""
262
337
  echo -e " ${DIM}First visit will prompt you to create an account.${NC}"
263
- 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}"
264
340
  echo ""