{"id":18263946,"url":"https://github.com/studiometa/cli-test-redirection","last_synced_at":"2025-04-09T01:28:53.216Z","repository":{"id":96920683,"uuid":"366137614","full_name":"studiometa/cli-test-redirection","owner":"studiometa","description":"🔄 Easily test your redirection plan","archived":false,"fork":false,"pushed_at":"2024-12-09T01:15:57.000Z","size":206,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":12,"default_branch":"develop","last_synced_at":"2025-02-14T19:46:39.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/studiometa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T18:20:03.000Z","updated_at":"2024-06-27T14:23:45.000Z","dependencies_parsed_at":"2023-12-20T14:30:22.910Z","dependency_job_id":"2a727c5b-efb5-4ba6-a898-35c753ada34b","html_url":"https://github.com/studiometa/cli-test-redirection","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiometa%2Fcli-test-redirection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiometa%2Fcli-test-redirection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiometa%2Fcli-test-redirection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiometa%2Fcli-test-redirection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studiometa","download_url":"https://codeload.github.com/studiometa/cli-test-redirection/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247956012,"owners_count":21024497,"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":[],"created_at":"2024-11-05T11:13:16.664Z","updated_at":"2025-04-09T01:28:53.200Z","avatar_url":"https://github.com/studiometa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redirection test CLI\n\n\u003e Easily test your redirection plan.\n\n## Usage\n\nYou can directly use the CLI with `docker`:\n\n```sh\ndocker run -it --rm -v $PWD:/app studiometa/test-redirection redirects.csv \n```\n\nOr with `npx`:\n\n```sh\nnpx @studiometa/cli-test-redirection redirects.csv\n```\n\nOr you can install it globally:\n\n```sh\nnpm install -g @studiometa/cli-test-redirection\ntest-redirection redirects.csv\n```\n\nThe `redirects.csv` file should have 2 columns: the first one is the original URL, the second is the redirected URL.\n\n### Mock hosts to test redirects before deploying\n\nThe Docker image can configure an Apache environment to test request against a mocked environment. \n\n```sh\n# Create your .htaccess file with redirections to test\nvim .htaccess\n\n# Create a CSV fiels containing from,to URLS\nvim redirects.csv\n\n# Configure the temporary hosts referenced in your redirects, they will be configured in the Docker container\nexport DOMAINS='fqdn.com,www.fqdn.com'\n\n# Run the Docker image by linking the current directy to /app\ndocker run -it --rm -v $PWD:/app -e DOMAINS studiometa/cli-test-redirection redirects.csv \n```\n\n## Parameters\n\n### `--concurrecy [number]`\n\nLimit the number of tests running concurrently.\n\n```bash\n# Limit to 1 test\ntest-redirection --concurrency 1 path/to/redirects.csv\ntest-redirection -c 1 path/to/redirects.csv\n```\n\n### `--delay [number]`\n\nAdd a delay in milliseconds between batch of tests.\n\n```bash\n# Wait for 1s between each batch of tests\ntest-redirection --delay 1000 path/to/redirects.csv\ntest-redirection -d 1000 path/to/redirects.csv\n\n# Wait for 1s between each tests\ntest-redirection --delay 1000 --concurrency 1 path/to/redirects.csv\ntest-redirection -d 1000 -c 1 path/to/redirects.csv\n```\n\n### `--ignore-query-parameters`\n\nIgnore query parameters when comparing the final URL with the target URL defined in the config.\n\n```bash\ntest-redirection --ignore-query-parameters path/to/config.json\n```\n\n### `--parser [json|csv]`\n\nDefine how the input file should be parsed. The parser is inferred by the given file extension.\n\n```bash\ntest-redirection path/to/file.csv --parser csv\n```\n\n### `--replace-host`\n\nReplace the host from the values in the configuration file to easily test against different environment.\n\n```bash\ntest-redirection path/to/config.json --replace-host preprod.fqdn.com\n```\n\n### `-v, --verbose`\n\nDisplay verbose output.\n\n```bash\ntest-redirection path/to/config.json -v\n```\n\n### `--only-errors`\n\nWhen in verbose mode, will only print errors to the console. Useful when you have hundreds of redirections with only a few one failing.\n\n```bash\ntest-redirection path/to/config.json -v --only-errors\n```\n\n### `--user`\n\nDefine basic auth user. This parameter is directly passed to the underlying `curl` command.\n\n```bash\ntest-redirection path/to/config.json --user user:password\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiometa%2Fcli-test-redirection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiometa%2Fcli-test-redirection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiometa%2Fcli-test-redirection/lists"}