{"id":16763346,"url":"https://github.com/nicholaswilde/lastpass-clean","last_synced_at":"2026-05-21T04:04:30.139Z","repository":{"id":141917095,"uuid":"493882346","full_name":"nicholaswilde/lastpass-clean","owner":"nicholaswilde","description":"📜Bash scripts to help clean up a LastPass vault","archived":false,"fork":false,"pushed_at":"2022-05-23T04:28:40.000Z","size":74,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T10:27:53.624Z","etag":null,"topics":["bash","bash-script","lastpass-cli","password-manager","passwords"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicholaswilde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"paypal.me/nicholaswilde"}},"created_at":"2022-05-19T01:40:26.000Z","updated_at":"2022-05-23T04:44:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"082c35ab-9cb2-404b-936c-92a207a0afd3","html_url":"https://github.com/nicholaswilde/lastpass-clean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicholaswilde/lastpass-clean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholaswilde%2Flastpass-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholaswilde%2Flastpass-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholaswilde%2Flastpass-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholaswilde%2Flastpass-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicholaswilde","download_url":"https://codeload.github.com/nicholaswilde/lastpass-clean/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholaswilde%2Flastpass-clean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash","bash-script","lastpass-cli","password-manager","passwords"],"created_at":"2024-10-13T05:06:18.388Z","updated_at":"2026-05-21T04:04:30.103Z","avatar_url":"https://github.com/nicholaswilde.png","language":"Shell","funding_links":["paypal.me/nicholaswilde"],"categories":[],"sub_categories":[],"readme":"# lastpass-clean\n\nBash scripts to help clean up a [LastPass][1] vault\n\n\u003e :warning: Warning: Theses scripts remove items from a LastPass vault! Use with cation!\n\n## :rocket:\u0026nbsp; TL;DR\n\n```shell\nbrew install lastpass-cli jq whois\nchmod +x check-urls.sh rm-dead-url-items.sh\n./check-urls.sh dead-urls.csv\n./rm-dead-url-items.sh dead-urls.csv\nrm dead-urls.csv\n```\n\n## :framed_picture:\u0026nbsp; Background\n\nI have been using [LastPass][1] as my password manager for quite some time and now have over 1,000 items.\nI have realized that a lot of my items haven't been used in quite some time and so I wanted to clean it up.\nGoing through all of the entries manually is a daunting task and so I decided to leverage [lastpass-cli][3] to automate the cleanup.\n\nOne cleanup task is to remove items to websites that no longer exist.\nOne way of doing this is to check if the `url` parameter is actually a dead url.\nSometime the sub domain isn't available anymore but the website still exists.\n\nAnother cleanup task is to rename the items. Since I am using the command line client more, I decided to replace spaces with\ndashes and convert the names to lowercase to make it easier to work with the command prompt.\n\n## :gear:\u0026nbsp; Prerequisites\n\n```shell\nbrew install lastpass-cli jq whois\n# or\ntask deps\n# or\nbrew install $(cat formulas)\n```\n\n## :scroll:\u0026nbsp; Scripts\n\n| Script                  | Description                                             |\n|-------------------------|---------------------------------------------------------|\n| `check-urls.sh`         | Check LastPass vault for dead urls                      |\n| `rm-dead-url-items.sh`  | Remove items with dead urls from LastPass vault         |\n| `check-names.sh`        | Check LastPass vault for items that need to be renamed  |\n| `rename-items.sh`       | Rename items from LastPass vault                        |\n\n`check-urls.sh` checks each item for the following:\n- Skips the item if no URL is set or is equal to `ns`\n- Checks if the main domain exists with [`whois`][4]. It does not check the sub domain. It also does not handle urls\nwith more than one suffix (such as `co.uk`).\n\n`check-names.sh` renames the files with the following changes:\n- Remove `.com`, `.gov`, `.net`\n- Replace spaces with dashes\n- Remove trailing and leader white space\n- Remove apostrophes\n- Convert to lowercase\n\n## :gear:\u0026nbsp; Configuration\n\n`check-names.sh` - groups can be ignred by changing the `IGNORE_GROUPS` array in the header of the file. \n\nBe sure to put the names in double quotes with no commas in between\n\n```bash\n...\nIGNORE_GROUPS=(\"Shared-Us\" \"Secure Notes\")\n...\n```\n\n## :floppy_disk:\u0026nbsp; Backup\n\nBe sure to backup the vault before using these scripts.\n\n```shell\nlpass export \u003e backup.csv\n# or\ntask backup\n```\n\n## :book:\u0026nbsp; Usage\n\nMake the scripts executable\n\n```shell\nchmod +x check-urls.sh rm-dead-url-items.sh check-names.sh rename-items.sh\n```\n\n### :link:\u0026nbsp; Remove Dead URL Items\n\nCheck items for dead urls and export them to a csv file\n\n```shell\n./check-urls.sh dead-urls.csv\n# or\ntask urls\n```\n\nManually review the csv file to confirm that there aren't any items that should not be deleted.\n\nRemove the items with dead urls.\n\n```shell\n./rm-dead-url-items.sh dead-urls.csv\n# or\ntask rm\n```\n\nRemove the dead url csv file.\n\n```shell\nrm dead-urls.csv\n```\n\n### :open_file_folder:\u0026nbsp; Rename Items\n\nRename items and export them to a csv file\n\n```shell\n./check-names.sh rename.csv\n# or\ntask names\n```\n\nManually review the csv file to confirm that there aren't any items that should not be renamed.\n\nRename items that need to be renamed.\n\n```shell\n./rename-items.sh rename.csv\n# or\ntask rename\n```\n\nRemove the rename csv file.\n\n```shell\nrm rename.csv\n```\n\n## :robot:\u0026nbsp; Task\n\nThis repository uses [`go-task`][5] to automate tasks.\n\n\u003e :warning: Warning: `task clean` removes all `csv` files including `backup.csv` \n\n```shell\n# Print a list of tasks\ntask\n```\n\n## :balance_scale:\u0026nbsp; License\n\n[Apache 2.0 License](../LICENSE)\n\n## :pencil:\u0026nbsp; Author\n\nThis project was started in 2022 by [Nicholas Wilde][2].\n\n[1]: https://www.lastpass.com/\n[2]: https://github.com/nicholaswilde/\n[3]: https://github.com/lastpass/lastpass-cli/\n[4]: https://manpages.debian.org/stretch/whois/whois.1.en.html\n[5]: https://taskfile.dev/#/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholaswilde%2Flastpass-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholaswilde%2Flastpass-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholaswilde%2Flastpass-clean/lists"}