nooget
v2.0.0
Published
A Windows-safe degit alternative for private HTTPS Git repositories.
Downloads
189
Maintainers
Readme
nooget
nooget is a GitHub-first scaffolding CLI for cloning a repository into a local folder without keeping Git history in the final destination.
What This Package Does
nooget helps you bootstrap projects from template repositories.
- Clones a template repository into a temporary directory.
- Copies template files into your target folder without
.githistory. - If a
plopfileis present, runs Plop to scaffold files. - Forwards template arguments to Plop (preferably using
--).
Typical flow:
- Resolve template repository URL.
- Clone into a temporary folder.
- Copy files to destination and remove
.git. - Run Plop in destination when a
plopfileexists. - Clean up temporary files.
It is designed around a simple first version:
- GitHub over HTTPS only
- Works with
owner/reposhorthand or full GitHub HTTPS URLs - Uses
git cloneunder the hood - Copies files into the destination without preserving the
.gitdirectory - Uses Node file system APIs for cleanup, which keeps the flow Windows-safe
Requirements
- Node.js
- Git installed and available on
PATH
Install
For local development in this repo:
npm install
npm run build
npm run relinkThat links the nooget command globally on your machine for testing.
Usage
nooget <repo> [target-dir] [--ref <branch>] [--force] [-- <plop-args...>]Supported repo formats:
nooget owner/repo
nooget https://github.com/owner/repo.gitExamples:
nooget facebook/react
nooget facebook/react my-app
nooget facebook/react my-app --ref main
nooget https://github.com/facebook/react.git my-app
nooget my-org/template my-app -- --name api --service usersWhat It Does
When you run nooget, it:
- Resolves the GitHub repository input into an HTTPS Git URL.
- Clones the requested branch into a temporary directory.
- Copies the working tree into your destination folder.
- Excludes
.gitfrom the final copied output. - If a
plopfileexists in the cloned template, runs Plop in the destination. - Removes the temporary directory.
The destination folder should contain the repository files, but not the Git history.
Plop arguments can be forwarded in two ways:
- Preferred: pass arguments after
--; they are forwarded unchanged. - Fallback: when
--is not used, unknown trailing arguments are forwarded to Plop.
Options
--ref <branch>
Clones a specific branch.
nooget owner/repo my-app --ref developDefault: main
--force
Allows copying into an existing destination.
This currently means existing files may be overwritten during copy. It does not fully reset the destination folder first.
nooget owner/repo my-app --forceNotes
- This version is GitHub HTTPS first. Other hosts and auth flows can be added later.
- Private GitHub repositories still rely on your local Git authentication setup.
- If Git is already authenticated for GitHub on your machine,
noogetreuses that flow.
Development
Build the TypeScript source:
npm run buildRebuild and relink the CLI:
npm run relink