ipgatekeeper
v0.1.5
Published
Guard CLI commands behind IP geolocation checks
Readme
ipgatekeeper
Guard CLI commands behind IP geolocation checks. Pre-checks your IP before running a command, and continuously monitors during execution — kills the child process if your IP leaves the allowed country.
Install
npm install -g ipgatekeeperUsage
ipgatekeeper --country JP -- claude
ipgatekeeper -c US -i 10 -- npm startOptions
| Flag | Description | Default |
|------|-------------|---------|
| --country, -c | Required. Allowed country code (e.g. JP, US) | — |
| --interval, -i | Check interval in seconds | 30 |
| --api | IP geolocation API URL | https://api.country.is/ |
Shell alias
For convenience:
alias claude='ipgatekeeper --country JP -- claude'How it works
- Pre-check: Queries your IP geolocation. If not in the allowed country, exits with code 1 — the wrapped command never starts.
- Runtime monitoring: While the child process runs, checks IP every
--intervalseconds. If IP changes to a disallowed country, sends SIGTERM to the child (SIGKILL after 3s fallback). - Signal forwarding: SIGINT/SIGTERM are forwarded to the child process.
License
MIT
