{"id":39197609,"url":"https://github.com/jkmathes/histx","last_synced_at":"2026-01-17T22:50:26.733Z","repository":{"id":44119529,"uuid":"408275898","full_name":"jkmathes/histx","owner":"jkmathes","description":"Find anything in your command history","archived":false,"fork":false,"pushed_at":"2025-04-17T11:44:04.000Z","size":164,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-18T01:53:13.143Z","etag":null,"topics":["bash","c","command-line-tool","sqlite"],"latest_commit_sha":null,"homepage":"","language":"C","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/jkmathes.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}},"created_at":"2021-09-20T01:15:41.000Z","updated_at":"2024-05-07T23:27:03.000Z","dependencies_parsed_at":"2023-02-15T13:31:05.831Z","dependency_job_id":"953a62e0-d40d-4ae7-9004-3f850b581c0b","html_url":"https://github.com/jkmathes/histx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkmathes/histx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmathes%2Fhistx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmathes%2Fhistx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmathes%2Fhistx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmathes%2Fhistx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkmathes","download_url":"https://codeload.github.com/jkmathes/histx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmathes%2Fhistx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28521166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","c","command-line-tool","sqlite"],"created_at":"2026-01-17T22:50:26.662Z","updated_at":"2026-01-17T22:50:26.721Z","avatar_url":"https://github.com/jkmathes.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![workflow](https://github.com/jkmathes/histx/actions/workflows/c.yml/badge.svg)\n\n# histx\nFind anything in your command history\n\n## Dependencies\nJust a few - MacOS should be set; for linux, you need sqlite3 and openssl libraries, as well as flex and bison and bsd compatibility\n\nOn Ubuntu, for example:\n```\napt-get install -y build-essential libsqlite3-dev libssl-dev flex bison libbsd-dev\n```\n## Installation\nOn MacOS, for example in `.bash_profile`:\n```shell\nsave_cmd() {\n    path/to/histx index $(history 1 | awk '{$1=\"\"; print $0}')\n}\n\nexport PROMPT_COMMAND=\"save_cmd;$PROMPT_COMMAND\"\n```\n\nFor zsh, set your `pre_cmd()` hook:\n```shell\nprecmd() {\n    path/to/histx index $(history -1 | awk '{$1=\"\"; print $0}')\n}\n```\n\nIf you'd like to run tests:\n```shell\nmake all\n./build/histx-test\n```\n\n## Importing current history\n\nAt present, you can import your current history using the `index` command:\n\n```shell\n# for zsh\nhistory 1 | awk '{$1=\"\"; print $0}' | path/to/histx index -\n\n# for bash\nhistory | awk '{$1=\"\"; print $0}' | path/to/histx index -\n```\n\n## Reverse Search\n\n### zsh\n\nFor zsh, you can create a widget to invoke `histx` for reverse/forward search.\nExplore presently does not have any \"directionality\" notion per se, so bind\nas you wish.\n\nExample with zle:\n```shell\nfunction _histx-search {\n  local VISUAL=\"$PATH_TO_HISTX explore\"\n  zle edit-command-line # will invoke $VISUAL with a tmp file name\n  zle accept-line\n}\n\nzle -N _histx-search # register the widget\nbindkey \"^R\" _histx-search # bind traditional emacs mode rev search \nbindkey -a \"/\" _histx-search # bind traditional vi mode rev search\n```\n\n## Usage\n```\nusage: histx [-d dbfile] \u003ccommand\u003e\n\toptions:\n\t\t-d path/to/db/file.db -- defaults to $HOME/.histx.db or the value of $HISTX_DB_FILE\n\t\t-h this usage information\n\tcommands:\n\t\tindex             - index all arguments after this command - \n\t\t                    if the only argument after index is `-` read from stdin\n\t\tfind              - find matching commands using the the passed keywords\n\t\tcat               - dump the indexed commands\n\t\texplore [tmpfile] - interactive searching of the index\n\t\t                    If [tmpfile] is provided, will write the selection (if any)\n\t\t                    to the tmp file.\n\t\tprune             - allows you to mark entries to be pruned from the index via the explore interface\n```\n\n## Settings\nOptions should be placed in `~/.histx`\n\nOptions:\n* `explore-basic = true` - simply print the `explore` result instead of writing back into the command buffer\n* `search-limit = \u003climit\u003e` - set the maximum number of results returned in interactive `explore`; default is `5`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkmathes%2Fhistx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkmathes%2Fhistx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkmathes%2Fhistx/lists"}