@quantiya/codevibe 1.0.3 → 1.0.4

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/bin/codevibe +154 -9
  2. package/package.json +1 -1
package/bin/codevibe CHANGED
@@ -1,15 +1,18 @@
1
1
  #!/bin/bash
2
2
  #
3
- # codevibe - CodeVibe shared authentication CLI
3
+ # codevibe - CodeVibe CLI
4
4
  #
5
- # Delegates to @quantiya/codevibe-core's CLI for shared auth commands.
5
+ # Manages authentication, updates, and plugin lifecycle.
6
6
  # Authentication is shared across all CodeVibe plugins (Claude, Codex, Gemini).
7
7
  #
8
8
  # Usage:
9
9
  # codevibe login # Sign in via browser
10
10
  # codevibe logout # Sign out
11
11
  # codevibe status # Show auth status
12
+ # codevibe update # Update all CodeVibe packages + Claude plugin
13
+ # codevibe version # Show installed versions
12
14
  # codevibe reset-device # Reset device identity (destructive)
15
+ # codevibe --help # Show this help
13
16
  #
14
17
  # Environment:
15
18
  # ENVIRONMENT # Set to 'production' (default) or 'development'
@@ -17,6 +20,15 @@
17
20
 
18
21
  export ENVIRONMENT="${ENVIRONMENT:-production}"
19
22
 
23
+ # Colors
24
+ PURPLE='\033[0;35m'
25
+ GREEN='\033[0;32m'
26
+ YELLOW='\033[1;33m'
27
+ BOLD='\033[1m'
28
+ DIM='\033[2m'
29
+ NC='\033[0m'
30
+
31
+ # Resolve symlinks to find the actual script location
20
32
  SOURCE="${BASH_SOURCE[0]}"
21
33
  while [ -L "$SOURCE" ]; do
22
34
  DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
@@ -26,11 +38,144 @@ done
26
38
  SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
27
39
  PACKAGE_DIR="$(dirname "$SCRIPT_DIR")"
28
40
 
