A lightweight CLI to fetch individual files from remote Git repositories and track them locally for reproducibility.
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
npm install -D @arkahna/git-file-fetch
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
git clone https://github.com/arkahna/git-file-fetch.git
cd git-file-fetch
pnpm install
pnpm build
node dist/index.js "https://github.com/octokit/core.js.git@main:LICENSE" --dry-run
Available development commands:
pnpm build
- Build the projectpnpm typecheck
- Run TypeScript type checkingpnpm lint:check
- Run ESLint checkspnpm lint
- Run ESLint with auto-fixpnpm test:smoke
- Run smoke test
- Shallow Fetch: Performs a shallow fetch of the target ref without a full clone
- File Extraction: Reads the file at that specific commit using
git show
- Local Copy: Copies the requested file(s) into your current working directory
- Manifest Update: Writes an entry for each fetched file to a manifest for tracking provenance
- 🚀 Getting Started - Complete setup guide
- 📖 Usage Guide - CLI options and examples
- ⚙️ Configuration - Advanced setup
- 🔧 Troubleshooting - Common issues
- 🚀 CI Integration - CI/CD workflows and automation
- 🛣️ Roadmap - Development plans
- 🤝 Contributing - How to contribute
- 🔒 Security - Security policies
- 📋 Code of Conduct - Community guidelines
- Git available on your PATH
- Node.js >= 20 (supports 20, 22, 23, 24)
MIT © Arkahna