await-github-file-change-cli
A CLI tool that monitors a GitHub file for changes by polling its etag value. The tool will continuously check the file every second until it detects a change, then exit.
Usage
You can run this tool directly using npx without installing it:
npx await-github-file-change-cli https://github.com/owner/repo/blob/branch/path/to/file
Example
npx await-github-file-change-cli https://github.com/gr2m/sandbox/blob/main/test-file
Authentication
For higher rate limits and access to private repositories, set the GITHUB_TOKEN environment variable:
GITHUB_TOKEN=your_token_here npx await-github-file-change-cli https://github.com/owner/repo/blob/branch/path/to/file
How it works
- Parses the GitHub URL to extract owner, repository, and file path
- Fetches the initial etag value using a HEAD request
- Polls the file every second with HEAD requests
- When the etag changes, logs the new etag and exits
Installation
If you want to install it globally:
npm install -g await-github-file-change-cli
Then use it directly:
await-github-file-change https://github.com/owner/repo/blob/branch/path/to/file
Development
Install dependencies
npm install
Run tests
npm test
License
ISC