{"id":13581856,"url":"https://github.com/babarot/zsh-history","last_synced_at":"2025-04-06T10:33:00.406Z","repository":{"id":73075492,"uuid":"81331137","full_name":"babarot/zsh-history","owner":"babarot","description":"A plugin for zsh history extended by golang, dealing it like SQL","archived":true,"fork":false,"pushed_at":"2018-08-05T12:47:44.000Z","size":4285,"stargazers_count":84,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-21T13:50:19.259Z","etag":null,"topics":["go","golang","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babarot.png","metadata":{"files":{"readme":"README.md","changelog":"history.go","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-08T13:09:40.000Z","updated_at":"2024-01-15T02:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e562dcae-026f-478c-abef-d0840b6b792f","html_url":"https://github.com/babarot/zsh-history","commit_stats":null,"previous_names":["babarot/zsh-history"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fzsh-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fzsh-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fzsh-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babarot%2Fzsh-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babarot","download_url":"https://codeload.github.com/babarot/zsh-history/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470537,"owners_count":20944146,"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":["go","golang","zsh","zsh-plugin"],"created_at":"2024-08-01T15:02:16.799Z","updated_at":"2025-04-06T10:32:59.986Z","avatar_url":"https://github.com/babarot.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"zsh-history\n===========\n\nA plugin for zsh history extended by golang, dealing it like SQL\n\n![](https://cl.ly/032Z0Y2Z0Q2v/c.gif)\n\n## Features\n\n- Fast and simple\n- Searchable by SQL\n\t- History searchable per directory\n\t- etc...\n- Can sub-string search (like [zsh-users/zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search))\n- Automatically backup daily DB file like:\n\n    ```console\n    $ tree $ZSH_HISTORY_BACKUP_DIR\n    /Users/b4b4r07/.zsh/history/backup\n    `-- 2017\n        `-- 02\n            |-- 13.db\n            `-- 14.db\n    \n    2 directories, 2 files\n    ```\n\n## Installation\n\n```console\n$ git clone https://github.com/b4b4r07/zsh-history \u0026\u0026 cd zsh-history\n$ make \u0026\u0026 sudo make install\n$ source init.zsh\n```\n\n## Usage\n\nSet the env like the following:\n\n```zsh\n# DB file path\nexport ZSH_HISTORY_FILE=\"$HOME/.zsh_history.db\"\n# CLI selector\nexport ZSH_HISTORY_FILTER=\"fzy:fzf:peco:percol\"\n\n# History per directory\nexport ZSH_HISTORY_KEYBIND_GET_BY_DIR=\"^r\"\n# All histories\nexport ZSH_HISTORY_KEYBIND_GET_ALL=\"^r^a\"\n\n# Run any SQLs on original selector I/F (with screen)\nexport ZSH_HISTORY_KEYBIND_SCREEN=\"^r^r\"\n\n# substring\nexport ZSH_HISTORY_KEYBIND_ARROW_UP=\"^p\"\nexport ZSH_HISTORY_KEYBIND_ARROW_DOWN=\"^n\"\n```\n\n## About zhist\n\n### Schema\n\nTable name: `history`\n\nName | Type | Desc\n---|---|---\nid | int | ID\ndate | string | Date time (format by `%F %T`)\ndir | string | Direcotry when executed\ncommand | string | Command\nstatus | int | Status code (`$?`)\nhost | string | Host name\n\n### Configurable\n\nLocated in `~/.config/zhist/config.toml`:\n\n```toml\nprompt = \"sqlite3\u003e \"\ninit_query = \"SELECT DISTINCT(command) FROM history WHERE command LIKE '%%' AND status = 0 ORDER BY id DESC\"\ninit_cursor = \"%\"\nvim_mode_prompt = \"VIM-MODE\"\nignore_words = [\n    \"false\",\n    \"echo\",\n]\n```\n\n## License\n\nMIT\n\n## Author\n\nb4b4r07\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabarot%2Fzsh-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabarot%2Fzsh-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabarot%2Fzsh-history/lists"}