{"id":15570477,"url":"https://github.com/cipherboy/hist-ng","last_synced_at":"2026-07-01T23:32:18.107Z","repository":{"id":147154391,"uuid":"150502277","full_name":"cipherboy/hist-ng","owner":"cipherboy","description":"Project-centric bash shell history management","archived":false,"fork":false,"pushed_at":"2019-05-24T03:06:12.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T12:31:35.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cipherboy.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":"2018-09-26T23:37:09.000Z","updated_at":"2019-05-24T03:06:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"a989f04e-ebcd-469e-8846-b0eca9d0de99","html_url":"https://github.com/cipherboy/hist-ng","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cipherboy/hist-ng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherboy%2Fhist-ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherboy%2Fhist-ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherboy%2Fhist-ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherboy%2Fhist-ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cipherboy","download_url":"https://codeload.github.com/cipherboy/hist-ng/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherboy%2Fhist-ng/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35027341,"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-07-01T02:00:05.325Z","response_time":130,"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":[],"created_at":"2024-10-02T17:42:28.269Z","updated_at":"2026-07-01T23:32:18.099Z","avatar_url":"https://github.com/cipherboy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hist-ng\n\nProject-centric bash shell history management.\n\n\n## Problem Overview\n\nThe `hist-ng` project aims to solve the problem of context management around\nshell history. Notably lacking from most default shell installations--and\nmany custom dotfile hacks--is a concept of project and project hierarchy.\n\nConsider a developer with the following project setup:\n\n    /personal/project_a\n    /personal/project_b\n    /org_a/project_c\n    /org_a/project_d\n\nIf a single global history is used, as per the default on every operating\nsystem install known to the author, all five project's histories are mixed\nand muddied. If a per-directory (or per git-repository or similar structure)\nhistory file is set, then there is no way to establish the connection\nbetween project c and d, if one exists. (Say, front- and back-end code to\nthe same underlying project).\n\nFurther, if these projects have their specific histories \"seeded\" from the\nglobal history, it might be desirable to sync history back into the global\nhistory, so commands run against one project can be more easily found\nin the global context.\n\n\n## Problem Statement\n\n`hist-ng` wishes to solve the following use-cases for history management:\n\n - Maintaining per-project history and context.\n - Creating filters comining multiple project histories.\n - Merging per-project history into the global context.\n - Searching all history from any context.\n\nBy \"history and context\", we currently mean the following four pieces of\ninformation:\n\n - The literal text of the last run command.\n - The project the command was run in.\n - The directory the command was run in.\n - The time at which the command was run.\n\nBy \"filters combing multiple project histories\", we currently mean the\nfollowing:\n\n - Interleave by time executed, or concatenate, multiple project histories.\n - Ignore desired commands, by regex or substring matching.\n\nBy merging per-project histories into the global context, we mean the\nsame as above, but only by interleaving commands across all tracked\nprojects. Projects that are explicitly excluded will be ignored.\n\nBy searching, we wish to filter searches quickly and efficiently with an\noutput format similar to the standard `history` tool.\n\nInitially this should focus on correctness before speed and optimize later\nif necessary. At this time, no import tool is planned, but would be useful\nin the future. Lastly, auto-project detection should be implemented, allowing\ncommands containing paths or programs to be always tagged to a specific\nproject.\n\n\n## Development Overview\n\nThis project contains several useful parts:\n\n - `bash_helper.sh` -- a collection of bash functions for using `hist-ng` in\n   a bash shell. This contains functions for getting and saving the last\n   command and triggering it on each prompt.\n\n - `hist-ng.py` -- a Python 3 script for managing project history. This is\n   what does the heavy lifting and maintains the SQLite database and raw\n   `bash_history` files.\n\n - `database.sql` -- a database creation script for use during initial setup\n   phase. At some point it might be replaced by a purely Python installer.\n\n - `config.json` -- a sample configuration script for use with `hist-ng`.\n   This shows all of the possible options and serves as documentation of the\n   configuration format. Note that it is a `JSON` document and must lint as\n   such. (`python3 -m json.tool /path/to/config.json`)\n\n - `LICENSE` -- `hist-ng` is licensed under the GPLv3 license.\n\n\n## Usage\n\nPlease make sure you have Python3 and the `sqlite3` module. Then:\n\n 1. Copy the `hist-ng.py` to a suitable location.\n 2. Add the contents of `bash_helper.sh` into your `bashrc` files.\n 3. Update the location of `HIST_NG_PATH` to point at the location from (1).\n 4. Run `hist-ng \u003cinit\u003e`. This initializes `hist-ng` and creates a config\n    directory, `$HOME/.hist-ng` if it doesn't exist. You can then modify the\n    configuration in `$HOME/.hist-ng/config.json` as desired.\n\nThat's it! Have fun using `hist-ng`.\n\n\n## Miscellaneous\n\nTo report issues, please see the Issues tab on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipherboy%2Fhist-ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcipherboy%2Fhist-ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipherboy%2Fhist-ng/lists"}