{"id":27627746,"url":"https://github.com/rdsq/blazesh","last_synced_at":"2025-08-07T00:35:15.159Z","repository":{"id":288295575,"uuid":"960009487","full_name":"rdsq/blazesh","owner":"rdsq","description":"Custom shell prompt","archived":false,"fork":false,"pushed_at":"2025-06-26T22:11:11.000Z","size":946,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T23:38:04.190Z","etag":null,"topics":["rust","shell-prompt"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/rdsq.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":"2025-04-03T17:58:09.000Z","updated_at":"2025-06-26T22:11:14.000Z","dependencies_parsed_at":"2025-06-26T23:27:22.369Z","dependency_job_id":"4e404222-9bdd-48a2-8151-e821aa681c10","html_url":"https://github.com/rdsq/blazesh","commit_stats":null,"previous_names":["rdsq/blazesh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rdsq/blazesh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdsq%2Fblazesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdsq%2Fblazesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdsq%2Fblazesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdsq%2Fblazesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdsq","download_url":"https://codeload.github.com/rdsq/blazesh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdsq%2Fblazesh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269180783,"owners_count":24373835,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"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":["rust","shell-prompt"],"created_at":"2025-04-23T13:56:36.314Z","updated_at":"2025-08-07T00:35:15.129Z","avatar_url":"https://github.com/rdsq.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Blazesh](./media/blazesh.jpg)\n\nIt is a custom shell prompt theme made in Rust\n\n![Blazesh demo](./media/demo.jpg)\n\nIt was created to be minimal, compact, beautiful, smart (compared to a potato), and just a fun experiment\n\n## Why\n\nThere might be a few \"why\" questions related to this project\n\n1. **Why Rust?** Because it is easier. I know, it is a complied language, but it is so much easier to implement complex features than in shell scripts, it doesn't have to run a thousand commands to do something simple. And just because why not\n2. **Why Blazesh?** As a reference to the fact that everything written in Rust is blazingly fast. It's not the primary goal, if you want the fastest experience, just run `PS1='$ '` in your shell. I just like how Blazesh sounds\n3. **Why (in general)?** To create something that would be the closest to my ideal prompt. Also to be a fun project\n\n## Installation\n\nYou can install it using:\n\n```sh\ncargo install --git https://github.com/rdsq/blazesh\n```\n\nAnd then add one of these to your shell config file:\n\n### Bash `~/.bashrc`\n\n```sh\neval \"$(blazesh setup bash)\"\n```\n\n### Zsh `~/.zshrc`\n\n```sh\neval \"$(blazesh setup zsh)\"\n```\n\n### Bash or Zsh autodetect\n\n```sh\neval \"$(blazesh setup detect)\"\n```\n\n### Fish `~/.config/fish/config.fish`\n\n```fish\nsource (blazesh setup fish | psub)\n```\n\n## Features\n\nThe prompt shows a clean path, if it is too long it is cut\n\nIt also shows the error exit codes, some of them with special messages *(doesn't work on Bash)*\n\nAnd the git panel, yes it kind of takes time to load, but it is helpful\n\n- `+` represents the uncommitted changes\n- `↑` represents unpushed changes\n- `↓` represents unpulled changes\n\nAnd it also shows the number of background jobs if it is not `0` like this:\n\n![Blazesh showing the jobs number in brackets as 1 after running `sleep 5` on background](./media/jobs.jpg)\n\n## Configuration\n\nHere is how you can configure Blazesh with environment variables:\n\n### Git mode\n\nYou can configure how it handles git by changing the `BLAZESH_GIT_MODE` environment variable. **Possible values:**\n\n- `unoptimized` - check git status every time, even if it is not a git repository\n- `optimized` (default) - check git status only if the current directory or one of its parents is a git repository. **Best for functionality**\n- `optimized-cwd` - like `optimized`, but checks only the current directory, doesn't check its parents\n- `static` - just show `[git]` if the current directory or one of its parents is a git repository. Does not check any status or anything. **Best for performance balance**\n- `static-cwd` - like `static`, but checks only the current directory\n- `disabled` - completely disable git integration\n\n*And yes, you can use non 🦅🦅🦅🦅🦅🦅 spelling*\n\n### Colors\n\nYou can set the color of the path in the prompt by editing `BLAZESH_ACCENT_COLOR`. You can set it to any number 0-7 and 9 representing the ANSI color codes, and also any RGB HEX value. You can also set it to a sequence of colors, and it will show them as repeating colors. **Examples:**\n\n- `5` - magenta\n- `9` - default color (usually white or black)\n- `4 3` - 🇺🇦\n- `4 4 4 4 3 3 3 3` - same as the previous one, but more readable\n- `0 1 2 3 4 5 6 7` - full ANSI rainbow\n- `FF0000 FF7F00 FFFF00 00FF00 00FFFF 0000FF 8B00FF` - actual rainbow 🌈\n\n**But** it also has the second mode: **gradient**\n\nYou can set a gradient between any two RGB values by following the `gradient [color1] [color2] ... [color_n]` syntax\n\nFor example, set the `BLAZESH_ACCENT_COLOR` environment variable to `gradient 0057B7 FFD700` to see the gradient between the official 🇺🇦 colors\n\n![Really long path showing a gradient from blue to yellow](./media/gradient.jpg)\n\nYou can even define gradient looping! This means that app the colors will repeat after certain number of characters\n\n```sh\n# For RGB\nexport BLAZESH_ACCENT_COLOR=\"gradient FF0000 00FF00 0000FF interval=10\"\n```\n\nAnd the default color is a looping gradient too! It is `gradient FF9900 FFFF00 interval=10`\n\n### Path\n\nUse `BLAZESH_PATH_DEPTH` to edit how many directories to show before replacing them with `...`. Any number from 0 to 255. **Default: 2**\n\n**Examples with values and how it displays the path**:\n\n- `0` - `...`\n- `1` - `.../src`\n- `2` *(and higher)* - `~/blazesh/src`\n\nAnd you can also set the accent color to `none` to disable the colors in the path. Not sure why, but you can\n\n### Exit codes format\n\nYou can change how exit codes will be shown in the prompt by editing `BLAZESH_EXIT_CODE_FORMAT`. Possible values:\n\n- `code`: just the code, no message, if you like it serious. Example: `[130]`\n- `message`: just show the message if available, good for being compact. Example: `[SIGINT]`\n- `both` *(default)*: show both the code and the message. Example: `[130/SIGINT]`\n\n### Path shorthands\n\nBy default, it shortens `$HOME` as `~`, but you can define your own custom shorthands with `BLAZESH_PATH_SHORTHANDS` in `path:shorthand` format. Just don't forget to add `$HOME:~` first\n\nFor example, `$HOME:~;/root:r~` would show paths as:\n\n- `$HOME/something`: `~/something`\n- `/root/something`: `r~/something`\n\n## Example configurations\n\n### Insanity\n\n*You have the freedom to make your command prompt look insane if you are*\n\n![Command prompt showing path of ~/mydir/another/one/so/many/dirs/im/insane/i/mean/imnot/im/just/showingwhat/aninsaneperson/woulddo in full and repeating ANSI rainbow](./media/insanity.jpg)\n\n```sh\nexport BLAZESH_ACCENT_COLOR='0 1 2 3 4 5 6 7'\nexport BLAZESH_PATH_DEPTH=255\n```\n\n### Random color every session\n\nYou can put this to your `.bashrc`/`.zshrc` or wherever you store your configs and get a new accent color every time you open the shell\n\n```sh\nansi_colors=(0 1 2 3 4 5 6 7)\nexport BLAZESH_ACCENT_COLOR=$(printf \"%s\\n\" \"${ansi_colors[@]}\" | shuf -n 1)\n```\n\nOr random RGB color:\n\n```sh\nexport BLAZESH_ACCENT_COLOR=\"$(printf '#%06X\\n' $((RANDOM * RANDOM % 16777216)))\"\n```\n\nOr random gradient:\n\n```sh\n# Generate 12 random hex cluster\nrandom_hex=$(xxd -p -l 6 /dev/urandom)\n\n# Split in two\ncolor1=\"#${random_hex:0:6}\"\ncolor2=\"#${random_hex:6:6}\"\n\nexport BLAZESH_ACCENT_COLOR=\"gradient $color1 $color2\"\n```\n\nAnd you can do that with so much more, like days of the week, hours, whatever you wish!\n\n## Problems\n\nThe most obvious one: **synchronous git**. Unfortunately I am not smart enough to figure out how to do that asynchronously, so... Well it's not *that* bad. Even on my 🥔 it runs fast enough to be usable daily. But I mean it's still better than nothing. Fish, for example, does it synchronously too, but with less features. At least here it can be disabled or customized\n\nNot so critical one, but also worth mentioning: **exit codes** don't show up in **Bash**. As far as I can tell, this issue cannot be fixed, it's just how Bash works\n\n## Fish shell\n\nYeah it also supports Fish, I don't know why I did this, but it was easy. I am too lazy to rewrite all the documentation, *if you count it as such*, to include Fish, since it is kind of different from other shells, just figure it out on your own. The file is `blazesh.fish`. Just source it in your `~/.config/fish/config.fish` or, again, wherever you store your configs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdsq%2Fblazesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdsq%2Fblazesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdsq%2Fblazesh/lists"}