{"id":15511567,"url":"https://github.com/codfish/vercel-redirects","last_synced_at":"2025-09-01T16:44:30.195Z","repository":{"id":57391589,"uuid":"259057159","full_name":"codfish/vercel-redirects","owner":"codfish","description":"Command-line utility to manage your Vercel project redirects. Doubles as a url shortener.","archived":false,"fork":false,"pushed_at":"2023-01-16T21:06:59.000Z","size":31,"stargazers_count":17,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T00:53:26.669Z","etag":null,"topics":["redirects","url-shortener","vercel"],"latest_commit_sha":null,"homepage":"vercel-redirects-two.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codfish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-26T14:55:31.000Z","updated_at":"2024-07-16T19:13:55.000Z","dependencies_parsed_at":"2023-02-10T06:15:39.753Z","dependency_job_id":null,"html_url":"https://github.com/codfish/vercel-redirects","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fvercel-redirects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fvercel-redirects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fvercel-redirects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fvercel-redirects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codfish","download_url":"https://codeload.github.com/codfish/vercel-redirects/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243867268,"owners_count":20360725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["redirects","url-shortener","vercel"],"created_at":"2024-10-02T09:53:07.259Z","updated_at":"2025-03-17T15:31:28.144Z","avatar_url":"https://github.com/codfish.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# vercel-redirects\n\n\u003e Command-line utility to manage your Vercel project redirects. Doubles as a url shortener.\n\n[![version][version-badge]][package] [![downloads][downloads-badge]][npmcharts]\n[![GitHub Workflow Status][actions-badge]][actions-badge] [![MIT License][license-badge]][license]\n[![PRs Welcome][prs-badge]][prs] [![Semantic Release][semantic-release-badge]][semantic-release]\n[![Commitizen friendly][commitizen-badge]][commitizen]\n\n![vercel-redirects example usage](https://cl.ly/56dc56e87ac2/Screen%2520Recording%25202020-04-26%2520at%252008.59%2520AM.gif 'Example Usage')\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Add](#add)\n- [Configuration](#configuration)\n- [Inspiration](#inspiration)\n- [LICENSE](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\nThis module is distributed via [npm](https://www.npmjs.com) which is bundled with\n[node](https://nodejs.org/en/). It can be installed as one of your project's `devDependencies` and\nused via an npm script.\n\n```sh\nnpm install --save-dev vercel-redirects\n```\n\n```json\n{\n  \"scripts\": {\n    \"shorten\": \"vercel-redirects\"\n  }\n}\n```\n\nYou can then then run `npm run shorten \u003cdestination-url\u003e`.\n\nYou can also install and run this globally.\n\n```sh\nnpm install -g vercel-redirects\n```\n\nOr run it through `npx`.\n\n```sh\nnpx vercel-redirects https://url.to.redirect.to.com\n```\n\n## Usage\n\nUse the cli directly from your command line or as an npm script.\n\n```txt\nUsage: vercel-redirects [options] [command]\n\nOptions:\n  -v, --version                         Output the current version.\n  -h, --help                            display help for command\n\nCommands:\n  add [options] \u003cdestination\u003e [source]  Add a new redirect. Short url is created for you if you dont provide a source.\n  help [command]                        display help for command\n```\n\n### Add\n\n```txt\nUsage: vercel-redirects add [options] \u003cdestination\u003e [source]\n\nAdd a new redirect. Short url is created for you if you dont provide a source.\n\nOptions:\n  -c, --status-code \u003ccode\u003e  HTTP status code. Must be a value between 301-308.\n  -h, --help                display help for command\n```\n\n**Note**: This is the default command, so it can be left out if you prefer.\n\n#### Simple\n\n```sh\nvercel-redirects add /destination-url /source-url\nvercel-redirects /destination-url /source-url\nvercel-redirects -c 302 /destination-url /source-url\nvercel-redirects --status-code 302 /destination-url /source-url\nvercel-redirects https://codfish.io /source-url\n```\n\n#### Url Shortener\n\n```sh\nvercel-redirects add /destination-url\nvercel-redirects /destination-url\nvercel-redirects https://codfish.io\nvercel-redirects -c 302 https://codfish.io\nvercel-redirects --status-code 302 https://codfish.io\n```\n\n## Configuration\n\nAdd configuration in the following ways (in order of precedence):\n\n1. A `vercel-redirects` object in your `package.json`.\n1. A `.vercelredirectsrc.json` file to the root of your project.\n1. A `.vercelredirectsrc` file to the root of your project.\n\n**package.json example:**\n\n```json\n{\n  \"vercel-redirects\": {\n    \"autoPush\": true\n  }\n}\n```\n\n**.vercelredirectsrc.json and .vercelredirectsrc example:**\n\n```json\n{\n  \"autoPush\": true\n}\n```\n\n| Variable   | Type    | Default | Description                                                                     |\n| ---------- | ------- | ------- | ------------------------------------------------------------------------------- |\n| `autoPush` | boolean | `false` | Automatically commit and push, effectively deploying whenever changes are made. |\n\n## Inspiration\n\nI had originally created a URL shortener, `codfi.sh`, for a project I built as a part\nof a General Assembly course. For a number of reasons, this project was kind of a pain to\nmaintain for me over the years.\n\nI stumbled upon Kent C. Dodd's\n[netlify-shortner](https://github.com/kentcdodds/netlify-shortener) \u0026 his url shortener\n[app tutorial](https://www.youtube.com/watch?v=HL6paXyx6hM), and was motivated to create my own and\nmigrate my short url domain, `codfi.sh` to use that instead.\n\nHowever, I'm a huge fan of Vercel (formally Now) and that's what I personally use for all my\nserverless apps. This cli utility was built to help facilitate the creation of redirects \u0026 short\nurls for Vercel projects, very much in the same vein as `netlify-shortener`.\n\n## LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[semantic-release]: https://github.com/semantic-release/semantic-release\n[semantic-release-badge]:\n  https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[commitizen]: http://commitizen.github.io/cz-cli/\n[commitizen-badge]:\n  https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square\n[npmcharts]: http://npmcharts.com/compare/vercel-redirects\n[version-badge]: https://img.shields.io/npm/v/vercel-redirects.svg?style=flat-square\n[package]: https://www.npmjs.com/package/vercel-redirects\n[downloads-badge]: https://img.shields.io/npm/dm/vercel-redirects.svg?style=flat-square\n[license-badge]: https://img.shields.io/npm/l/vercel-redirects.svg?style=flat-square\n[license]: https://github.com/codfish/vercel-redirects/blob/main/LICENSE\n[actions]: https://github.com/codfish/vercel-redirects/actions\n[actions-badge]:\n  https://img.shields.io/github/workflow/status/codfish/vercel-redirects/Release/main?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfish%2Fvercel-redirects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodfish%2Fvercel-redirects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfish%2Fvercel-redirects/lists"}