gh-here 1.0.0
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 +156 -0
- package/bin/gh-here.js +1403 -0
- package/package.json +21 -0
- package/public/app.js +1316 -0
- package/public/highlight.css +121 -0
- package/public/styles.css +1757 -0
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# gh-here
|
|
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.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g .
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Navigate to any directory and run:
|
|
14
|
+
|
|
15
|
+
```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
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The app will automatically find an available port starting from 3000 and serve your current directory with a GitHub-like interface.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
### 📁 File Browsing
|
|
27
|
+
- Beautiful directory browsing with specific file type icons
|
|
28
|
+
- README preview with beautiful markdown rendering
|
|
29
|
+
- Language statistics for project overview
|
|
30
|
+
- Quick actions (copy path, download files, edit, rename, delete)
|
|
31
|
+
- .gitignore support with toggle functionality
|
|
32
|
+
- File and folder creation, editing, renaming, and deletion
|
|
33
|
+
- Responsive design for mobile and desktop
|
|
34
|
+
|
|
35
|
+
### 🎨 Code Viewing & Editing
|
|
36
|
+
- GitHub-accurate syntax highlighting for 25+ languages
|
|
37
|
+
- Line numbers with GitHub-style selection (click, shift-click, ctrl-click)
|
|
38
|
+
- In-browser file editing with auto-save to localStorage
|
|
39
|
+
- Raw and rendered markdown views
|
|
40
|
+
- Shareable URLs with line selections (`#L10-L20`)
|
|
41
|
+
- Syntax highlighting and line numbers in editor
|
|
42
|
+
|
|
43
|
+
### 🔀 Git Integration
|
|
44
|
+
- Automatic git repository detection
|
|
45
|
+
- Git status indicators with GitHub-style icons next to modified files
|
|
46
|
+
- Professional inline diff viewer with syntax highlighting
|
|
47
|
+
- View/Diff/Edit mode toggle for files with changes
|
|
48
|
+
- Beautiful raw git diff display with color coding
|
|
49
|
+
- Git branch display in navigation header
|
|
50
|
+
|
|
51
|
+
### ⌨️ Keyboard Navigation
|
|
52
|
+
- `j`/`k` or arrow keys to navigate files
|
|
53
|
+
- `Enter` or `o` to open files/folders
|
|
54
|
+
- `e` to edit focused file
|
|
55
|
+
- `c` to create new file
|
|
56
|
+
- `/` or `s` to focus search
|
|
57
|
+
- `h` to go up directory
|
|
58
|
+
- `t` to toggle theme
|
|
59
|
+
- `i` to toggle .gitignore filter
|
|
60
|
+
- `d` to show diff for focused file (if git changes)
|
|
61
|
+
- `r` to refresh
|
|
62
|
+
- `?` to show keyboard shortcuts
|
|
63
|
+
- `Ctrl/Cmd + S` to save file (in editor)
|
|
64
|
+
- `Esc` to close editor/dialogs
|
|
65
|
+
|
|
66
|
+
### 🌙 Themes & UI
|
|
67
|
+
- GitHub dark and light themes
|
|
68
|
+
- Smart header path (shows "gh-here" at root, path when browsing)
|
|
69
|
+
- Search functionality with keyboard shortcuts
|
|
70
|
+
- Breadcrumb navigation
|
|
71
|
+
- Error handling and loading states
|
|
72
|
+
- Notification system for user feedback
|
|
73
|
+
|
|
74
|
+
## Supported File Types
|
|
75
|
+
|
|
76
|
+
### Programming Languages
|
|
77
|
+
- JavaScript (.js, .mjs, .jsx) - React, Node.js
|
|
78
|
+
- TypeScript (.ts, .tsx)
|
|
79
|
+
- Python (.py)
|
|
80
|
+
- Java (.java)
|
|
81
|
+
- Go (.go)
|
|
82
|
+
- Rust (.rs)
|
|
83
|
+
- PHP (.php)
|
|
84
|
+
- Ruby (.rb)
|
|
85
|
+
- Swift (.swift)
|
|
86
|
+
- Kotlin (.kt)
|
|
87
|
+
- Dart (.dart)
|
|
88
|
+
|
|
89
|
+
### Web Technologies
|
|
90
|
+
- HTML (.html)
|
|
91
|
+
- CSS (.css, .scss, .sass, .less)
|
|
92
|
+
- JSON (.json)
|
|
93
|
+
- XML (.xml)
|
|
94
|
+
- YAML (.yml, .yaml)
|
|
95
|
+
|
|
96
|
+
### Documentation & Config
|
|
97
|
+
- Markdown (.md) - with beautiful rendering
|
|
98
|
+
- Text files (.txt)
|
|
99
|
+
- Configuration files (ESLint, Prettier, Webpack, etc.)
|
|
100
|
+
- Docker files (Dockerfile, docker-compose.yml)
|
|
101
|
+
- Environment files (.env)
|
|
102
|
+
|
|
103
|
+
### Media & Archives
|
|
104
|
+
- Images (.png, .jpg, .gif, .svg, .webp)
|
|
105
|
+
- Videos (.mp4, .mov, .avi)
|
|
106
|
+
- Audio (.mp3, .wav, .flac)
|
|
107
|
+
- Archives (.zip, .tar, .gz, .rar)
|
|
108
|
+
|
|
109
|
+
### Shell & Database
|
|
110
|
+
- Shell scripts (.sh, .bash, .zsh)
|
|
111
|
+
- SQL (.sql)
|
|
112
|
+
|
|
113
|
+
## Keyboard Shortcuts
|
|
114
|
+
|
|
115
|
+
| Shortcut | Action |
|
|
116
|
+
|----------|--------|
|
|
117
|
+
| `j` / `↓` | Move down |
|
|
118
|
+
| `k` / `↑` | Move up |
|
|
119
|
+
| `Enter` / `o` | Open file/folder |
|
|
120
|
+
| `e` | Edit focused file |
|
|
121
|
+
| `c` | Create new file |
|
|
122
|
+
| `h` | Go up directory |
|
|
123
|
+
| `/` / `s` | Focus search |
|
|
124
|
+
| `Ctrl/Cmd + K` | Focus search |
|
|
125
|
+
| `Ctrl/Cmd + G` | Go to top |
|
|
126
|
+
| `Shift + G` | Go to bottom |
|
|
127
|
+
| `t` | Toggle theme |
|
|
128
|
+
| `i` | Toggle .gitignore filter |
|
|
129
|
+
| `d` | Show diff for focused file |
|
|
130
|
+
| `r` | Refresh page |
|
|
131
|
+
| `?` | Show keyboard shortcuts |
|
|
132
|
+
| `Ctrl/Cmd + S` | Save file (in editor) |
|
|
133
|
+
| `Esc` | Close editor/dialogs |
|
|
134
|
+
|
|
135
|
+
## Line Selection (Code Files)
|
|
136
|
+
|
|
137
|
+
- **Click line number**: Select single line
|
|
138
|
+
- **Shift + Click**: Select range
|
|
139
|
+
- **Ctrl/Cmd + Click**: Multi-select lines
|
|
140
|
+
- **URLs**: Automatically updated (`#L5`, `#L10-L20`, `#L1,L5-L10`)
|
|
141
|
+
|
|
142
|
+
## Development
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm install
|
|
146
|
+
npm start
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Navigate to `http://localhost:3000` to view the interface.
|
|
150
|
+
|
|
151
|
+
## Dependencies
|
|
152
|
+
|
|
153
|
+
- **express** - Web server
|
|
154
|
+
- **highlight.js** - Syntax highlighting
|
|
155
|
+
- **marked** - Markdown rendering
|
|
156
|
+
- **@primer/octicons** - GitHub icons
|