docs: complete documentation overhaul and changelog update
swadhinbiswas committed 9 months ago
bba9bff
1 parent 0c9b918
commit bba9bff
41 files changed
+3357 -384
Showing 41 changed files+3357-384
CHANGELOG.mdREADME.mdcli/CHANGELOG.mdcli/README.mdcli/bin/och.tscli/package-lock.jsoncli/package.jsoncli/src/commands/repo.tscli/src/lib/branding.tscli/src/lib/formatter.tscli/src/lib/progress.tsdocs/GDRIVE_STACK.mddocs/GRAFANA_SETUP.mddocs/administration/configuration.mddocs/administration/deployment.mddocs/administration/monitoring.mddocs/administration/security.mddocs/api/authentication.mddocs/api/rest-api.mddocs/development/architecture.mddocs/development/contributing.mddocs/development/database-schema.mddocs/development/publishing-cli.mddocs/development/testing.mddocs/getting-started/first-repository.mddocs/getting-started/installation.mddocs/getting-started/quick-start.mddocs/guides/branch-protection.mddocs/guides/storage-adapters.mddocs/guides/team-workflows.mddocs/guides/webhooks.mddocs/index.mddocs/reference/cli-commands.mddocs/reference/glossary.mddocs/support/troubleshooting.mddocs/tutorials/ai-powered-reviews.mddocs/tutorials/automated-deployment.mdpublic/architecture.svgpublic/stack-workflow.svgsrc/lib/git-storage.tssrc/lib/storage.ts
▼CHANGELOG.md
+26-23
| @@ -5,32 +5,35 @@ All notable changes to this project will be documented in this file. | ||
5 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
6 | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
7 | 7 | |
8 | -## [Unreleased] | |
8 | +## [1.1.0] - 2026-01-22 | |
9 | 9 | |
10 | -### Added | |
11 | -- **SDK**: Introduced `@opencodehub/sdk`, a TypeScript Client for programmatically interacting with the OpenCodeHub API. | |
12 | -- **CLI**: Released `opencodehub-cli` (v1.0.1) to npm. | |
13 | - - Added `och` command globally. | |
14 | - - Implemented smoke tests for CLI verification. | |
15 | -- **Documentation**: | |
16 | - - Added comprehensive "Roadmap" to `README.md` for Q2-Q4 2026. | |
17 | - - Added `docs/publishing.md` guide for CLI release management. | |
18 | -- **Assets**: Updated project logo to SVG format. | |
10 | +### 📚 Documentation (Major Overhaul) | |
11 | +- **Structure**: Reorganized `docs/` into a comprehensive knowledge base (`getting-started`, `guides`, `tutorials`, `api`, `administration`). | |
12 | +- **Visuals**: | |
13 | + - Added **Mermaid.js** C4 Architecture diagrams. | |
14 | + - Added **Git Graph** diagrams for workflow comparisons. | |
15 | + - Created custom SVGs for `stack-workflow` and `architecture`. | |
16 | +- **New Guides**: | |
17 | + - **Production Installation**: Detailed hardware specs, Nginx config, and go-live checklist. | |
18 | + - **API Reference**: Swagger-style documentation with JSON examples and parameter tables. | |
19 | + - **Troubleshooting**: Solutions for common errors (Docker, 403s, Database). | |
20 | + - **CLI Reference**: Unified command list for `opencodehub-cli`. | |
21 | + - **Glossary**: Definitions for core terms like "Stacked PRs" and "Merge Queue". | |
19 | 22 | |
20 | -### Changed | |
21 | -- **Logs**: Cleaned up production code by removing debug `console.log` statements in: | |
22 | - - `src/pages/[owner]/[repo]/milestones/index.astro` | |
23 | - - `src/pages/[owner]/[repo]/settings/deploy-keys.astro` | |
24 | - - `src/pages/[owner]/[repo]/wiki/index.astro` | |
25 | - - `src/pages/[owner]/[repo]/actions/index.astro` | |
26 | -- **Repo Links**: Updated all hardcoded GitHub repository URLs to point to `swadhinbiswas/OpencodeHub`. | |
23 | +### 💻 CLI (`v1.1.0`) | |
24 | +- **UI Polish**: | |
25 | + - Implemented "Dracula" theme for consistent coloring. | |
26 | + - Added ASCII art logo and gradient banners. | |
27 | + - Replaced raw logs with animated spinners (`ora`) and progress bars. | |
28 | + - Added "Success Boxes" for clearer operation summaries. | |
29 | +- **Commands**: | |
30 | + - `och stack view`: Now displays a visual ASCII tree of the current stack. | |
31 | + - `och push`: Shows PR compilation status and links. | |
27 | 32 | |
28 | -### Fixed | |
29 | -- **Security**: Fixed Critical Authorization Bypass in Issue Creation API (`issues/index.ts`). | |
30 | - - Now correctly checks `canReadRepo` before inserting issues. | |
31 | -- **Security**: Fixed Privacy Leak in Collaborators List API (`collaborators/index.ts`). | |
32 | - - Added permission check to prevent unauthorized users from enumerating members of private repositories. | |
33 | -- **CLI**: Fixed incorrect binary path in `cli/package.json` that prevented global execution. | |
33 | +### 🛡 Security & Fixes | |
34 | +- **Authorization**: Fixed critical bypass in `issues/index.ts` and `collaborators/index.ts`. | |
35 | +- **Fixes**: Resolved incorrect binary path in CLI package.json. | |
36 | +- **Repo Links**: Updated hardcoded GitHub links to the official repository. | |
34 | 37 | |
35 | 38 | ## [0.2.0] - 2026-01-21 |
36 | 39 | |
37 | 40 | |
▼README.md
+37-12
| @@ -1,20 +1,28 @@ | ||
1 | 1 | # OpenCodeHub |
2 | 2 | |
3 | 3 | <p align="center"> |
4 | - <img src="public/logo.svg" alt="OpenCodeHub Logo" width="200"> | |
4 | + <img src="public/logo.svg" alt="OpenCodeHub Logo" width="300"> | |
5 | + <br> | |
5 | 6 | </p> |
6 | 7 | |
7 | 8 | <p align="center"> |
8 | - <strong>A powerful, self-hosted Git platform with CI/CD, code review, and enterprise-grade security</strong> | |
9 | + <strong>The self-hosted Git platform for high-velocity teams.</strong><br> | |
10 | + Built for stacked PRs, AI code review, and enterprise security. | |
11 | +</p> | |
12 | + | |
13 | +<p align="center"> | |
14 | + <a href="https://www.npmjs.com/package/opencodehub-cli"><img src="https://img.shields.io/npm/v/opencodehub-cli?style=flat-square&color=bd93f9&label=CLI" alt="npm version"></a> | |
15 | + <a href="LICENSE"><img src="https://img.shields.io/github/license/swadhinbiswas/OpenCodeHub?style=flat-square&color=50fa7b" alt="License"></a> | |
16 | + <a href="https://github.com/swadhinbiswas/OpenCodeHub/actions"><img src="https://img.shields.io/github/actions/workflow/status/swadhinbiswas/OpenCodeHub/ci.yml?branch=main&style=flat-square&color=8be9fd" alt="Build Status"></a> | |
17 | + <a href="https://docker.com"><img src="https://img.shields.io/badge/docker-ready-blue?style=flat-square&logo=docker" alt="Docker"></a> | |
9 | 18 | </p> |
10 | 19 | |
11 | 20 | <p align="center"> |
12 | 21 | <a href="#-features">Features</a> • |
22 | + <a href="#-architecture">Architecture</a> • | |
13 | 23 | <a href="#-quick-start">Quick Start</a> • |
14 | - <a href="#%EF%B8%8F-configuration">Configuration</a> • | |
15 | - <a href="#-security">Security</a> • | |
16 | - <a href="#-production-deployment">Production</a> • | |
17 | - <a href="#-api">API</a> • | |
24 | + <a href="#-och-cli---command-line-interface">CLI</a> • | |
25 | + <a href="#-advanced-features">Advanced Features</a> • | |
18 | 26 | <a href="#-contributing">Contributing</a> |
19 | 27 | </p> |
20 | 28 | |
| @@ -70,6 +78,25 @@ | ||
70 | 78 | |
71 | 79 | --- |
72 | 80 | |
81 | + | |
82 | +--- | |
83 | + | |
84 | +## 🏗 Architecture | |
85 | + | |
86 | +<p align="center"> | |
87 | + <img src="public/architecture.svg" alt="System Architecture" width="800"> | |
88 | +</p> | |
89 | + | |
90 | +OpenCodeHub is built on a modern, scalable architecture designed for performance and flexibility. | |
91 | + | |
92 | +- **Frontend**: Astro + React for high-performance UI. | |
93 | +- **Backend API**: tRPC + Node.js for type-safe communication. | |
94 | +- **Git Server**: Custom implementation over standard Git protocols (HTTP/SSH). | |
95 | +- **Database**: Drizzle ORM supporting PostgreSQL, MySQL, and SQLite. | |
96 | +- **Storage**: Pluggable storage system (S3, R2, G-Drive, Local). | |
97 | + | |
98 | +--- | |
99 | + | |
73 | 100 | ## 📦 Quick Start |
74 | 101 | |
75 | 102 | ### Prerequisites |
| @@ -205,12 +232,10 @@ och status # Show stack status (alias: st) | ||
205 | 232 | |
206 | 233 | #### How It Works |
207 | 234 | |
208 | -```text | |
209 | -main | |
210 | - └── PR #123: Add database schema | |
211 | - └── PR #124: Add authentication service | |
212 | - └── PR #125: Add login UI | |
213 | -``` | |
235 | + | |
236 | +<br> | |
237 | + | |
238 | +Each PR builds on the previous one. When #123 merges, #124 automatically rebases. | |
214 | 239 | |
215 | 240 | Each PR builds on the previous one. When #123 merges, #124 automatically rebases. |
216 | 241 | |
217 | 242 | |
▼cli/CHANGELOG.md
+59-19
| @@ -1,27 +1,67 @@ | ||
1 | 1 | # Changelog |
2 | 2 | |
3 | -All notable changes to this project will be documented in this file. | |
3 | +All notable changes to OpenCodeHub CLI will be documented in this file. | |
4 | 4 | |
5 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
6 | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
7 | 7 | |
8 | -## [1.0.0] - 2026-01-17 | |
8 | +## [1.1.0] - 2026-01-22 | |
9 | 9 | |
10 | 10 | ### Added |
11 | -- Initial release of OpenCodeHub CLI | |
12 | -- `och auth` - Authentication commands (login, logout, whoami) | |
13 | -- `och stack` - Stack management (create, view, submit, sync, reorder) | |
14 | -- `och init` - Repository initialization | |
15 | -- `och status` - Stack status display | |
16 | -- `och config` - Configuration management | |
17 | -- Support for stacked pull requests | |
18 | -- Interactive prompts with Inquirer.js | |
19 | -- Progress spinners with Ora | |
20 | -- Colorful output with Chalk | |
21 | - | |
22 | -### Features | |
23 | -- Stack-first PR workflow | |
24 | -- Automatic PR dependency linking | |
25 | -- Smart stack rebasing | |
26 | -- Token-based authentication for CI/CD | |
27 | -- Cross-platform support (Windows, macOS, Linux) | |
11 | +- 🎨 **Production-Grade UI Overhaul** | |
12 | + - GitHub-like progress indicators for push operations | |
13 | + - Beautiful ASCII art logos with gradient colors | |
14 | + - Real-time upload/download speed indicators | |
15 | + - Professional boxed success/error messages | |
16 | + - Color-coded output throughout (green=success, red=error, cyan=info) | |
17 | + - Smooth spinners for long operations | |
18 | + - Object enumeration and compression progress display | |
19 | + | |
20 | +- **New Utility Modules** | |
21 | + - `branding.ts` - ASCII art, logos, and color schemes | |
22 | + - `progress.ts` - GitHub-style progress indicators and formatters | |
23 | + - `formatter.ts` - Boxed message formatting | |
24 | + | |
25 | +- **UI Dependencies** | |
26 | + - `boxen@^7.1.1` - Beautiful bordered boxes | |
27 | + - `figlet@^1.7.0` - ASCII art text | |
28 | + - `gradient-string@^2.0.2` - Gradient colors | |
29 | + - `cli-progress@^3.12.0` - Progress bars | |
30 | + | |
31 | +### Changed | |
32 | +- **Enhanced `och push` command** | |
33 | + - Now shows GitHub-style object enumeration | |
34 | + - Displays compression progress with thread count | |
35 | + - Shows upload speed in real-time | |
36 | + - Beautiful ref update notifications | |
37 | + - Success box with repository details and view URL | |
38 | + | |
39 | +- **Enhanced `och clone` command** | |
40 | + - Repository info spinner | |
41 | + - Success box with clone location | |
42 | + - Helpful next-step commands | |
43 | + | |
44 | +- **Enhanced `och create` command** | |
45 | + - ASCII celebration art on success | |
46 | + - Detailed info box with repository details | |
47 | + - Visual indication of public/private status | |
48 | + - Shows if remote was added to current repo | |
49 | + | |
50 | +### Improved | |
51 | +- Error messages now appear in formatted error boxes | |
52 | +- Better visual hierarchy with colors and formatting | |
53 | +- More professional and polished user experience | |
54 | +- GitHub-like workflow feel | |
55 | + | |
56 | +## [1.0.1] - 2024-XX-XX | |
57 | + | |
58 | +### Fixed | |
59 | +- Minor bug fixes and improvements | |
60 | + | |
61 | +## [1.0.0] - 2024-XX-XX | |
62 | + | |
63 | +### Added | |
64 | +- Initial release | |
65 | +- Basic repository operations (push, clone, create) | |
66 | +- Authentication system | |
67 | +- Configuration management | |
28 | 68 | |
▼cli/README.md
+164-85
| @@ -5,7 +5,7 @@ | ||
5 | 5 | <h1 align="center">OpenCodeHub CLI</h1> |
6 | 6 | |
7 | 7 | <p align="center"> |
8 | - <strong>Stack-first PR workflows from your terminal</strong> | |
8 | + <strong>🎨 Production-grade Git workflows with beautiful UI</strong> | |
9 | 9 | </p> |
10 | 10 | |
11 | 11 | <p align="center"> |
| @@ -17,9 +17,9 @@ | ||
17 | 17 | |
18 | 18 | <p align="center"> |
19 | 19 | <a href="#-installation">Installation</a> • |
20 | - <a href="#-quick-start">Quick Start</a> • | |
20 | + <a href="#-features">Features</a> • | |
21 | 21 | <a href="#-commands">Commands</a> • |
22 | - <a href="#-workflow-examples">Examples</a> • | |
22 | + <a href="#-examples">Examples</a> • | |
23 | 23 | <a href="#-contributing">Contributing</a> |
24 | 24 | </p> |
25 | 25 | |
| @@ -27,11 +27,12 @@ | ||
27 | 27 | |
28 | 28 | ## ✨ Features |
29 | 29 | |
30 | -- 📚 **Stacked PRs** - Create dependent pull requests that automatically update when parent changes | |
31 | -- 🔄 **Smart Sync** - Rebase entire stacks with a single command | |
32 | -- 🚀 **Fast Workflow** - Submit, update, and manage PRs without leaving your terminal | |
33 | -- 🔗 **GitHub/GitLab Alternative** - Works with self-hosted OpenCodeHub instances | |
34 | -- 🎯 **Zero Config** - Works out of the box with sensible defaults | |
30 | +- 🎨 **Beautiful UI** - GitHub-like progress indicators, ASCII art, and colored output | |
31 | +- 📦 **Git Push/Pull** - Fast repository operations with real-time progress | |
32 | +- 🚀 **Simple Commands** - `och push`, `och clone`, `och create` - that's it! | |
33 | +- 📊 **Progress Tracking** - See object enumeration, compression, and upload speeds | |
34 | +- 🎯 **Production Ready** - Professional output that rivals GitHub's CLI | |
35 | +- ✨ **Spinners & Boxes** - Beautiful feedback for every operation | |
35 | 36 | |
36 | 37 | ## 📦 Installation |
37 | 38 | |
| @@ -58,108 +59,148 @@ och auth login | ||
58 | 59 | # 2. Navigate to your repository |
59 | 60 | cd your-repo |
60 | 61 | |
61 | -# 3. Initialize (one-time setup) | |
62 | -och init --url https://git.yourcompany.com | |
62 | +# 3. Push code with beautiful progress indicators | |
63 | +och push -b master | |
63 | 64 | |
64 | -# 4. Create your first stack | |
65 | -och stack create my-feature | |
66 | - | |
67 | -# 5. Make changes, commit, and submit | |
68 | -git add . && git commit -m "Add feature" | |
69 | -och stack submit | |
65 | +# That's it! 🎉 | |
70 | 66 | ``` |
71 | 67 | |
72 | 68 | ## 📖 Commands |
73 | 69 | |
74 | 70 | ### Authentication |
75 | 71 | |
76 | -| Command | Description | | |
77 | -|---------|-------------| | |
78 | -| `och auth login` | Interactive login | | |
79 | -| `och auth login --token TOKEN` | Login with access token (for CI/CD) | | |
80 | -| `och auth whoami` | Show current user | | |
81 | -| `och auth logout` | Clear stored credentials | | |
82 | - | |
83 | -### Stack Management | |
84 | - | |
85 | -| Command | Description | | |
86 | -|---------|-------------| | |
87 | -| `och stack create <name>` | Create a new branch in current stack | | |
88 | -| `och stack view` / `och stack ls` | View all branches in current stack | | |
89 | -| `och stack submit` | Push and create/update PR | | |
90 | -| `och stack submit --draft` | Submit as draft PR | | |
91 | -| `och stack sync` | Rebase entire stack on latest main | | |
92 | -| `och stack reorder` | Interactively reorder branches | | |
93 | - | |
94 | -### Repository Operations | |
95 | - | |
96 | -| Command | Description | | |
97 | -|---------|-------------| | |
98 | -| `och init` | Initialize repo for OpenCodeHub | | |
99 | -| `och status` / `och st` | Show current stack status | | |
100 | -| `och sync` | Sync with remote | | |
101 | - | |
102 | -## 🔄 Workflow Examples | |
103 | - | |
104 | -### Creating a Feature Stack | |
105 | - | |
106 | 72 | ```bash |
107 | -# Start from main | |
108 | -git checkout main && git pull | |
109 | - | |
110 | -# Create base layer | |
111 | -och stack create database-schema | |
112 | -# ... make changes ... | |
113 | -git commit -m "Add user database models" | |
73 | +# Interactive login | |
74 | +och auth login | |
114 | 75 | |
115 | -# Create next layer (builds on database-schema) | |
116 | -och stack create auth-service | |
117 | -# ... make changes ... | |
118 | -git commit -m "Add authentication service" | |
76 | +# Login with token (for CI/CD) | |
77 | +och auth login --token YOUR_TOKEN | |
119 | 78 | |
120 | -# Submit entire stack | |
121 | -och stack submit | |
79 | +# Check current user | |
80 | +och auth whoami | |
122 | 81 | |
123 | -# Result: | |
124 | -# PR #1: Add user database models (main ← database-schema) | |
125 | -# PR #2: Add auth service (database-schema ← auth-service) | |
82 | +# Logout | |
83 | +och auth logout | |
126 | 84 | ``` |
127 | 85 | |
128 | -### Updating After Review | |
86 | +### Repository Operations | |
129 | 87 | |
130 | 88 | ```bash |
131 | -# Make requested changes | |
132 | -git add . && git commit -m "Address review feedback" | |
133 | - | |
134 | -# Resubmit (updates PR automatically) | |
135 | -och stack submit | |
136 | - | |
137 | -# If main changed, sync the whole stack | |
138 | -och stack sync | |
89 | +# Push current repository | |
90 | +och push # Push current branch | |
91 | +och push -b feature-branch # Push specific branch | |
92 | +och push --force # Force push | |
93 | + | |
94 | +# Clone a repository | |
95 | +och clone owner/repo # Clone to ./repo | |
96 | +och clone owner/repo mydir # Clone to ./mydir | |
97 | + | |
98 | +# Create new repository | |
99 | +och create myrepo # Create public repo | |
100 | +och create myrepo --private # Create private repo | |
101 | +och create myrepo --description "..." # With description | |
102 | + | |
103 | +# List repositories | |
104 | +och repo list | |
139 | 105 | ``` |
140 | 106 | |
141 | -## ⚙️ Configuration | |
107 | +## 🎨 Beautiful Output Examples | |
142 | 108 | |
143 | -OCH CLI stores configuration in `~/.ochrc`. | |
109 | +### Push Command | |
110 | +``` | |
111 | +ℹ Pushing to swadhinbiswas/myrepo | |
112 | + Branch: master | |
113 | + | |
114 | +✔ Objects prepared | |
115 | + Enumerating objects: 159, done. | |
116 | + Counting objects: 100% (159/159), done. | |
117 | + Delta compression using up to 20 threads | |
118 | + Compressing objects: 100% (76/76), done. | |
119 | + Writing objects: 100% (90/90), 49.17 KiB | 8.20 MiB/s, done. | |
120 | + Total 90 (delta 45), reused 0 (delta 0), pack-reused 0 | |
121 | + | |
122 | +✔ Uploaded 49.17 KB in 0.52s (94.56 KB/s) | |
123 | + | |
124 | +remote: Processing: 100% (90/90), done. | |
125 | +remote: | |
126 | +To https://opencodehub.com/swadhinbiswas/myrepo.git | |
127 | + abc1234..def5678 master -> master | |
128 | + | |
129 | +╭─────────────────────────────────────────╮ | |
130 | +│ │ | |
131 | +│ ✨ Push Successful! │ | |
132 | +│ │ | |
133 | +│ Repository: swadhinbiswas/myrepo │ | |
134 | +│ Branch: master │ | |
135 | +│ Size: 49.17 KB │ | |
136 | +│ │ | |
137 | +│ View at: https://opencodehub.com/... │ | |
138 | +│ │ | |
139 | +╰─────────────────────────────────────────╯ | |
140 | +``` | |
144 | 141 | |
145 | -```bash | |
146 | -# View config | |
147 | -och config list | |
142 | +### Clone Command | |
143 | +``` | |
144 | +ℹ Cloning swadhinbiswas/awesome-project | |
145 | + | |
146 | +✔ Repository found | |
147 | + | |
148 | +→ Cloning into awesome-project/... | |
149 | +Cloning into 'awesome-project'... | |
150 | +remote: Enumerating objects: 234, done. | |
151 | +remote: Total 234 (delta 0), reused 0 (delta 0) | |
152 | +Receiving objects: 100% (234/234), 1.23 MiB | 2.45 MiB/s, done. | |
153 | + | |
154 | +╭─────────────────────────────────────────╮ | |
155 | +│ │ | |
156 | +│ ✨ Clone Successful! │ | |
157 | +│ │ | |
158 | +│ Repository: swadhinbiswas/project │ | |
159 | +│ Location: awesome-project/ │ | |
160 | +│ │ | |
161 | +│ cd awesome-project && och push │ | |
162 | +│ │ | |
163 | +╰───────────────────────── ────────────────╯ | |
164 | +``` | |
148 | 165 | |
149 | -# Set config | |
150 | -och config set host https://git.yourcompany.com | |
151 | -och config set defaultBranch main | |
166 | +### Create Command | |
167 | +``` | |
168 | +ℹ Creating 🌐 my-new-repo | |
169 | + Description: An awesome new project | |
170 | + | |
171 | +✔ Repository created | |
172 | + | |
173 | + ✨ SUCCESS! ✨ | |
174 | + | |
175 | + Repository swadhinbiswas/my-new-repo is ready! | |
176 | + | |
177 | +╭─────────────────────────────────────────╮ | |
178 | +│ │ | |
179 | +│ 🎉 Repository Created! │ | |
180 | +│ │ | |
181 | +│ Repository: swadhinbiswas/my-new-repo │ | |
182 | +│ Visibility: 🌐 Public │ | |
183 | +│ Description: An awesome new project │ | |
184 | +│ │ | |
185 | +│ Clone URL: https://... │ | |
186 | +│ │ | |
187 | +│ ✓ Added remote 'opencode' │ | |
188 | +│ │ | |
189 | +│ View at: https://opencodehub.com/... │ | |
190 | +│ │ | |
191 | +╰─────────────────────────────────────────╯ | |
152 | 192 | ``` |
153 | 193 | |
154 | 194 | ## 🔧 CI/CD Usage |
155 | 195 | |
156 | 196 | ```yaml |
157 | -# .github/workflows/pr.yml | |
158 | -name: Submit PR | |
197 | +# .github/workflows/deploy.yml | |
198 | +name: Deploy | |
199 | + | |
159 | 200 | on: push |
160 | 201 | |
161 | 202 | jobs: |
162 | - submit: | |
203 | + deploy: | |
163 | 204 | runs-on: ubuntu-latest |
164 | 205 | steps: |
165 | 206 | - uses: actions/checkout@v4 |
| @@ -172,12 +213,46 @@ jobs: | ||
172 | 213 | - name: Install CLI |
173 | 214 | run: npm install -g opencodehub-cli |
174 | 215 | |
175 | - - name: Login & Submit | |
216 | + - name: Push to OpenCodeHub | |
176 | 217 | run: | |
177 | 218 | och auth login --token ${{ secrets.OCH_TOKEN }} |
178 | - och stack submit | |
219 | + och push -b main | |
220 | +``` | |
221 | + | |
222 | +## ⚙️ Configuration | |
223 | + | |
224 | +OCH CLI stores configuration in `~/.ochrc`. | |
225 | + | |
226 | +```bash | |
227 | +# View current configuration | |
228 | +och config list | |
229 | + | |
230 | +# Set server URL | |
231 | +och config set serverUrl https://git.yourcompany.com | |
232 | + | |
233 | +# Set default branch | |
234 | +och config set defaultBranch main | |
179 | 235 | ``` |
180 | 236 | |
237 | +## 🎨 UI Features | |
238 | + | |
239 | +- **ASCII Art Logos** - Gradient-colored branding | |
240 | +- **Progress Indicators** - GitHub-style object counting and compression | |
241 | +- **Upload Speeds** - Real-time speed indicators | |
242 | +- **Colored Output** - Green for success, red for errors, cyan for info | |
243 | +- **Spinners** - Smooth animations for long operations | |
244 | +- **Boxed Messages** - Beautiful bordered success/error boxes | |
245 | +- **Ref Updates** - Color-coded branch update notifications | |
246 | + | |
247 | +## 📦 What's New in v1.1.0 | |
248 | + | |
249 | +✨ **Production-Grade UI Overhaul** | |
250 | +- GitHub-like progress indicators | |
251 | +- Beautiful ASCII art and gradients | |
252 | +- Real-time upload/download speeds | |
253 | +- Professional boxed messages | |
254 | +- Color-coded output throughout | |
255 | + | |
181 | 256 | ## 🤝 Contributing |
182 | 257 | |
183 | 258 | We welcome contributions! Please see our [Contributing Guide](https://github.com/swadhinbiswas/OpencodeHub/blob/main/CONTRIBUTING.md). |
| @@ -190,7 +265,10 @@ cd OpenCodeHub/cli | ||
190 | 265 | # Install dependencies |
191 | 266 | npm install |
192 | 267 | |
193 | -# Run in development mode | |
268 | +# Build | |
269 | +npm run build | |
270 | + | |
271 | +# Run in development | |
194 | 272 | npm run dev |
195 | 273 | ``` |
196 | 274 | |
| @@ -203,6 +281,7 @@ MIT License - see [LICENSE](./LICENSE) for details. | ||
203 | 281 | - [OpenCodeHub](https://github.com/swadhinbiswas/OpencodeHub) - The main project |
204 | 282 | - [Documentation](https://github.com/swadhinbiswas/OpencodeHub#readme) |
205 | 283 | - [Report Issues](https://github.com/swadhinbiswas/OpencodeHub/issues) |
284 | +- [npm Package](https://www.npmjs.com/package/opencodehub-cli) | |
206 | 285 | |
207 | 286 | --- |
208 | 287 | |
209 | 288 | |
▼cli/bin/och.ts
+49-58
| @@ -7,6 +7,7 @@ | ||
7 | 7 | import { Command } from "commander"; |
8 | 8 | import chalk from "chalk"; |
9 | 9 | import { simpleGit } from "simple-git"; |
10 | +import gradient from "gradient-string"; | |
10 | 11 | |
11 | 12 | // Import all command modules |
12 | 13 | import { stackCommands } from "../src/commands/stack/index.js"; |
| @@ -33,9 +34,56 @@ import { insightsCommand } from "../src/commands/insights/index.js"; | ||
33 | 34 | const git = simpleGit(); |
34 | 35 | const program = new Command(); |
35 | 36 | |
37 | +// Custom help formatter with Dracula theme | |
38 | +program.configureHelp({ | |
39 | + sortSubcommands: true, | |
40 | + subcommandTerm: (cmd) => chalk.hex('#bd93f9')(cmd.name()), // Dracula purple | |
41 | +}); | |
42 | + | |
43 | +// Add custom help banner with Dracula colors | |
44 | +program.addHelpText('beforeAll', () => { | |
45 | + const banner = ` | |
46 | + ╔═══════════════════════════════════╗ | |
47 | + ║ OpenCodeHub CLI (OCH) ║ | |
48 | + ╚═══════════════════════════════════╝`; | |
49 | + | |
50 | + return chalk.hex('#ff79c6')(banner) + '\n' + // Dracula pink | |
51 | + chalk.hex('#6272a4')(' Stack-first ') + // Dracula comment gray | |
52 | + chalk.hex('#bd93f9').bold('PR workflows') + // Dracula purple | |
53 | + chalk.hex('#6272a4')(' from your terminal\n'); // Dracula comment gray | |
54 | +}); | |
55 | + | |
56 | +// Customize command help colors with Dracula theme | |
57 | +const originalHelp = program.helpInformation.bind(program); | |
58 | +program.helpInformation = function () { | |
59 | + const help = originalHelp(); | |
60 | + | |
61 | + return help | |
62 | + // Usage line - Dracula cyan | |
63 | + .replace(/^Usage: (.+)$/gm, (_, usage) => | |
64 | + chalk.hex('#8be9fd').bold('Usage: ') + chalk.hex('#f8f8f2')(usage) | |
65 | + ) | |
66 | + // Section headers - Dracula green | |
67 | + .replace(/^Options:$/gm, '\n' + chalk.hex('#50fa7b').bold('Options:')) | |
68 | + .replace(/^Commands:$/gm, '\n' + chalk.hex('#50fa7b').bold('Commands:')) | |
69 | + // Flags - Dracula purple | |
70 | + .replace(/(-[a-zA-Z-]+)/g, chalk.hex('#bd93f9')('$1')) | |
71 | + // Arguments - Dracula yellow | |
72 | + .replace(/<([^>]+)>/g, chalk.hex('#f1fa8c')('<$1>')) | |
73 | + // Optional params - Dracula comment | |
74 | + .replace(/\[([^\]]+)\]/g, chalk.hex('#6272a4')('[$1]')) | |
75 | + // Command names at start of lines - Dracula pink | |
76 | + .replace(/^(\s+)([a-z-]+)(\s)/gm, (match, space, cmd, after) => | |
77 | + space + chalk.hex('#ff79c6')(cmd) + after | |
78 | + ); | |
79 | +}; | |
80 | + | |
36 | 81 | program |
37 | 82 | .name("och") |
38 | - .description("OpenCodeHub CLI - Complete Git hosting with stack-first PR workflows") | |
83 | + .description( | |
84 | + chalk.hex('#f8f8f2')("Complete Git hosting with ") + // Dracula foreground | |
85 | + chalk.hex('#bd93f9').bold("stack-first PR workflows") // Dracula purple | |
86 | + ) | |
39 | 87 | .version("1.1.0"); |
40 | 88 | |
41 | 89 | // ================================ |
| @@ -147,63 +195,6 @@ program.addCommand(apiCommands); | ||
147 | 195 | // Shorthand Commands |
148 | 196 | // ================================ |
149 | 197 | |
150 | -// Stacking Commands (Graphite-inspired) | |
151 | -program | |
152 | - .command("stack") | |
153 | - .description("Manage stacked pull requests") | |
154 | - .command("submit") | |
155 | - .description("Submit the current branch as a stacked PR") | |
156 | - .option("-m, --message <message>", "PR Title/Description") | |
157 | - .action(async (options) => { | |
158 | - console.log("🚀 Submitting stack..."); | |
159 | - | |
160 | - // 1. Git Push | |
161 | - try { | |
162 | - const { execSync } = require('child_process'); | |
163 | - const branch = execSync('git iconv -futf-8 -tutf-8 branch --show-current').toString().trim(); | |
164 | - console.log(`Pushing branch ${branch}...`); | |
165 | - execSync(`git push origin ${branch}`); // Assumes 'origin' is set | |
166 | - } catch (e: any) { | |
167 | - console.error("Failed to push branch:", e.message); | |
168 | - return; | |
169 | - } | |
170 | - | |
171 | - // 2. Identify PR Context | |
172 | - // We need to know who we are (config) and where we are (remote) | |
173 | - // For MVP, just log instructions | |
174 | - console.log(`✅ Branch pushed. To create/update stack, visit OpenCodeHub or use 'och pr create' (coming soon).`); | |
175 | - }); | |
176 | - | |
177 | -program | |
178 | - .command("queue") | |
179 | - .description("Manage merge queue") | |
180 | - .command("join") | |
181 | - .description("Add the current PR to the merge queue") | |
182 | - .action(async () => { | |
183 | - console.log("⏳ Adding to merge queue..."); | |
184 | - | |
185 | - try { | |
186 | - const { execSync } = require('child_process'); | |
187 | - const branch = execSync('git branch --show-current').toString().trim(); | |
188 | - // Parse remote to get owner/repo | |
189 | - const remoteUrl = execSync('git remote get-url origin').toString().trim(); | |
190 | - // Regex to match http://host/owner/repo.git or git@... | |
191 | - // MVP: Assume standard format | |
192 | - // This requires robust parsing. | |
193 | - | |
194 | - console.log(`Detected branch: ${branch}`); | |
195 | - console.log(`Use 'cho queue join <pr-id>' implementation pending API client config.`); | |
196 | - | |
197 | - // Real implementation requires Authenticated API Client | |
198 | - // which involves reading ~/.och/config.json | |
199 | - // I will stub this with a TODO for the user to configure auth first. | |
200 | - | |
201 | - console.log(" | |