git0 0.3.13 → 0.3.14
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/package.json +1 -1
- package/README.md +0 -248
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git0",
|
|
3
3
|
"description": "CLI tool to search GitHub repositories, download source & releases for your system, and instantly set up, then install dependencies and open code editor.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.14",
|
|
5
5
|
"author": "vtempest",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "bun build src/cli.ts --outdir dist --target node --format esm --sourcemap",
|
package/README.md
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://i.imgur.com/td0AVb7.png" />
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<!-- template-git-repo:badges:start -->
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a href="https://git0.js.org"><img height="20px" src="https://img.shields.io/badge/App-blueviolet?style=for-the-badge&logo=googlechrome&logoColor=white" alt="Website" /></a>
|
|
8
|
-
<a href="https://starterdocs.vtempest.workers.dev/docs/packages/git0-repo-downloader"><img src="https://img.shields.io/badge/Docs-blue?logo=ReadTheDocs&logoColor=white" alt="Documentation" /></a>
|
|
9
|
-
<br />
|
|
10
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/stargazers"><img src="https://img.shields.io/github/stars/OpenSourceAGI/dev-tools-starter-agent" alt="GitHub Stars" /></a>
|
|
11
|
-
<a href="https://www.npmjs.com/package/git0"><img src="https://img.shields.io/npm/dm/git0.svg" alt="NPM Monthly Downloads" /></a>
|
|
12
|
-
<a href="https://www.npmjs.com/package/git0"><img src="https://img.shields.io/npm/v/git0.svg" alt="npm version" /></a>
|
|
13
|
-
<a href="https://www.npmjs.com/package/git0"><img src="https://img.shields.io/npm/dt/git0.svg" alt="NPM Total Downloads" /></a>
|
|
14
|
-
<a href="https://www.npmjs.com/package/git0"><img src="https://img.shields.io/npm/types/git0" alt="TypeScript types" /></a>
|
|
15
|
-
<a href="https://packagephobia.com/result?p=git0"><img src="https://packagephobia.com/badge?p=git0" alt="Install size" /></a>
|
|
16
|
-
<a href="https://app.codecov.io/gh/OpenSourceAGI/dev-tools-starter-agent/flags"><img src="https://img.shields.io/codecov/c/github/OpenSourceAGI/dev-tools-starter-agent?flag=git0-repo-downloader&label=git0-repo-downloader%20coverage&logo=codecov&logoColor=white" alt="Coverage" /></a>
|
|
17
|
-
<br />
|
|
18
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/issues"><img src="https://img.shields.io/github/issues/OpenSourceAGI/dev-tools-starter-agent?logo=github" alt="GitHub Issues" /></a>
|
|
19
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/pulls"><img src="https://img.shields.io/github/issues-pr/OpenSourceAGI/dev-tools-starter-agent?logo=github&label=PRs" alt="Open Pull Requests" /></a>
|
|
20
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/OpenSourceAGI/dev-tools-starter-agent?logo=github&label=PRs%20merged&color=8957e5" alt="Merged Pull Requests" /></a>
|
|
21
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/discussions"><img src="https://img.shields.io/github/discussions/OpenSourceAGI/dev-tools-starter-agent" alt="GitHub Discussions" /></a>
|
|
22
|
-
<a href="https://github.com/OpenSourceAGI/dev-tools-starter-agent/commits/master/"><img src="https://img.shields.io/github/last-commit/OpenSourceAGI/dev-tools-starter-agent.svg" alt="GitHub last commit" /></a>
|
|
23
|
-
<br />
|
|
24
|
-
<a href="https://stackblitz.com/github/OpenSourceAGI/dev-tools-starter-agent/tree/master/packages/git0-repo-downloader"><img height="20px" src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt="Open in StackBlitz" /></a>
|
|
25
|
-
<img src="https://img.shields.io/badge/Bun-14151A?logo=bun&logoColor=white" alt="Bun" /> <img src="https://img.shields.io/badge/Vitest-6E9F18?logo=vitest&logoColor=white" alt="Vitest" />
|
|
26
|
-
</p>
|
|
27
|
-
<!-- template-git-repo:badges:end -->
|
|
28
|
-
|
|
29
|
-
<!-- skills:install:start -->
|
|
30
|
-
**🤖 Agent skill** — `npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent --skill git0` ([what it covers](../../skills/git0/SKILL.md))
|
|
31
|
-
<!-- skills:install:end -->
|
|
32
|
-
|
|
33
|
-
# Step 0: Download Git Repo
|
|
34
|
-
|
|
35
|
-
CLI tool to search GitHub repositories, download source & releases for your system, and instantly set up, then install dependencies and open code editor.
|
|
36
|
-
|
|
37
|
-
**🌐 [git0.js.org](https://git0.js.org)**
|
|
38
|
-
|
|
39
|
-
## 🚀 Installation
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npm install -g git0
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
bun install -g git0
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-

|
|
50
|
-

|
|
51
|
-
|
|
52
|
-
## ✨ Features
|
|
53
|
-
|
|
54
|
-
- **Search GitHub repositories** by name with fuzzy matching
|
|
55
|
-
- **Download repositories** directly from GitHub URLs or owner/repo shortcuts. Skip the manual git clone, cd, install dance
|
|
56
|
-
- **Get Releases** instantly download latest release for your system or all systems
|
|
57
|
-
- **Automatic dependency installation** and installation for multiple project types
|
|
58
|
-
- **Smart IDE integration** - automatically opens projects in your preferred editor
|
|
59
|
-
- **Cross-platform support** - works on Windows, macOS, and Linux
|
|
60
|
-
- **Conflict resolution** - handles directory naming conflicts automatically
|
|
61
|
-
- **Partial paths** - paste a `/tree/` or `/blob/` link and download just that folder or file
|
|
62
|
-
- **Optional `.git` history** - `--history` attaches the full history *after* the source is already on disk
|
|
63
|
-
- **Faster than git** - skips `.git` history and uncompresses while downloading
|
|
64
|
-
|
|
65
|
-
## 🎯 Usage
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
|
|
69
|
-
# Direct download from GitHub URL
|
|
70
|
-
## g and git0 both work
|
|
71
|
-
g https://github.com/facebook/react
|
|
72
|
-
|
|
73
|
-
# Search for repositories by name
|
|
74
|
-
g react starter
|
|
75
|
-
|
|
76
|
-
# Download using owner/repo shorthand
|
|
77
|
-
git0 facebook/react
|
|
78
|
-
|
|
79
|
-
# Use git0 without installing, (only node needed)
|
|
80
|
-
# (copy this line into your project's readme to help others setup)
|
|
81
|
-
npx git0 facebook/react
|
|
82
|
-
|
|
83
|
-
# Download only one folder — paste the GitHub link as you copied it
|
|
84
|
-
g https://github.com/facebook/react/tree/main/packages/react-dom
|
|
85
|
-
|
|
86
|
-
# ...or one file
|
|
87
|
-
g https://github.com/debate/debate-ai.com/blob/master/.continue/agents/new-config.yaml
|
|
88
|
-
|
|
89
|
-
# Same thing, without a URL
|
|
90
|
-
git0 facebook/react/packages/react-dom
|
|
91
|
-
git0 facebook/react --path=packages/react-dom
|
|
92
|
-
|
|
93
|
-
# A specific branch, tag or commit
|
|
94
|
-
git0 facebook/react --branch=v18.2.0
|
|
95
|
-
|
|
96
|
-
# With the full .git history attached after the download
|
|
97
|
-
git0 facebook/react --history
|
|
98
|
-
|
|
99
|
-
# History only — no working files at all
|
|
100
|
-
git0 facebook/react --history-only
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Options
|
|
104
|
-
|
|
105
|
-
| Flag | What it does |
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| `--path=<path>` | Download only that folder or file of the repository |
|
|
108
|
-
| `--branch=<ref>` | Download a branch, tag or commit instead of the default branch |
|
|
109
|
-
| `--history` | Also fetch the full `.git` history, in the background |
|
|
110
|
-
| `--history-only` | Clone only the history — no working files |
|
|
111
|
-
| `--mirror` | Keep every ref (notes, remote-tracking) when cloning history |
|
|
112
|
-
|
|
113
|
-
## 📁 Partial Paths
|
|
114
|
-
|
|
115
|
-
Copy a link out of the GitHub UI and git0 downloads exactly what the link points
|
|
116
|
-
at, not the repository around it:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
g https://github.com/facebook/react/tree/main/packages/react-dom
|
|
120
|
-
# → ./react-dom/ — the contents of that folder, at the root
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
The branch and the path are both read off the URL. Entries outside the path are
|
|
124
|
-
discarded as the tarball streams, so they are never written to disk, and what is
|
|
125
|
-
kept is lifted to the root of the target folder — you get `react-dom/`, not
|
|
126
|
-
`react/packages/react-dom/`.
|
|
127
|
-
|
|
128
|
-
The folder is named after the path rather than the repository, because that is
|
|
129
|
-
what you asked for. A `/blob/` link to a single file downloads that one file into
|
|
130
|
-
its enclosing folder's name. Pass a second argument, or `--path` with any repo
|
|
131
|
-
reference, if you'd rather name it yourself:
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
git0 facebook/react --path=packages/react-dom my-copy
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## 🕐 Downloading With `.git` History
|
|
138
|
-
|
|
139
|
-
By default git0 downloads a tarball — the source at one commit, no history. That
|
|
140
|
-
is what makes it quick. When you *do* want the history, `--history` gets you both
|
|
141
|
-
without giving up the speed:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
git0 facebook/react --history
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
The source tarball lands first. The history is fetched **after** the archive has
|
|
148
|
-
finished unzipping, in the background, while the IDE opens and dependencies
|
|
149
|
-
install. You end up in exactly the state `git clone` would have left you in — a
|
|
150
|
-
working tree with a full `.git` beside it, `git log` and `git blame` working,
|
|
151
|
-
`git status` clean — except you started working several seconds earlier.
|
|
152
|
-
|
|
153
|
-
**Why the lazy order is faster.** `git clone` is one serial operation: the remote
|
|
154
|
-
counts and packs every object in the project's history, sends the pack, and only
|
|
155
|
-
then writes files you can run. Nothing can start until all of it finishes. A
|
|
156
|
-
GitHub tarball is a pre-made, cached, already-compressed snapshot of one commit,
|
|
157
|
-
so git0 pipes it straight into a `tar` extractor — files are being written while
|
|
158
|
-
the rest is still downloading. And history is the one part of a clone that
|
|
159
|
-
nothing on the critical path is waiting for: `bun install` does not need `git
|
|
160
|
-
log`. So it is fetched last, overlapping the install rather than blocking it.
|
|
161
|
-
|
|
162
|
-
There is a benchmark for this in [`benchmark/`](./benchmark) — it measures
|
|
163
|
-
*time until the project can run*, separately from *time until history is
|
|
164
|
-
available*, for `git clone`, `git clone --depth=1`, git0, and `git0 --history`:
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
bun run bench facebook/react
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### History Only
|
|
171
|
-
|
|
172
|
-
To take the history and none of the working files — for a backup, a mirror, or
|
|
173
|
-
to move a repository between hosts:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
git0 facebook/react --history-only
|
|
177
|
-
# → ./react.git/ — HEAD, config, objects/, refs/, packed-refs
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
That directory holds what normally lives inside `.git`, placed at its root: all
|
|
181
|
-
the commits, branches and tags, no editable files. Read it without checking
|
|
182
|
-
anything out, or restore a normal working copy from it:
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
git --git-dir=react.git log --all --oneline
|
|
186
|
-
git clone react.git react
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
`--history-only` uses a bare clone (branches and tags). Add `--mirror` for every
|
|
190
|
-
ref Git can fetch — notes, remote-tracking refs and the rest — which is what you
|
|
191
|
-
want when the point is a complete backup:
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
git0 facebook/react --history-only --mirror
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Supported Project Types
|
|
198
|
-
|
|
199
|
-
git0 automatically detects and sets up the following project types:
|
|
200
|
-
|
|
201
|
-
| Project Type | Detection | Installation |
|
|
202
|
-
| ----------------- | -------------------------------------- | --------------------------------------------- |
|
|
203
|
-
| **Node.js** | `package.json` | `bun install` (fallback to `npm install`) |
|
|
204
|
-
| **Docker** | `Dockerfile`, `docker-compose.yml` | `docker-compose up -d` or `docker build` |
|
|
205
|
-
| **Python** | `requirements.txt`, `setup.py` | Virtual environment + pip install |
|
|
206
|
-
| **Rust** | `Cargo.toml` | `cargo build` |
|
|
207
|
-
| **Go** | `go.mod` | `go mod tidy` |
|
|
208
|
-
|
|
209
|
-
### Supported IDEs
|
|
210
|
-
|
|
211
|
-
git0 automatically detects and opens projects in your preferred IDE:
|
|
212
|
-
|
|
213
|
-
- **Antigravity**
|
|
214
|
-
- **Cursor**
|
|
215
|
-
- **Windsurf**
|
|
216
|
-
- **VS Code**
|
|
217
|
-
- **VSCode Server WebUI**
|
|
218
|
-
- **Neovim**
|
|
219
|
-
- **Webstorm**
|
|
220
|
-
|
|
221
|
-
## 🔧 Configuration
|
|
222
|
-
|
|
223
|
-
### What Happens After Download
|
|
224
|
-
|
|
225
|
-
1. **Repository is downloaded** to your current directory — only the requested path, if you named one
|
|
226
|
-
2. **Project type is detected** automatically
|
|
227
|
-
3. **Dependencies are installed** based on project type
|
|
228
|
-
4. **IDE is launched** automatically (if available)
|
|
229
|
-
5. **Development server starts** (for Node.js projects)
|
|
230
|
-
6. **`.git` history is attached** in the background, if you passed `--history`
|
|
231
|
-
|
|
232
|
-
If a directory with the same name exists, git0 automatically appends a number (e.g., `react-2`, `react-3`).
|
|
233
|
-
|
|
234
|
-
### GitHub Token (Optional)
|
|
235
|
-
|
|
236
|
-
For higher API rate limits, set [your GitHub token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token):
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
export GITHUB_TOKEN=your_github_token_here
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Without a token, you're limited to 60 requests per hour. With a token, you get 5,000 requests per hour.
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
[](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
|
|
247
|
-
|
|
248
|
-
Please star this repo for updates! 🌟
|