{"id":13528762,"url":"https://github.com/meaningful-ooo/sponge","last_synced_at":"2025-04-01T14:33:02.104Z","repository":{"id":48303907,"uuid":"264188065","full_name":"meaningful-ooo/sponge","owner":"meaningful-ooo","description":"🧽 Clean fish history from typos automatically","archived":false,"fork":false,"pushed_at":"2024-01-21T02:38:40.000Z","size":21,"stargazers_count":315,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-24T04:47:06.418Z","etag":null,"topics":["command-history","fish","fish-plugin","fisher","open-source","shell-history"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/meaningful-ooo.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}},"created_at":"2020-05-15T12:29:14.000Z","updated_at":"2025-03-21T17:18:18.000Z","dependencies_parsed_at":"2024-04-12T20:55:28.602Z","dependency_job_id":null,"html_url":"https://github.com/meaningful-ooo/sponge","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meaningful-ooo%2Fsponge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meaningful-ooo%2Fsponge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meaningful-ooo%2Fsponge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meaningful-ooo%2Fsponge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meaningful-ooo","download_url":"https://codeload.github.com/meaningful-ooo/sponge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246655249,"owners_count":20812607,"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":["command-history","fish","fish-plugin","fisher","open-source","shell-history"],"created_at":"2024-08-01T07:00:24.070Z","updated_at":"2025-04-01T14:33:00.188Z","avatar_url":"https://github.com/meaningful-ooo.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell"],"sub_categories":["other plugin"],"readme":"# 🧽 Sponge [![Releases](https://img.shields.io/github/release/meaningful-ooo/sponge.svg?label=\u0026color=%23ffffff)](https://github.com/meaningful-ooo/sponge/releases/latest)\n\n\u003cdiv align=\"center\"\u003e\n\n[![Discord](https://img.shields.io/discord/776090526410604564?color=%235866f2\u0026label=%20\u0026logo=discord\u0026logoColor=%23ffffff)](https://discord.gg/KEc2MMV3T9) [![Twitch Status](https://img.shields.io/twitch/status/borisovdev?color=%239146ff\u0026label=%20\u0026logo=twitch\u0026logoColor=%23ffffff)](https://twitch.tv/borisovdev)\n\n\u003c/div\u003e\n\n\u003e Don't you hate it when you spend half an hour searching for a command, finally find it and happily press `Enter` only to realize a couple of seconds later... it's not that one, it's another one you've entered two months ago, the one with the _typo_.\n\n\u003e Ugh. Awful. Ungodly. Unproductive. Your day is ruined… unless you use _Sponge_.\n\nSponge quietly runs in the background and keeps your shell history clean from typos, incorrectly used commands and everything you don't want to store due to privacy reasons.\n\n## 💾 Installation\n\nInstall with [Fisher](https://github.com/jorgebucaran/fisher):\n\n```fish\nfisher install meaningful-ooo/sponge\n```\n\n### 🤖 System requirements\n\n- [fish](http://fishshell.com) 3.2+\n\n## 🕹️ Usage\n\nJust use your shell as usual and enjoy typos-free history😎\n\nSponge will automatically filter out all failed commands unless they have been in the history before. The last 2 entries are always available so you can quickly fix a misspelled command.\n\n\u003e Sponge won’t filter commands retroactively. If you don’t want previously mistyped commands clogging up your search results, clear the history once after Sponge installation:\n\n```fish\nhistory clear\n```\n\n## ⚙️ Settings\n\n### 💩 Filter failed\n\nBy default Sponge will filter out all commands that don’t have `0` as an exit code. You can tweak which exit codes Sponge considers successful with `sponge_successful_exit_codes` variable:\n\n```fish\nset sponge_successful_exit_codes 0 127\n```\n\nIf you wish to filter out all failed commands regardless of whether they already have been in the history or not, change `sponge_allow_previously_successful` variable:\n\n```fish\nset sponge_allow_previously_successful false\n```\n\n### 🕵🏻 Filter by regex\n\nYou can use the full power of regular expressions to filter out unwanted commands. Set `sponge_regex_patterns` variable and everything matched will be kept away from the history. For example, to filter out every command that contains IPv4 address, type:\n\n```fish\nset sponge_regex_patterns '(?:\\d{1,3}\\.){3}\\d{1,3}'\n```\n\n### 🦥 Adjusting delay\n\nBy default Sponge delays purging of filtered command so you can always access the last 2 history entries. If you want to remove commands immediately or increase the delay, change `sponge_delay` variable:\n\n```fish\nset sponge_delay 5\n```\n\n### ⛔ Purge only on exit\n\nSometimes you want to ignore `sponge_delay` variable and access the whole history of the current session. In such cases you can instruct Sponge to purge entries only on shell exit with `sponge_purge_only_on_exit` variable:\n\n```fish\nset sponge_purge_only_on_exit true\n```\n\n\u003e 💡 Did you know you can change settings only for the current session? Just add `--global` flag when setting any variable and it won't be preserved after shell exit.\n\n### 🤓 Custom filters\n\nSponge works by invoking an array of _filters_. You can plug into this mechanism by defining your own filters.\n\nFilter is simply a function with a specific call signature:\n\n| **Argument** | **Name**                | **Description**                                                                 |\n| ------------ | ----------------------- | ------------------------------------------------------------------------------- |\n| 1            | `command`               | The exact command that was entered                                              |\n| 2            | `exit_code`             | The exit code of the command                                                    |\n| 3            | `previously_in_history` | `true` or `false` flag indicating if the command has been in the history before |\n\nReturn with exit status `0` to filter out provided command and anything else to keep the command in the history.\n\nYou can define your filter in `config.fish` or as a standalone function in fish `functions` folder.\n\n\u003e Be mindful of what you put in filters, as they are run synchronously after each command execution and can slow down your prompt in case of compute-intensive tasks or network requests.\n\nAfter that you need to register your filter with Sponge by adding its name in `sponge_filters` variable:\n\n```fish\nset --append sponge_filters my_awesome_filter\n```\n\nMake sure to append `sponge_filters` like in the example above unless you want to disable the built in filters:\n\n- [`sponge_filter_failed`](https://github.com/meaningful-ooo/sponge/blob/main/functions/sponge_filter_failed.fish) filters by command exit code\n- [`sponge_filter_matched`](https://github.com/meaningful-ooo/sponge/blob/main/functions/sponge_filter_matched.fish) filters using regex patterns\n\n## ©️ License\n\n[MIT](LICENSE)\n\n# 🏴‍☠️ 🏰 💎 Meaningful\n\nWe are the first ever blockchain state. [More](https://meaningful.ooo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeaningful-ooo%2Fsponge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeaningful-ooo%2Fsponge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeaningful-ooo%2Fsponge/lists"}