gh-here 1.0.0 → 1.0.2

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,21 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(if [ -f scripts/lint ])",
5
+ "Bash(then scripts/lint)",
6
+ "Bash(elif [ -f script/lint ])",
7
+ "Bash(then script/lint)",
8
+ "Bash(elif [ -f package.json ])",
9
+ "Bash(then npm run lint)",
10
+ "Bash(else echo \"No linting script found\")",
11
+ "Bash(fi)",
12
+ "Bash(git checkout:*)",
13
+ "Bash(git add:*)",
14
+ "Bash(git commit:*)",
15
+ "Bash(git push:*)",
16
+ "Bash(gh pr view:*)"
17
+ ],
18
+ "deny": [],
19
+ "ask": []
20
+ }
21
+ }
package/README.md CHANGED
@@ -1,11 +1,23 @@
1
1
  # gh-here
2
2
 
3
- A local GitHub-like file browser for viewing code in your terminal. Launch it in any folder to get a beautiful web-based directory browser with syntax highlighting and powerful navigation features.
3
+ A local GitHub-like file browser for viewing and exploring codebases in your browser. Launch it in any folder to get a beautiful web-based directory browser with syntax highlighting and powerful navigation features.
4
+
5
+ ## Why?
6
+
7
+ TUIs (Terminal User Interfaces) like Claude Code, Google Gemini CLI, and Cursor are becoming very popular tools for working on codebases, but they don't provide a visual view into the directories and files themselves. gh-here exists to fill that gap, so you can easily explore your project files in a familiar GitHub-esque browser GUI.
4
8
 
5
9
  ## Installation
6
10
 
11
+ Run gh-here directly with npx (no installation required):
12
+
13
+ ```bash
14
+ npx gh-here
15
+ ```
16
+
17
+ Or install it globally:
18
+
7
19
  ```bash
8
- npm install -g .
20
+ npm install -g gh-here
9
21
  ```
10
22
 
11
23
  ## Usage
@@ -13,10 +25,10 @@ npm install -g .
13
25
  Navigate to any directory and run:
14
26
 
15
27
  ```bash
16
- npx gh-here # Start server on available port
17
- npx gh-here --open # Start server and open browser
18
- npx gh-here --open --browser=safari # Start server and open in Safari
19
- npx gh-here --open --browser=arc # Start server and open in Arc
28
+ gh-here # Start server on available port
29
+ gh-here --open # Start server and open browser
30
+ gh-here --open --browser=safari # Start server and open in Safari
31
+ gh-here --open --browser=arc # Start server and open in Arc
20
32
  ```
21
33
 
22
34
  The app will automatically find an available port starting from 3000 and serve your current directory with a GitHub-like interface.
package/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "gh-here",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A local GitHub-like file browser for viewing code",
5
+ "repository": "https://github.com/corywilkerson/gh-here",
5
6
  "main": "index.js",
6
7
  "bin": {
7
8
  "gh-here": "./bin/gh-here.js"
8
9
  },
9
10
  "scripts": {
10
- "start": "node bin/gh-here.js"
11
+ "start": "node bin/gh-here.js",
12
+ "test": "echo yolo no tests yet"
11
13
  },
12
- "keywords": ["github", "file-browser", "code-viewer", "local"],
14
+ "keywords": [
15
+ "github",
16
+ "file-browser",
17
+ "code-viewer",
18
+ "local"
19
+ ],
13
20
  "author": "",
14
21
  "license": "MIT",
15
22
  "dependencies": {
@@ -18,4 +25,4 @@
18
25
  "marked": "^12.0.0",
19
26
  "@primer/octicons": "^19.8.0"
20
27
  }
21
- }
28
+ }
package/public/app.js CHANGED
@@ -35,11 +35,28 @@ document.addEventListener('DOMContentLoaded', function() {
35
35
  // Initialize
36
36
  updateFileRows();
37
37
 
38
- // Load saved theme or default to dark
39
- const savedTheme = localStorage.getItem('gh-here-theme') || 'dark';
38
+ // Detect system theme preference
39
+ const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
40
+ const systemTheme = systemPrefersDark ? 'dark' : 'light';
41
+
42
+ // Load saved theme or default to system preference
43
+ const savedTheme = localStorage.getItem('gh-here-theme') || systemTheme;
40
44
  html.setAttribute('data-theme', savedTheme);
41
45
  updateThemeIcon(savedTheme);
42
46
 
47
+ // Listen for system theme changes (only if no manual override is saved)
48
+ if (window.matchMedia) {
49
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
50
+ mediaQuery.addListener(function(e) {
51
+ // Only auto-update if user hasn't manually set a theme
52
+ if (!localStorage.getItem('gh-here-theme')) {
53
+ const newTheme = e.matches ? 'dark' : 'light';
54
+ html.setAttribute('data-theme', newTheme);
55
+ updateThemeIcon(newTheme);
56
+ }
57
+ });
58
+ }
59
+
43
60
  // Theme toggle functionality
44
61
  themeToggle.addEventListener('click', function() {
45
62
  const currentTheme = html.getAttribute('data-theme');