https://github.com/thatconference/that-vercel-cli
Simple cli for running batch processes against Vercel's cli
https://github.com/thatconference/that-vercel-cli
Last synced: 2 months ago
JSON representation
Simple cli for running batch processes against Vercel's cli
- Host: GitHub
- URL: https://github.com/thatconference/that-vercel-cli
- Owner: ThatConference
- License: gpl-3.0
- Created: 2023-12-19T01:52:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-20T16:02:59.000Z (over 1 year ago)
- Last Synced: 2025-01-20T05:41:09.357Z (4 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# that-vercel-cli
**beta** version software.
This basic cli will delete old deployments from a vercel account.## Setup
There are two places to configure the application
1. `.env`, two keys are needed in the .env file.
1. VERCEL_TOKEN, Bearer token for accessing the Vercel API.
1. VERCEL_TEAM_ID, required for team accounts. If the API is not authorizing you it's probably due to a missing team id.1. `appConfig.js` file. This file reads in environment variables and contains other needed values.
- `vercel.baseUrl`, Vercel API's base url.
- `vercel.deployMonthsToKeep`, int, number of months of deployments to keep around. Any deployments older than this term will be deleted.
- `vercel.fetchDeploymentLimit`, int, number of deployment records to fetch per request.
- `vercel.nextDeploymentFetchDelay`, int, milliseconds, how long to wait before fetching the next set of deployments for deletion.
- `vercel.deleteRequestDelay`, int, milliseconds, delay added to each delete request.
- `logDirectoryName`, default, 'logs'. This folder is part of .gitconfig to keep logs out of the repo.### Vercel Rate Limiting
Vercel rate limit information can be found here, [https://vercel.com/docs/limits/overview#rate-limits](https://vercel.com/docs/limits/overview#rate-limits). Vercel doesn't explicitly list a limit for deployment deletes, but, through testing, it appears to be similar to Domain Deletion, which is 60 ever 60 seconds. It also seems a rate limit is activated after 200 deletes regardless of request rate 😞.
To avoid hitting the limit the setting should be around:
- `appConfig.vercel.fetchDeploymentLimit`: 30
- `appConfig.vercel.deleteRequestDelay`: 1000
- `appConfig.vercel.nextDeploymentFetchDelay`: 3000
## Executing the scriptRun the script in one of two ways:
1. `node src/index.js`
1. `npm run start`## Requirements
node 20+
written as node esm, no transpiler.