Skip to main content

Run with npx

SAFEFETCH_API_KEY=sf_live_... npx @safefetch/cli --help

Install globally

npm install -g @safefetch/cli
safefetch --help

Monorepo local development

If you are working in this repository:
git clone https://github.com/jayhickey/SafeFetch.git
cd SafeFetch/packages/cli
npm install
npm run build
node dist/index.js --help

Environment setup

The CLI reads these values:
  • SAFEFETCH_API_KEY (required)
  • SAFEFETCH_API_URL (optional, defaults to https://api.safefetch.dev)
export SAFEFETCH_API_KEY=sf_live_...
export SAFEFETCH_API_URL=https://api.safefetch.dev

.safefetch config file

You can store config in a .safefetch file in your home directory or current project directory.
SAFEFETCH_API_KEY=sf_live_...
SAFEFETCH_API_URL=https://api.safefetch.dev

Override with flags

CLI flags override environment/config values:
safefetch --api-key sf_live_... --api-url https://api.safefetch.dev list