{"id":13686996,"url":"https://github.com/NorfairKing/bevel","last_synced_at":"2025-05-01T12:32:13.442Z","repository":{"id":67627822,"uuid":"444547695","full_name":"NorfairKing/bevel","owner":"NorfairKing","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-28T10:27:50.000Z","size":327,"stargazers_count":37,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-06T09:12:03.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NorfairKing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://cs-syd.eu/support","github":["NorfairKing"]}},"created_at":"2022-01-04T20:02:00.000Z","updated_at":"2024-11-04T20:47:56.000Z","dependencies_parsed_at":"2023-12-14T16:28:12.759Z","dependency_job_id":"a6eabfb1-4783-417b-b64e-326da5700b5c","html_url":"https://github.com/NorfairKing/bevel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Fbevel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Fbevel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Fbevel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Fbevel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NorfairKing","download_url":"https://codeload.github.com/NorfairKing/bevel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224257357,"owners_count":17281690,"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":[],"created_at":"2024-08-02T15:00:45.688Z","updated_at":"2024-11-12T10:30:30.589Z","avatar_url":"https://github.com/NorfairKing.png","language":"Haskell","funding_links":["https://cs-syd.eu/support","https://github.com/sponsors/NorfairKing"],"categories":["Haskell","\u003ca name=\"history\"\u003e\u003c/a\u003eHistory management"],"sub_categories":[],"readme":"# Bevel: Command line history in an SQLite database for effective re-use\n\nPronounced \"bəvɛl\".\n\n## How it works\n\n* All terminal command history is saved using the `bevel` harness and saved in a local SQLite database.\n* Use this history for advanced terminal usage using the `bevel` CLI.\n* Synchronise your command history across devices using `bevel sync`.\n\n\n## Usage\n\nYou can use the database however you like, but `bevel` includes some nice general tools:\n\n### Directory switching\n\nUsing the `cd` command, you can switch to a previously visited directory quickly:\n\n```\ncd $(bevel cd) # Or use the C-p binding\n```\n\n### Command repetition\n\nBevel offers a replacement for the `C-r` functionality of your shell.\n\n```\n$(bevel repeat) # Or use the C-r binding\n```\n\n## Comparison to similar projects\n\n* [Atuin](https://github.com/ellie/atuin): Atuin is a rust version of this idea, but with various [issues](https://github.com/ellie/atuin/issues).\n* [Hastory](https://github.com/NorfairKing/hastory): Bevel is Hastory's successor.\n\n## Installation\n\n### Building from source, without Nix\n\n0. Get yourself [a copy of the Sqlite source code: `sqlite3.c`](https://sqlite.org/src/doc/trunk/README.md).\n1. Compile the `bevel-gather` utility and put it on your path.\n\n   ``` shell\n   cd bevel-gather\n   musl-gcc \\\n     -Wall -Wextra -pedantic -O2 -s -static -Wl,--gc-sections -Wl,--strip-all \\\n     bevel-gather.c \\\n     sqlite3.c \\\n     -o $out/bin/bevel-gather\n   ```\n\n2. Install the harness.\n\n   For `bash`, add this line to the end of your `~/.bashrc`:\n\n   ```\n   source /path/to/bevel/bevel-harness/harness.bash\n   ```\n\n   For `zsh`, add this line to the end of your `~/.zshrc`:\n\n   ```\n   source /path/to/bevel/bevel-harness/harness.zsh\n   ```\n\n3. Make sure you have Haskell's [stack](https://docs.haskellstack.org/en/stable/README/).\n\n   \n4. Install the `bevel` CLI.\n\n   ``` shell\n   stack install bevel-cli\n   ```\n\n5. Install the bindings.\n   These bind `C-p` to `cd $(bevel cd)` and `C-r` to `$(bevel repeat)`.\n\n   For `bash`, add this line to the end of your `~/.bashrc`:\n\n   ```\n   source /path/to/bevel/bevel-harness/bindings.bash\n   ```\n\n   For `zsh`, add this line to the end of your `~/.zshrc`:\n\n   ```\n   source /path/to/bevel/bevel-harness/bindings.zsh\n   ```\n\n6. Optional: Install the server: `stack install bevel-api-server`.\n\n   ``` shell\n   stack install bevel-api-server\n   ```\n\n### With Nix\n\n#### Home manager integration\n\n``` nix\n{ pkgs, lib, ... }:\nwith lib;\nlet\n  bevelModule =\n    builtins.fetchGit {\n      url = \"https://github.com/NorfairKing/bevel\";\n      rev = \"0000000000000000000000000000000000000000\"; # Put a recent commit hash here.\n      ref = \"master\";\n    } + \"/nix/home-manager-module.nix\";\nin\n{\n  imports = [\n    bevelModule\n    # [...]\n  ];\n  programs.bevel = {\n    enable = true; # Make the CLI available\n    harness = {\n      bash = {\n        enable = true; # Gather history from bash\n        bindings = true; # Bind C-p and C-r\n      };\n      zsh = {\n        enable = true; # Gather history from zsh\n        bindings = true; # Bind C-p and C-r\n      };\n    };\n    sync = {\n      enable = true;\n      server-url = \"YOURSERVERHERE\";\n      username = \"YOURUSERNAMEHERE\";\n      password = \"YOURPASSWORDHERE\";\n    };\n  };\n}\n```\n\nSee `nix/home-manager-module.nix`.\n\n\n#### NixOS integration to run the server\n\n``` nix\n{ lib, pkgs, config, ... }:\nlet\n  bevel-production = (\n    import (\n      builtins.fetchGit {\n        url = \"https://github.com/NorfairKing/bevel\";\n        rev = \"0000000000000000000000000000000000000000\"; # Put a recent commit hash here.\n        ref = \"master\";\n      } + \"/nix/nixos-module.nix\"\n    ) { envname = \"production\"; }\n  );\nin\n{\n  imports = [\n    bevel-production\n  ];\n  config = {\n    services.bevel.production.api-server = {\n      enable = true;\n      api-server = {\n        enable = true;\n        log-level = \"Warn\";\n        hosts = [ \"api.bevel.mydomain.com\" ];\n        port = 8402;\n        local-backup = {\n          enable = true;\n        };\n      };\n    };\n  };\n}\n```\n\nSee `nix/nixos-module.nix`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNorfairKing%2Fbevel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNorfairKing%2Fbevel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNorfairKing%2Fbevel/lists"}