{"id":51123468,"url":"https://github.com/liuzhen9320/psreadline-cleaner","last_synced_at":"2026-06-25T05:01:40.305Z","repository":{"id":366892722,"uuid":"1248270493","full_name":"liuzhen9320/psreadline-cleaner","owner":"liuzhen9320","description":"A Python tool to clean, deduplicate, and filter Windows PowerShell console history (ConsoleHost_history.txt).","archived":false,"fork":false,"pushed_at":"2026-05-24T12:24:50.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T19:34:55.368Z","etag":null,"topics":["cleaner","history-management","powershell","python","python312"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liuzhen9320.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T12:23:26.000Z","updated_at":"2026-05-24T12:25:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/liuzhen9320/psreadline-cleaner","commit_stats":null,"previous_names":["liuzhen9320/psreadline-cleaner"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/liuzhen9320/psreadline-cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhen9320%2Fpsreadline-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhen9320%2Fpsreadline-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhen9320%2Fpsreadline-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhen9320%2Fpsreadline-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuzhen9320","download_url":"https://codeload.github.com/liuzhen9320/psreadline-cleaner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhen9320%2Fpsreadline-cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34760219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cleaner","history-management","powershell","python","python312"],"created_at":"2026-06-25T05:01:39.809Z","updated_at":"2026-06-25T05:01:40.293Z","avatar_url":"https://github.com/liuzhen9320.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PS History Cleaner\n\nA Python tool to clean, deduplicate, and filter Windows PowerShell console history (`ConsoleHost_history.txt`).\n\n## What it does\n\n1. **Reads** the raw PowerShell history file.\n2. **Exactly deduplicates** – keeps the last occurrence of each command.\n3. **Computes similarity** between commands using a trie‑based prefix analysis (outputs a `.txt` report).\n4. **Fuzzy deduplicates** – removes commands that are ≥80% prefix of a longer kept command.\n5. **Filters out**:\n   - Help commands (`--help`, `-h`, `git help`, etc.)\n   - Install commands (`npm install`, `pip install`, `go get`, etc.) – also reports per‑package manager.\n   - Runner commands (`npx`, `go run`, `bun run`, `git clone`, etc.)\n   - Low‑frequency commands (raw total \u003c10 occurrences).\n6. **Outputs** the final cleaned command list to `ConsoleHost_history_dryrun.txt` along with detailed statistics.\n\n## Why use it?\n\n- Reduce noise from repetitive help/install/runner commands.\n- Keep only the most representative commands for your workflow.\n- Understand your command usage patterns (raw vs. kept counts per command word).\n\n## Usage\n\n1. Place the script in the same folder as `ConsoleHost_history.txt` (default PowerShell history path: `%USERPROFILE%\\AppData\\Roaming\\Microsoft\\Windows\\PowerShell\\ConsoleHost_history.txt`).\n2. Run:\n   ```bash\n   python history_cleaner.py\n   ```\n3. Review the generated files:\n   - `ConsoleHost_history_analysis.txt` – similarity matrix.\n   - `ConsoleHost_history_dryrun.txt` – final filtered commands.\n   - Console output – filtering statistics and command word summaries.\n\n## Requirements\n\n- Python 3.7+\n- No external dependencies (uses only standard library).\n\n## Customization\n\nYou can modify the `threshold` in `fuzzy_dedupe()` (default 0.8) or adjust the frequency filter (`\u003c10` in `main()`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuzhen9320%2Fpsreadline-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuzhen9320%2Fpsreadline-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuzhen9320%2Fpsreadline-cleaner/lists"}