Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20, 22, 23, 24]
node: [22, 23, 24]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand Down
5 changes: 2 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
store-dir=./.pnpm-store
shamefully-hoist=false
prefer-symlinked-executables=false
registry=https://registry.npmjs.org/
@arkahna-npm:registry=https://registry.npmjs.org/
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# git-file-fetch

[![CI](https://github.com/arkahna/git-file-fetch/actions/workflows/ci.yml/badge.svg)](https://github.com/arkahna/git-file-fetch/actions/workflows/ci.yml)
[![npm version](https://img.shields.io/npm/v/@arkahna/git-file-fetch)](https://www.npmjs.com/package/@arkahna/git-file-fetch)
[![npm version](https://img.shields.io/npm/v/@arkahna-npm/git-file-fetch)](https://www.npmjs.com/package/@arkahna-npm/git-file-fetch)
[![license: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
[![node >= 20](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](#requirements)
[![node >= 22](https://img.shields.io/badge/node-%3E%3D22-brightgreen.svg)](#requirements)

A lightweight CLI to fetch individual files from remote Git repositories and track them locally for reproducibility.

## Quick Start

### 🚀 **Just want to use it?**
```bash
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
```

### 📦 **Want to install it?**
```bash
npm install -D @arkahna/git-file-fetch
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
npm install -D @arkahna-npm/git-file-fetch
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:path/to/file.ts"
```

### 🔧 **Want to test/develop it?**
Expand Down Expand Up @@ -58,7 +58,7 @@ node dist/index.js "https://github.com/octokit/core.js.git@main:LICENSE" --dry-r
## Requirements

- **Git** available on your PATH
- **Node.js** >= 20 (supports 20, 22, 23, 24)
- **Node.js** >= 22 (supports 22, 23, 24)

## License

Expand Down
Binary file removed arkahna-git-file-fetch-0.1.0.tgz
Binary file not shown.
8 changes: 4 additions & 4 deletions docs/ci-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm

- name: Verify external files
Expand All @@ -44,7 +44,7 @@ jobs:

```yaml
verify:
image: node:20-alpine
image: node:22-alpine
before_script:
- apk add --no-cache git
script:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Update external files
run: |
Expand All @@ -130,7 +130,7 @@ Test against different environments:
strategy:
matrix:
environment: [staging, production]
node-version: [20, 22, 23, 24]
node-version: [22, 23, 24]

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- run: |
npx @arkahna/git-file-fetch \
--config deps.json \
Expand All @@ -206,7 +206,7 @@ jobs:

```yaml
fetch-deps:
image: node:20
image: node:22
script:
- npx @arkahna/git-file-fetch --config deps.json --out third_party --json
artifacts:
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Thanks for taking the time to contribute! This project is a small, focused CLI (with a thin Nx executor) that fetches specific files from remote Git repositories and records provenance.

- **Binary**: `git-file-fetch`
- **Node**: >= 20 (supports 20, 22, 23, 24)
- **Node**: >= 22 (supports 22, 23, 24)
- **Packages**: TypeScript, ESLint, Prettier

## Getting started

- Fork and clone the repo
- Ensure you have Node 20/22/23/24 available and `pnpm` installed
- Ensure you have Node 22/23/24 available and `pnpm` installed
- Install deps:

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pnpm run test:smoke
## Requirements

- **Git** available on your PATH
- **Node.js** >= 20 (supports 20, 22, 23, 24)
- **Node.js** >= 22 (supports 22, 23, 24)

## Basic Usage

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- run: npx git-file-fetch "https://github.com/octokit/core.js.git@main:LICENSE" --dry-run --json
```

Expand Down
4 changes: 2 additions & 2 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We're currently in the final stages of preparation before our first npm release.
- [x] **CLI Help**: Clear flags, examples, and exit codes
- [x] **Manifest Policy**: Documented both commit and .gitignore patterns
- [x] **Security Basics**: Token redaction, path traversal prevention, input validation, file size limits
- [x] **CI/CD**: Matrix builds on Ubuntu, macOS, Windows across Node 20/22/23/24
- [x] **CI/CD**: Matrix builds on Ubuntu, macOS, Windows across Node 22/23/24
- [x] **Release Workflow**: Automated npm publish with provenance
- [x] **Smoke Tests**: Validated against public repos on all platforms
- [x] **Error Handling**: Documented non-zero exit codes with stable error identifiers
Expand Down Expand Up @@ -166,7 +166,7 @@ We're currently in the final stages of preparation before our first npm release.

- [ ] **Platform Testing**:
- [ ] OS: Linux, macOS, Windows
- [ ] Node: 20, 22, 23, 24
- [ ] Node: 22, 23, 24
- [ ] Providers: GitHub public, GitHub private (token), rate-limited scenario
- [ ] **Feature Testing**:
- [ ] Single file fetch
Expand Down
18 changes: 9 additions & 9 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## CLI Synopsis

```bash
@arkahna/git-file-fetch '<repo.git>@<ref>:<path>' [more...] [--dry-run] [--force] [--out <dir>] [--cwd <dir>] [--manifest <path>] [--max-bytes <n>] [--config <file>] [--timeout-ms <n>] [--retries <n>] [--retry-backoff-ms <n>] [--eject] [--json] [--quiet] [--verbose]
@arkahna-npm/git-file-fetch '<repo.git>@<ref>:<path>' [more...] [--dry-run] [--force] [--out <dir>] [--cwd <dir>] [--manifest <path>] [--max-bytes <n>] [--config <file>] [--timeout-ms <n>] [--retries <n>] [--retry-backoff-ms <n>] [--eject] [--json] [--quiet] [--verbose]
```

## Command Line Options
Expand Down Expand Up @@ -65,30 +65,30 @@ https://github.com/user/repo.git:src/config.json

```bash
# Fetch a single file
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:src/utils/logger.ts"
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:src/utils/logger.ts"

# Fetch with specific tag
npx @arkahna/git-file-fetch "https://github.com/user/[email protected]:LICENSE"
npx @arkahna-npm/git-file-fetch "https://github.com/user/[email protected]:LICENSE"

# Eject: copy the file without adding to manifest
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:src/utils/logger.ts" --eject
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:src/utils/logger.ts" --eject

# Dry run (simulate without writing files)
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:src/file.ts" --dry-run
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:src/file.ts" --dry-run

# Specify output directory
npx @arkahna/git-file-fetch "https://github.com/user/repo.git@main:tools/script.sh" --out third_party
npx @arkahna-npm/git-file-fetch "https://github.com/user/repo.git@main:tools/script.sh" --out third_party

# Config file with JSON output
npx @arkahna/git-file-fetch --config refs.json --out third_party --json --quiet
npx @arkahna-npm/git-file-fetch --config refs.json --out third_party --json --quiet
```

## Advanced Usage Examples

### Multiple Files in One Run

```bash
npx @arkahna/git-file-fetch \
npx @arkahna-npm/git-file-fetch \
"https://github.com/user/[email protected]:LICENSE" \
"https://github.com/user/another-repo.git@main:src/templates/readme.md"
```
Expand All @@ -107,7 +107,7 @@ Create a JSON file with multiple references:
Then use it:

```bash
npx @arkahna/git-file-fetch --config refs.json --out vendor --json
npx @arkahna-npm/git-file-fetch --config refs.json --out vendor --json
```

## Manifest
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@arkahna/git-file-fetch",
"name": "@arkahna-npm/git-file-fetch",
"version": "0.1.0",
"description": "Fetch specific files from remote git repos and track them locally.",
"main": "dist/index.js",
Expand Down Expand Up @@ -52,13 +52,13 @@
"typescript": "^5.9.2"
},
"engines": {
"node": ">=20.0.0 <25.0.0"
"node": ">=22.0.0 <25.0.0"
},
"files": [
"dist",
"plugin"
],
"packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67",
"packageManager": "pnpm@10.17.1+sha512.17c560fca4867ae9473a3899ad84a88334914f379be46d455cbf92e5cf4b39d34985d452d2583baf19967fa76cb5c17bc9e245529d0b98745721aa7200ecaf7a",
"publishConfig": {
"access": "public",
"provenance": true
Expand Down
Loading