29
- CORE_CLI="$PACKAGE_DIR/node_modules/@quantiya/codevibe-core/bin/codevibe.js"
41
+ # ─── Help ────────────────────────────────────────────────────────────
42
+
43
+ show_help() {
44
+ echo ""
45
+ echo -e "${BOLD}CodeVibe${NC} — Control AI coding agents from your phone"
46
+ echo ""
47
+ echo "Usage: codevibe <command>"
48
+ echo ""
49
+ echo "Commands:"
50
+ echo " login Sign in with Apple or Google (opens browser)"
51
+ echo " logout Sign out"
52
+ echo " status Show authentication status"
53
+ echo " update Update all CodeVibe packages and Claude plugin"
54
+ echo " version Show installed package versions"
55
+ echo " reset-device Reset device identity (destructive)"
56
+ echo ""
57
+ echo "Agent wrappers:"
58
+ echo " codevibe-claude Start Claude Code with mobile sync"
59
+ echo " codevibe-gemini Start Gemini CLI with mobile sync"
60
+ echo " codevibe-codex Start Codex CLI with mobile sync"
61
+ echo ""
62
+ echo -e "${DIM}https://quantiya.ai/codevibe${NC}"
63
+ echo ""
64
+ }
65
+
66
+ # ─── Version ─────────────────────────────────────────────────────────
67
+
68
+ show_version() {
69
+ echo ""
70
+ echo -e "${BOLD}CodeVibe Versions${NC}"
71
+ echo ""
72
+
73
+ # Meta-package version
74
+ if [ -f "$PACKAGE_DIR/package.json" ]; then
75
+ META_VER=$(node -p "require('$PACKAGE_DIR/package.json').version" 2>/dev/null || echo "?")
76
+ echo -e " @quantiya/codevibe ${GREEN}$META_VER${NC}"
77
+ fi
78
+
79
+ # Core version
80
+ CORE_PKG="$PACKAGE_DIR/node_modules/@quantiya/codevibe-core/package.json"
81
+ if [ -f "$CORE_PKG" ]; then
82
+ CORE_VER=$(node -p "require('$CORE_PKG').version" 2>/dev/null || echo "?")
83
+ echo -e " @quantiya/codevibe-core ${GREEN}$CORE_VER${NC}"
84
+ fi
85
+
86
+ # Plugin versions
87
+ for plugin in claude gemini codex; do
88
+ PKG="$PACKAGE_DIR/node_modules/@quantiya/codevibe-${plugin}-plugin/package.json"
89
+ if [ -f "$PKG" ]; then
90
+ VER=$(node -p "require('$PKG').version" 2>/dev/null || echo "?")
91
+ echo -e " @quantiya/codevibe-${plugin}-plugin ${GREEN}$VER${NC}"
92
+ fi
93
+ done
94
+
95
+ # Claude Code version
96
+ if command -v claude >/dev/null 2>&1; then
97
+ CLAUDE_VER=$(claude --version 2>/dev/null | head -1 || echo "?")
98
+ echo ""
99
+ echo -e " Claude Code ${GREEN}$CLAUDE_VER${NC}"
100
+ fi
101
+
102
+ echo ""
103
+ }
104
+
105
+ # ─── Update ──────────────────────────────────────────────────────────
106
+
107
+ do_update() {
108
+ echo ""
109
+ echo -e "${BOLD}${PURPLE}CodeVibe Update${NC}"
110
+ echo ""
111
+
112
+ # Show current versions
113
+ if [ -f "$PACKAGE_DIR/package.json" ]; then
114
+ CUR_VER=$(node -p "require('$PACKAGE_DIR/package.json').version" 2>/dev/null || echo "?")
115
+ echo -e " ${DIM}Current version: $CUR_VER${NC}"
116
+ fi
117
+ echo ""
118
+
119
+ # Update meta-package (pulls latest core + all plugins)
120
+ echo -e "${PURPLE}▸${NC} Updating @quantiya/codevibe..."
121
+ npm install -g --force @quantiya/codevibe@latest 2>&1 | tail -1
122
+ echo -e "${GREEN}✓${NC} CodeVibe updated"
123
+
124
+ # Update Claude plugin in Claude Code
125
+ if command -v claude >/dev/null 2>&1; then
126
+ echo ""
127
+ echo -e "${PURPLE}▸${NC} Updating Claude Code plugin..."
128
+
129
+ # Refresh marketplace
130
+ if claude plugin marketplace update codevibe-marketplace 2>/dev/null; then
131
+ echo -e "${GREEN}✓${NC} Marketplace refreshed"
132
+ else
133
+ echo -e "${YELLOW}!${NC} Marketplace refresh skipped"
134
+ fi
135
+
136
+ # Reinstall plugin (gets latest version from marketplace)
137
+ if claude plugin install codevibe-claude@codevibe-marketplace 2>/dev/null; then
138
+ echo -e "${GREEN}✓${NC} Claude plugin updated"
139
+ else
140
+ echo -e "${YELLOW}!${NC} Claude plugin update skipped"
141
+ fi
142
+ fi
143
+
144
+ echo ""
145
+
146
+ # Show new versions
147
+ echo -e "${BOLD}Updated versions:${NC}"
148
+ show_version
149
+ }
150
+
151
+ # ─── Command routing ─────────────────────────────────────────────────
30
152
 
31
- if [ -f "$CORE_CLI" ]; then
32
- exec node "$CORE_CLI" "$@"
33
- else
34
- echo "Error: @quantiya/codevibe-core not found. Try reinstalling: npm install -g @quantiya/codevibe" >&2
35
- exit 1
36
- fi
153
+ case "$1" in
154
+ --help|-h|help|"")
155
+ show_help
156
+ exit 0
157
+ ;;
158
+ version|--version|-v)
159
+ show_version
160
+ exit 0
161
+ ;;
162
+ update)
163
+ do_update
164
+ exit $?
165
+ ;;
166
+ login|logout|status|reset-device)
167
+ # Delegate to codevibe-core CLI
168
+ CORE_CLI="$PACKAGE_DIR/node_modules/@quantiya/codevibe-core/bin/codevibe.js"
169
+ if [ -f "$CORE_CLI" ]; then
170
+ exec node "$CORE_CLI" "$@"
171
+ else
172
+ echo "Error: @quantiya/codevibe-core not found. Try reinstalling: npm install -g @quantiya/codevibe" >&2
173
+ exit 1
174
+ fi
175
+ ;;
176
+ *)
177
+ echo "Unknown command: $1" >&2
178
+ echo "Run 'codevibe --help' for usage." >&2
179
+ exit 1
180
+ ;;
181
+ esac
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "CodeVibe - Monitor and control AI coding agents (Claude Code, Gemini CLI, Codex CLI) from your mobile device",
5
5
  "bin": {
6
6
  "codevibe": "./bin/codevibe",