glidercli 0.1.1 → 0.1.3

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.
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+ # Auto-prompt to set email on checkout if not set correctly
3
+ # If allowed_emails is empty, skip check
4
+
5
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
6
+ CONFIG="$ROOT/repo.config.json"
7
+ EMAIL=$(git config user.email 2>/dev/null)
8
+
9
+ # Read allowed emails from config
10
+ if [[ -f "$CONFIG" ]] && command -v jq &>/dev/null; then
11
+ ALLOWED=$(jq -r '.allowed_emails[]' "$CONFIG" 2>/dev/null)
12
+ else
13
+ exit 0
14
+ fi
15
+
16
+ # If no emails configured, skip check
17
+ [[ -z "$ALLOWED" ]] && exit 0
18
+
19
+ echo "$ALLOWED" | grep -qx "$EMAIL" && exit 0
20
+
21
+ echo ""
22
+ echo "⚠ Git email not set. Pick one from repo.config.json:"
23
+ echo "$ALLOWED" | sed 's/^/ git config user.email '\''/' | sed 's/$/'\''/'
24
+ echo ""
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+ # Blocks commits if email not in allowed list (reads from repo.config.json)
3
+ # If allowed_emails is empty, skip check (user hasn't configured yet)
4
+
5
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
6
+ CONFIG="$ROOT/repo.config.json"
7
+ EMAIL=$(git config user.email)
8
+
9
+ # Read allowed emails from config
10
+ if [[ -f "$CONFIG" ]] && command -v jq &>/dev/null; then
11
+ ALLOWED=$(jq -r '.allowed_emails[]' "$CONFIG" 2>/dev/null)
12
+ else
13
+ # No config or jq - skip check
14
+ exit 0
15
+ fi
16
+
17
+ # If no emails configured, skip check
18
+ [[ -z "$ALLOWED" ]] && exit 0
19
+
20
+ echo "$ALLOWED" | grep -qx "$EMAIL" && exit 0
21
+
22
+ echo ""
23
+ echo "❌ BLOCKED: $EMAIL not allowed"
24
+ echo ""
25
+ echo "Allowed emails (from repo.config.json):"
26
+ echo "$ALLOWED" | sed 's/^/ /'
27
+ echo ""
28
+ echo "Fix: git config user.email '<one of the above>'"
29
+ echo ""
30
+ exit 1
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+ # pre-push hook - runs health check before push
3
+ # Blocks push if large files or embedded repos detected
4
+
5
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
6
+ HEALTH_SCRIPT="$ROOT/.github/scripts/health-check.sh"
7
+
8
+ if [[ -x "$HEALTH_SCRIPT" ]]; then
9
+ "$HEALTH_SCRIPT"
10
+ exit $?
11
+ fi
12
+
13
+ exit 0
@@ -0,0 +1,127 @@
1
+ #!/bin/bash
2
+ # health-check.sh - Git health check before commit/push
3
+ # Checks: large files (>90MB), embedded git repos
4
+ # Run: .github/scripts/health-check.sh [size_mb]
5
+
6
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
7
+ SIZE_MB="${1:-90}"
8
+ LIMIT=$((SIZE_MB * 1024 * 1024))
9
+
10
+ cd "$ROOT" || exit 1
11
+
12
+ echo "🏥 Git Health Check: $ROOT"
13
+ echo "==================="
14
+ echo ""
15
+
16
+ ISSUES=0
17
+
18
+ # ============================================================================
19
+ # CHECK 1: Large files (>90MB default)
20
+ # ============================================================================
21
+ echo "🔍 Checking for files > ${SIZE_MB}MB..."
22
+ echo ""
23
+
24
+ echo "=== UNSTAGED/UNTRACKED ==="
25
+ while IFS= read -r line; do
26
+ [[ -z "$line" ]] && continue
27
+ file="${line:3}"
28
+ # Handle renames
29
+ [[ "$line" == R* ]] && file="${file##* -> }"
30
+ if [[ -f "$file" ]]; then
31
+ fsize=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo "0")
32
+ if [[ "$fsize" -gt "$LIMIT" ]]; then
33
+ size_human=$((fsize / 1024 / 1024))
34
+ echo " 🔴 $file (${size_human}MB)"
35
+ ISSUES=1
36
+ fi
37
+ fi
38
+ done < <(git status --porcelain 2>/dev/null)
39
+
40
+ echo ""
41
+ echo "=== STAGED ==="
42
+ while IFS= read -r file; do
43
+ [[ -z "$file" ]] && continue
44
+ if [[ -f "$file" ]]; then
45
+ fsize=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo "0")
46
+ if [[ "$fsize" -gt "$LIMIT" ]]; then
47
+ size_human=$((fsize / 1024 / 1024))
48
+ echo " 🔴 $file (${size_human}MB)"
49
+ ISSUES=1
50
+ fi
51
+ fi
52
+ done < <(git diff --cached --name-only 2>/dev/null)
53
+
54
+ echo ""
55
+ echo "=== COMMITTED (last 10) ==="
56
+ while IFS= read -r file; do
57
+ [[ -z "$file" ]] && continue
58
+ if [[ -f "$file" ]]; then
59
+ fsize=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo "0")
60
+ if [[ "$fsize" -gt "$LIMIT" ]]; then
61
+ size_human=$((fsize / 1024 / 1024))
62
+ echo " 🔴 $file (${size_human}MB)"
63
+ ISSUES=1
64
+ fi
65
+ fi
66
+ done < <(git log --oneline -10 --diff-filter=A --name-only --pretty=format:"" 2>/dev/null | sort -u)
67
+
68
+ if [[ $ISSUES -eq 0 ]]; then
69
+ echo " 🟢 No large files"
70
+ fi
71
+
72
+ echo ""
73
+
74
+ # ============================================================================
75
+ # CHECK 2: Embedded git repos
76
+ # ============================================================================
77
+ echo "🔍 Checking for embedded git repos..."
78
+ echo ""
79
+
80
+ ROOT_GIT="$ROOT/.git"
81
+ EMBEDDED=()
82
+
83
+ while IFS= read -r git_dir; do
84
+ [[ -z "$git_dir" ]] && continue
85
+ [[ "$git_dir" == "$ROOT_GIT" ]] && continue
86
+
87
+ repo_dir="${git_dir%/.git}"
88
+ relative="${repo_dir#$ROOT/}"
89
+
90
+ # Check if tracked or not ignored
91
+ is_tracked=false
92
+ git ls-files --cached "$relative" 2>/dev/null | grep -q . && is_tracked=true
93
+
94
+ is_ignored=false
95
+ git check-ignore -q "$relative" 2>/dev/null && is_ignored=true
96
+
97
+ if [[ "$is_tracked" == "true" ]]; then
98
+ echo " 🔴 $relative (TRACKED - needs removal)"
99
+ EMBEDDED+=("$relative")
100
+ ISSUES=1
101
+ elif [[ "$is_ignored" == "false" ]]; then
102
+ echo " 🟡 $relative (not ignored - add to .gitignore)"
103
+ EMBEDDED+=("$relative")
104
+ ISSUES=1
105
+ fi
106
+ done < <(find "$ROOT" -type d -name ".git" 2>/dev/null | sort)
107
+
108
+ if [[ ${#EMBEDDED[@]} -eq 0 ]]; then
109
+ echo " 🟢 No embedded repos"
110
+ else
111
+ echo ""
112
+ echo "Fix: Add to .gitignore:"
113
+ for repo in "${EMBEDDED[@]}"; do
114
+ echo " $repo/"
115
+ done
116
+ fi
117
+
118
+ echo ""
119
+ echo "==================="
120
+
121
+ if [[ $ISSUES -eq 0 ]]; then
122
+ echo "🟢 All checks passed"
123
+ exit 0
124
+ else
125
+ echo "🔴 Issues found - fix before pushing"
126
+ exit 1
127
+ fi
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+ # setup.sh - run after cloning
3
+ # Installs hooks and prompts for email config
4
+
5
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
6
+ cd "$ROOT"
7
+
8
+ # 1. Install hooks
9
+ mkdir -p .git/hooks
10
+ cp .github/hooks/* .git/hooks/ 2>/dev/null
11
+ chmod +x .git/hooks/* 2>/dev/null
12
+ echo "✓ Hooks installed"
13
+
14
+ # 2. Prompt user to set email
15
+ echo ""
16
+ echo "Set your git email:"
17
+ echo " git config user.email 'github.relock416@passmail.net' # vdutts"
18
+ echo " git config user.email 'me@vd7.io' # vdutts7"
19
+ echo ""
package/README.md CHANGED
@@ -1,113 +1,124 @@
1
- # 🚀 @vd7/glider
1
+ <div align="center">
2
2
 
3
- Browser automation CLI with autonomous loop execution. Control Chrome via CDP, run YAML task files, execute in Ralph Wiggum loops.
3
+ <img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1768050242/gh-repos/glidercli/code.png" alt="logo" width="80" height="80" />
4
+ <img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1768050244/gh-repos/glidercli/github.png" alt="logo" width="80" height="80" />
4
5
 
5
- ## Install
6
+ <h1 align="center">glidercli</h1>
7
+ <p align="center"><i><b>Browser automation CLI with autonomous loop execution.</b></i></p>
6
8
 
7
- ```bash
8
- npm install -g @vd7/glider
9
- ```
9
+ [![Github][github]][github-url]
10
+ [![npm][npm]][npm-url]
10
11
 
11
- ### Requirements
12
+ <img src="https://res.cloudinary.com/ddyc1es5v/image/upload/v1768050244/gh-repos/glidercli/social-preview.png" />
12
13
 
13
- - Node.js 18+
14
- - [bserve](https://github.com/vdutts/glider-crx) relay server
15
- - Glider Chrome extension
14
+ </div>
16
15
 
17
- ## Quick Start
16
+ <br/>
18
17
 
19
- ```bash
20
- # Check status
21
- glider status
18
+ ## Table of Contents
22
19
 
23
- # Navigate
24
- glider goto "https://google.com"
20
+ <ol>
21
+ <a href="#about">📝 About</a><br/>
22
+ <a href="#install">💻 Install</a><br/>
23
+ <a href="#usage">🚀 Usage</a><br/>
24
+ <a href="#the-loop">🔄 The Loop</a><br/>
25
+ <a href="#task-files">📄 Task Files</a><br/>
26
+ <a href="#commands">⚡ Commands</a><br/>
27
+ <a href="#tools-used">🔧 Tools used</a><br/>
28
+ <a href="#contact">👤 Contact</a>
29
+ </ol>
25
30
 
26
- # Execute JavaScript
27
- glider eval "document.title"
31
+ <br/>
28
32
 
29
- # Run a task file
30
- glider run mytask.yaml
33
+ ## 📝About
31
34
 
32
- # Run in autonomous loop
33
- glider loop mytask.yaml -n 20
34
- ```
35
+ Control Chrome from terminal. Run YAML tasks. Loop until complete (Ralph Wiggum pattern).
35
36
 
36
- ## Commands
37
+ - **CDP-based** - Direct Chrome DevTools Protocol control
38
+ - **YAML tasks** - Define automation steps declaratively
39
+ - **Autonomous loops** - Run until completion marker found
40
+ - **Safety guards** - Max iterations, timeout, exponential backoff
37
41
 
38
- ### Server
39
- | Command | Description |
40
- |---------|-------------|
41
- | `glider status` | Check server, extension, tabs |
42
- | `glider start` | Start relay server |
43
- | `glider stop` | Stop relay server |
42
+ ## 💻Install
44
43
 
45
- ### Navigation
46
- | Command | Description |
47
- |---------|-------------|
48
- | `glider goto <url>` | Navigate to URL |
49
- | `glider eval <js>` | Execute JavaScript |
50
- | `glider click <selector>` | Click element |
51
- | `glider type <sel> <text>` | Type into input |
52
- | `glider screenshot [path]` | Take screenshot |
53
- | `glider text` | Get page text |
44
+ ```bash
45
+ npm i -g glidercli
46
+ ```
47
+
48
+ ### Requirements
54
49
 
55
- ### Automation
56
- | Command | Description |
57
- |---------|-------------|
58
- | `glider run <task.yaml>` | Execute YAML task file |
59
- | `glider loop <task> [opts]` | Run in Ralph Wiggum loop |
50
+ - Node 18+
51
+ - Chrome with Glider extension
52
+ - bserve relay server
60
53
 
61
- ## Task File Format
54
+ ## 🚀Usage
62
55
 
63
- ```yaml
64
- name: "Get page data"
65
- steps:
66
- - goto: "https://example.com"
67
- - wait: 2
68
- - eval: "document.title"
69
- - click: "button.submit"
70
- - type: ["#input", "hello world"]
71
- - screenshot: "/tmp/shot.png"
72
- - assert: "document.title.includes('Example')"
73
- - log: "Done"
56
+ ```bash
57
+ glider status # check connection
58
+ glider goto "https://x.com" # navigate
59
+ glider eval "document.title" # run JS
60
+ glider run task.yaml # execute task file
61
+ glider loop task.yaml -n 50 # autonomous loop
74
62
  ```
75
63
 
76
- ## Ralph Wiggum Loop
64
+ ## 🔄The Loop
77
65
 
78
- The `loop` command implements autonomous execution:
66
+ The `loop` command runs your task repeatedly until:
67
+ - Completion marker found (`LOOP_COMPLETE` or `DONE`)
68
+ - Max iterations reached
69
+ - Timeout hit
79
70
 
80
71
  ```bash
81
- glider loop mytask.yaml -n 20 -t 600 -m "DONE"
72
+ glider loop scrape-feed.yaml -n 100 -t 3600
82
73
  ```
83
74
 
84
- Options:
85
- - `-n, --max-iterations N` - Max iterations (default: 10)
86
- - `-t, --timeout N` - Max runtime in seconds (default: 3600)
87
- - `-m, --marker STRING` - Completion marker (default: LOOP_COMPLETE)
88
-
89
- The loop:
90
- 1. Executes task steps repeatedly
91
- 2. Checks for completion marker in output or task file
92
- 3. Stops when marker found or limits reached
93
- 4. Saves state to `/tmp/glider-state.json`
94
- 5. Implements exponential backoff on errors
75
+ Safety: max iterations, timeout, exponential backoff on errors, state persistence.
95
76
 
96
- ## Architecture
77
+ ## 📄Task Files
97
78
 
98
- ```
99
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
100
- │ glider CLI │────▶│ bserve │────▶│ Extension │
101
- (this pkg) │ │ (relay) │ │ (Chrome) │
102
- └─────────────┘ └─────────────┘ └─────────────┘
103
-
104
-
105
- ┌─────────────┐
106
- │ Browser │
107
- │ (CDP) │
108
- └─────────────┘
79
+ ```yaml
80
+ name: "Get timeline"
81
+ steps:
82
+ - goto: "https://x.com/home"
83
+ - wait: 3
84
+ - eval: "document.querySelectorAll('article').length"
85
+ - screenshot: "/tmp/timeline.png"
109
86
  ```
110
87
 
111
- ## License
88
+ ## ⚡Commands
112
89
 
113
- MIT
90
+ | Command | What |
91
+ |---------|------|
92
+ | `glider status` | Server/extension/tab status |
93
+ | `glider start` | Start relay server |
94
+ | `glider goto <url>` | Navigate |
95
+ | `glider eval <js>` | Execute JavaScript |
96
+ | `glider click <sel>` | Click element |
97
+ | `glider type <sel> <text>` | Type into input |
98
+ | `glider screenshot` | Capture page |
99
+ | `glider run <file>` | Run YAML task |
100
+ | `glider loop <file>` | Autonomous loop |
101
+
102
+ ## 🔧Tools Used
103
+
104
+ [![Node.js][nodejs-badge]][nodejs-url]
105
+ [![Chrome DevTools Protocol][cdp-badge]][cdp-url]
106
+
107
+ ## 👤Contact
108
+
109
+ [![Email][email]][email-url]
110
+ [![Twitter][twitter]][twitter-url]
111
+
112
+ <!-- BADGES -->
113
+ [github]: https://img.shields.io/badge/💻_glidercli-000000?style=for-the-badge
114
+ [github-url]: https://github.com/vdutts7/glidercli
115
+ [npm]: https://img.shields.io/badge/npm-glidercli-CB3837?style=for-the-badge&logo=npm
116
+ [npm-url]: https://www.npmjs.com/package/glidercli
117
+ [nodejs-badge]: https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white
118
+ [nodejs-url]: https://nodejs.org
119
+ [cdp-badge]: https://img.shields.io/badge/Chrome_DevTools_Protocol-4285F4?style=for-the-badge&logo=googlechrome&logoColor=white
120
+ [cdp-url]: https://chromedevtools.github.io/devtools-protocol/
121
+ [email]: https://img.shields.io/badge/Email-000000?style=for-the-badge&logo=Gmail&logoColor=white
122
+ [email-url]: mailto:me@vd7.io
123
+ [twitter]: https://img.shields.io/badge/Twitter-000000?style=for-the-badge&logo=Twitter&logoColor=white
124
+ [twitter-url]: https://twitter.com/vaboratory
File without changes
package/bin/glider.js CHANGED
@@ -41,9 +41,28 @@ const RED = '\x1b[31m';
41
41
  const GREEN = '\x1b[32m';
42
42
  const YELLOW = '\x1b[33m';
43
43
  const BLUE = '\x1b[34m';
44
+ const MAGENTA = '\x1b[35m';
44
45
  const CYAN = '\x1b[36m';
46
+ const WHITE = '\x1b[37m';
47
+ const BOLD = '\x1b[1m';
48
+ const DIM = '\x1b[2m';
45
49
  const NC = '\x1b[0m';
46
50
 
51
+ // Banner - ASCII art with gradient colors
52
+ const BANNER = `
53
+ ${CYAN} ________ ${MAGENTA}________ ${BLUE}__________ ${NC}
54
+ ${CYAN} / ____/ / ${MAGENTA}/ _/ __ \\${BLUE}/ ____/ __ \\${NC}
55
+ ${CYAN} / / __/ / ${MAGENTA}/ // / / /${BLUE} __/ / /_/ /${NC}
56
+ ${CYAN}/ /_/ / /____${MAGENTA}/ // /_/ /${BLUE} /___/ _, _/ ${NC}
57
+ ${CYAN}\\____/_____/${MAGENTA}___/_____/${BLUE}_____/_/ |_| ${NC}
58
+ ${DIM} Browser Automation CLI v${require('../package.json').version}${NC}
59
+ ${DIM} github.com/vdutts7/glidercli${NC}
60
+ `;
61
+
62
+ function showBanner() {
63
+ console.log(BANNER);
64
+ }
65
+
47
66
  const log = {
48
67
  ok: (msg) => console.error(`${GREEN}✓${NC} ${msg}`),
49
68
  fail: (msg) => console.error(`${RED}✗${NC} ${msg}`),
@@ -134,8 +153,9 @@ async function getTargets() {
134
153
 
135
154
  // Commands
136
155
  async function cmdStatus() {
156
+ showBanner();
137
157
  console.log('═══════════════════════════════════════');
138
- console.log(' GLIDER STATUS');
158
+ console.log(' STATUS');
139
159
  console.log('═══════════════════════════════════════');
140
160
 
141
161
  const serverOk = await checkServer();
@@ -611,9 +631,8 @@ async function cmdLoop(taskFileOrPrompt, options = {}) {
611
631
 
612
632
  // Help
613
633
  function showHelp() {
634
+ showBanner();
614
635
  console.log(`
615
- ${CYAN}GLIDER${NC} - Browser Automation CLI with Autonomous Loop Execution
616
-
617
636
  ${YELLOW}USAGE:${NC}
618
637
  glider <command> [args]
619
638
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glidercli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Browser automation CLI with autonomous loop execution. Control Chrome via CDP, run YAML task files, execute in Ralph Wiggum loops.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "license": "MIT",
26
26
  "repository": {
27
27
  "type": "git",
28
- "url": "https://github.com/vdutts7/glider-cli.git"
28
+ "url": "https://github.com/vdutts7/glidercli.git"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=18.0.0"
@@ -0,0 +1,31 @@
1
+ {
2
+ "repo": {
3
+ "name": "glidercli",
4
+ "description": "Browser automation CLI with autonomous loop execution",
5
+ "homepage": "https://npmjs.com/package/glidercli",
6
+ "topics": ["ralph", "claude", "claude-code", "autonomous-agents", "browser-automation", "cdp", "chrome-devtools", "ralph-wiggum"]
7
+ },
8
+ "owner": {
9
+ "github_username": "vdutts7",
10
+ "website": "https://vd7.io",
11
+ "twitter": "vaboratory"
12
+ },
13
+ "allowed_emails": [
14
+ "github.relock416@passmail.net",
15
+ "me@vd7.io"
16
+ ],
17
+ "social_preview": {
18
+ "title": "glidercli",
19
+ "icons_dir": "assets/icons",
20
+ "icon_creator": "https://vd7.dev/icon-creator",
21
+ "dimensions": {
22
+ "width": 1280,
23
+ "height": 640
24
+ }
25
+ },
26
+ "npm": {
27
+ "package_name": "glidercli",
28
+ "alt_package": "@vd7/glider",
29
+ "bin_command": "glider"
30
+ }
31
+ }