{"id":18735644,"url":"https://github.com/rdmurphy/create-clone","last_synced_at":"2025-04-12T19:20:36.680Z","repository":{"id":38705372,"uuid":"204796316","full_name":"rdmurphy/create-clone","owner":"rdmurphy","description":"👭 A a template repository scaffolding tool that creates copies of git repositories with support for private GitHub repos.","archived":false,"fork":false,"pushed_at":"2023-03-06T13:57:27.000Z","size":467,"stargazers_count":10,"open_issues_count":16,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T06:35:42.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdmurphy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-27T21:49:56.000Z","updated_at":"2024-11-21T14:18:32.000Z","dependencies_parsed_at":"2024-10-30T05:52:42.283Z","dependency_job_id":null,"html_url":"https://github.com/rdmurphy/create-clone","commit_stats":{"total_commits":225,"total_committers":3,"mean_commits":75.0,"dds":0.2711111111111111,"last_synced_commit":"79b84b6e50faa63076cac5a59395eff82a742a00"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fcreate-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fcreate-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fcreate-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdmurphy%2Fcreate-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdmurphy","download_url":"https://codeload.github.com/rdmurphy/create-clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618591,"owners_count":21134264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T15:17:37.758Z","updated_at":"2025-04-12T19:20:36.649Z","avatar_url":"https://github.com/rdmurphy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  create-clone\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.org/package/create-clone\"\u003e\u003cimg src=\"https://badgen.net/npm/v/create-clone\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://unpkg.com/create-clone/dist/index.js\"\u003e\u003cimg src=\"https://badgen.net/badgesize/gzip/https://unpkg.com/create-clone/dist/index.js\" alt=\"gzip size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://unpkg.com/create-clone/dist/index.js\"\u003e\u003cimg src=\"https://badgen.net/badgesize/brotli/https://unpkg.com/create-clone/dist/index.js\" alt=\"brotli size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagephobia.now.sh/result?p=create-clone\"\u003e\u003cimg src=\"https://badgen.net/packagephobia/install/create-clone\" alt=\"install size\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`create-clone` is a template repository scaffolding tool that creates copies of git repositories **with support for private repos**. It taps into the compressed tarball of a repository to quickly pull down a copy without all that extra git cruft.\n\n## Key features\n\n- 🎏 Supports GitHub repos, GitHub gists, GitLab and Bitbucket\n- 💡 Understands GitHub shorthand (`rdmurphy/my-cool-template`) for referring to repositories\n- 🔐 With proper credentials in place **can clone private repositories on GitHub, GitLab and Bitbucket**\n\n## Table of contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Setup](#setup)\n- [Usage](#usage)\n  - [GitHub](#github)\n  - [GitLab](#gitlab)\n  - [Bitbucket](#bitbucket)\n  - [Gist](#gist)\n- [Private repos](#private-repos)\n  - [GitHub](#github-1)\n  - [GitLab](#gitlab-1)\n  - [Bitbucket](#bitbucket-1)\n- [What makes this different from `degit`?](#what-makes-this-different-from-degit)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Setup\n\n`create-clone` requires at least Node 10 to run.\n\nThis library expects to be used in a global context and makes the most sense when installed globally.\n\n```sh\nnpm install --global create-clone\n# or\nyarn global add create-clone\n```\n\nThis also means it works great when paired with `npx`.\n\n```sh\nnpx create-clone \u003crepository\u003e \u003cdest\u003e\n```\n\n**However!** `create-clone`'s unique name gives it another super power \u0026mdash; you can use a special feature of `npm init` and `yarn create`.\n\n```sh\nnpm init clone \u003crepository\u003e \u003cdest\u003e\n# or\nyarn create clone \u003crepository\u003e \u003cdest\u003e\n```\n\nThis is most of the reason this library exists. 😶\n\n## Usage\n\n`create-clone` works any git host URLs that [`hosted-git-info`](https://github.com/npm/hosted-git-info) supports. By default the copy of the repository is output into your **current working directory**. A path to a different directory can be provided as the second parameter and will be created if necessary.\n\n```sh\n# The contents of the repository will be copied into the current directory\ncreate-clone user/repository\n\n# The contents of the repository will be copied into provided directory (and created if necessary)\ncreate-clone user/repository my-new-project\n```\n\nBy default `create-clone` will stop and not touch a target directory that already contains files, but this can be overriden with `--force`.\n\n```sh\n# I already have something in the \"my-old-project\" directory, but I don't care\ncreate-clone user/repository my-old-project --force\n```\n\n### GitHub\n\n```sh\n# shortcuts only available to GitHub\ncreate-clone user/repository\ncreate-clone user/repository#branch\n\ncreate-clone github:user/repository\ncreate-clone github:user/repository.git\ncreate-clone github:user/repository#branch\ncreate-clone github:user/repository.git#branch\n\n# github.com and www.github.com are both supported\ncreate-clone https://github.com/user/repository\ncreate-clone https://github.com/user/repository.git\ncreate-clone https://github.com/user/repository#branch\ncreate-clone https://github.com/user/repository.git#branch\ncreate-clone git@github.com:user/repository\ncreate-clone git@github.com:user/repository.git\ncreate-clone git@github.com:user/repository#branch\ncreate-clone git@github.com:user/repository.git#branch\n```\n\n### GitLab\n\n```sh\ncreate-clone gitlab:user/repository\ncreate-clone gitlab:user/repository.git\ncreate-clone gitlab:user/repository#branch\ncreate-clone gitlab:user/repository.git#branch\n\n# gitlab.com and www.gitlab.com are both supported\ncreate-clone https://gitlab.com/user/repository\ncreate-clone https://gitlab.com/user/repository.git\ncreate-clone https://gitlab.com/user/repository#branch\ncreate-clone https://gitlab.com/user/repository.git#branch\ncreate-clone git@gitlab.com:user/repository\ncreate-clone git@gitlab.com:user/repository.git\ncreate-clone git@gitlab.com:user/repository#branch\ncreate-clone git@gitlab.com:user/repository.git#branch\n```\n\n### Bitbucket\n\n```sh\ncreate-clone bitbucket:user/repository\ncreate-clone bitbucket:user/repository.git\ncreate-clone bitbucket:user/repository#branch\ncreate-clone bitbucket:user/repository.git#branch\n\n# bitbucket.org and www.bitbucket.org are both supported\ncreate-clone https://bitbucket.org/user/repository\ncreate-clone https://bitbucket.org/user/repository.git\ncreate-clone https://bitbucket.org/user/repository#branch\ncreate-clone https://bitbucket.org/user/repository.git#branch\ncreate-clone git@bitbucket.org:user/repository\ncreate-clone git@bitbucket.org:user/repository.git\ncreate-clone git@bitbucket.org:user/repository#branch\ncreate-clone git@bitbucket.org:user/repository.git#branch\n```\n\n### Gist\n\n```sh\ncreate-clone gist:user/hash\ncreate-clone gist:user/hash.git\ncreate-clone gist:user/hash#branch\ncreate-clone gist:user/hash.git#branch\n\ncreate-clone git@gist.github.com:hash.git\ncreate-clone git+https://gist.github.com:hash.git\ncreate-clone git+https://gist.github.com:hash.git\ncreate-clone https://gist.github.com/user/hash\ncreate-clone https://gist.github.com/user/hash.git\ncreate-clone https://gist.github.com/user/hash#branch\ncreate-clone https://gist.github.com/user/hash.git#branch\ncreate-clone git@gist.github.com:user/hash\ncreate-clone git@gist.github.com:user/hash.git\ncreate-clone git@gist.github.com:user/hash#branch\ncreate-clone git@gist.github.com:user/hash.git#branch\n```\n\n## Private repos\n\nGitHub, GitLab and Bitbucket all have varying methods for authenticating against their services, so each one needs slightly different permissions and keys.\n\n\u003e Fun fact \u0026mdash; Private GitHub gists are already supported without any additional authentication because they're only \"private\" as long as no one else has the URL. [This is a documented feature](https://help.github.com/en/articles/creating-gists#about-gists)!\n\n### GitHub\n\n`create-clone` requires a [GitHub personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) with read access for repositories and/or gists. Once you have this token, it needs to be available in your environment at `GITHUB_TOKEN`.\n\nIn your `.bashrc`/`.zshrc`/preferred shell config:\n\n```sh\nexport GITHUB_TOKEN=\u003cpersonal-access-token\u003e\n```\n\n`create-clone` will check for this environment variable when attempting to clone a GitHub repository or gist and [include it as an authorization header](https://developer.github.com/v3/#authentication) in the request. `create-clone` will be able to clone any private GitHub repo your account can access.\n\n### GitLab\n\nGitLab also has [personal access tokens](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html), but because access to the archive of a private repository is only available [via the GitLab API](https://docs.gitlab.com/ee/api/repositories.html#get-file-archive), your token needs to be [given the scope of `api` access](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#limiting-scopes-of-a-personal-access-token), _not_ `read_repository`. Once you have this token, it needs to be available in your environment at `GITLAB_TOKEN`.\n\nIn your `.bashrc`/`.zshrc`/preferred shell config:\n\n```sh\nexport GITLAB_TOKEN=\u003cpersonal-access-token\u003e\n```\n\n`create-clone` will check for this environment variable when attempting to clone a GitLab repository and [include it as an authorization header](https://docs.gitlab.com/ee/api/README.html#personal-access-tokens) in the request. `create-clone` will be able to clone any private GitLab repo your account can access.\n\n### Bitbucket\n\nThis is the funky one. Bitbucket does not have the equivalent of a personal access token, so we need to use what it calls an [app password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html). The _only_ permission your app password needs is `Repositories -\u003e Read`. However, because we are using what's essentially a single-purpose password, we also need to include your Bitbucket username as part of the request. To accomplish this, we need to set up **two** environmental variables: `BITBUCKET_USER` for your username, and `BITBUCKET_TOKEN` for your app password.\n\nIn your `.bashrc`/`.zshrc`/preferred shell config:\n\n```sh\nexport BITBUCKET_USER=\u003cyour-bitbucket-username\u003e\nexport BITBUCKET_TOKEN=\u003capp-password\u003e\n```\n\n`create-clone` will check for this environment variable when attempting to clone a Bitbucket repository and include it as the [user and password](https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication#app-pw) of the request. `create-clone` will be able to clone any private Bitbucket repo your account can access.\n\n## What makes this different from [`degit`](https://github.com/Rich-Harris/degit)?\n\nHonestly? Not a whole lot. This was mostly me wanting to be able to do something cool like `npm init clone \u003crepo\u003e`/`yarn create clone \u003crepo\u003e`.\n\nThe most notable difference is `create-clone` **does not** have a caching layer like `degit` does. In practice I've not found that to be a major issue, but it may be a big deal for some folks! `degit` also has a [cool actions framework layered on top](https://github.com/Rich-Harris/degit#actions).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdmurphy%2Fcreate-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdmurphy%2Fcreate-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdmurphy%2Fcreate-clone/lists"}