{"id":28092686,"url":"https://github.com/stacksjs/gitit","last_synced_at":"2025-05-13T13:35:19.420Z","repository":{"id":289166497,"uuid":"970334665","full_name":"stacksjs/gitit","owner":"stacksjs","description":"A simple way to download templates stored using git.","archived":false,"fork":false,"pushed_at":"2025-05-06T04:08:19.000Z","size":351,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-06T05:21:16.499Z","etag":null,"topics":["download","git","starter-kit","templates"],"latest_commit_sha":null,"homepage":"https://stacks-gitit.netlify.app","language":"TypeScript","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2025-04-21T21:19:02.000Z","updated_at":"2025-04-22T22:43:50.000Z","dependencies_parsed_at":"2025-05-06T05:30:05.458Z","dependency_job_id":null,"html_url":"https://github.com/stacksjs/gitit","commit_stats":null,"previous_names":["stacksjs/gitit"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fgitit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fgitit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fgitit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fgitit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/gitit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253680865,"owners_count":21946663,"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":["download","git","starter-kit","templates"],"created_at":"2025-05-13T13:35:18.814Z","updated_at":"2025-05-13T13:35:19.403Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.jpg\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# gitit\n\nA powerful template and project scaffolding tool to help kick-start development of your next project.\n\n## Features\n\nGitit comes with the following features:\n\n- 🚀 **Fast Template Cloning** _Clone templates from GitHub, GitLab, Bitbucket, and more_\n- 💪 **Fully Typed APIs** _Written in TypeScript for a great developer experience_\n- 📦 **Zero Configuration** _Works out of the box with sensible defaults_\n- 🔄 **Offline Support** _Use cached templates when offline_\n- 🛠️ **Customizable** _Configure templates with various options_\n- 🧩 **Post-Installation Commands** _Run custom commands after cloning_\n- 🔑 **Private Repository Support** _Authentication for private templates_\n- 🖥️ **Interactive Shell** _Open a shell in your newly created project_\n\n## Get Started\n\n```bash\n# Install globally\nbun install -g @stacksjs/gitit\n\n# or use directly with bunx\nbunx @stacksjs/gitit github:user/repo my-project\n```\n\n## Usage\n\n```bash\n# Basic usage\ngitit github:user/repo my-project\n\n# With options\ngitit github:user/repo my-project --install --shell\n\n# Clone with custom command\ngitit github:user/repo my-project --command \"npm run dev\"\n\n# Use offline cached template\ngitit github:user/repo my-project --offline\n\n# Clone to a specific directory\ngitit github:user/repo ./path/to/project\n```\n\n## Available Options\n\n| Option | Description |\n|--------|-------------|\n| `--force` | Clone to existing directory even if it exists |\n| `--force-clean` | Remove any existing directory or file recursively before cloning |\n| `--shell` | Open a new shell with current working directory |\n| `--install` | Install dependencies after cloning |\n| `--verbose` | Show verbose debugging info |\n| `--command` | Custom command to run after template is cloned |\n| `--auth` | Custom Authorization token for private repositories |\n| `--cwd` | Set current working directory to resolve dirs relative to it |\n| `--offline` | Do not attempt to download and use cached version |\n| `--prefer-offline` | Use cache if exists otherwise try to download |\n\n## Library Usage\n\nGitit can also be used programmatically in your Node.js or Bun applications:\n\n```js\nimport { downloadTemplate } from '@stacksjs/gitit'\n\n// Basic usage\nawait downloadTemplate('github:user/repo')\n\n// With options\nconst result = await downloadTemplate('github:user/repo', {\n  dir: './my-project',\n  force: true,\n  install: true,\n  offline: false,\n  preferOffline: true\n})\n\nconsole.log(`Downloaded to ${result.dir}`)\n```\n\n### API Reference\n\n#### `downloadTemplate(source, options)`\n\nThe main function for downloading templates.\n\n- **source**: `string` - Template source (e.g., \"github:user/repo\")\n- **options**: `DownloadTemplateOptions` - Configuration options\n\n```ts\ninterface DownloadTemplateOptions {\n  provider?: string // Specify provider (github, gitlab, etc.)\n  force?: boolean // Force clone even if directory exists\n  forceClean?: boolean // Remove existing directory before cloning\n  offline?: boolean // Use cached version only\n  preferOffline?: boolean // Prefer cache if exists\n  dir?: string // Target directory\n  registry?: false | string // Registry URL or false to disable\n  cwd?: string // Current working directory\n  auth?: string // Auth token for private repositories\n  install?: boolean // Install dependencies after download\n  silent?: boolean // Hide installation output\n  hooks?: Hooks // Custom lifecycle hooks\n}\n```\n\n#### Return value\n\n```ts\ninterface DownloadTemplateResult {\n  dir: string // The directory where template was extracted\n  source: string // Original source string\n  name: string // Template name\n  tar: string // Tarball URL\n  version?: string // Template version\n  url?: string // Repository URL\n  // ... additional properties\n}\n```\n\n#### Advanced: Custom Plugins\n\nYou can extend gitit's functionality using plugins:\n\n```js\nimport { downloadTemplate } from '@stacksjs/gitit'\n\nconst myPlugin = {\n  name: 'my-plugin',\n  version: '1.0.0',\n  hooks: {\n    afterExtract: (result) =\u003e {\n      console.log(`Template extracted to ${result.dir}`)\n      return result\n    }\n  },\n  providers: {\n    myCustomSource: (input, options) =\u003e {\n      // Custom template provider logic\n      return {\n        name: 'my-template',\n        tar: 'https://example.com/template.tar.gz'\n      }\n    }\n  }\n}\n\nawait downloadTemplate('mycustom:template', {\n  plugins: [myPlugin]\n})\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stackjs/gitit/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/gitit/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n\"Software that is free, but hopes for a postcard.\" We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@stacksjs/gitit?style=flat-square\n[npm-version-href]: https://npmjs.com/package/@stacksjs/gitit\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/gitit/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/gitit/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/gitit/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/gitit --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fgitit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fgitit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fgitit/lists"}