{"id":15736476,"url":"https://github.com/ajcrites/gilt","last_synced_at":"2026-04-27T23:33:43.707Z","repository":{"id":57266378,"uuid":"118699275","full_name":"ajcrites/gilt","owner":"ajcrites","description":":computer: Command Line tool for easy git navigation","archived":false,"fork":false,"pushed_at":"2019-04-30T01:18:09.000Z","size":1804,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-18T08:14:43.989Z","etag":null,"topics":["cli","git"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ajcrites.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}},"created_at":"2018-01-24T02:22:29.000Z","updated_at":"2019-04-30T01:18:04.000Z","dependencies_parsed_at":"2022-08-25T03:40:59.824Z","dependency_job_id":null,"html_url":"https://github.com/ajcrites/gilt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ajcrites/gilt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajcrites%2Fgilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajcrites%2Fgilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajcrites%2Fgilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajcrites%2Fgilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajcrites","download_url":"https://codeload.github.com/ajcrites/gilt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajcrites%2Fgilt/sbom","scorecard":{"id":174318,"data":{"date":"2025-08-11","repo":{"name":"github.com/ajcrites/gilt","commit":"14be65dc32733078df6f8ad97df9d1833ba245a1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"78 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-3f95-r44v-8mrg","Warn: Project is vulnerable to: GHSA-28xr-mwxg-3qc8","Warn: Project is vulnerable to: GHSA-9p95-fxvg-qgq2","Warn: Project is vulnerable to: GHSA-9w5j-4mwv-2wj8","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T17:20:23.977Z","repository_id":57266378,"created_at":"2025-08-16T17:20:23.977Z","updated_at":"2025-08-16T17:20:23.977Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32360110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cli","git"],"created_at":"2024-10-04T01:40:29.049Z","updated_at":"2026-04-27T23:33:43.684Z","avatar_url":"https://github.com/ajcrites.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gilt (pre alpha)\n`gilt` is an interactive command line UI for working with `git`.\n\n[![build status](https://travis-ci.org/ajcrites/gilt.svg?branch=master)](https://travis-ci.org/ajcrites/gilt)\n[![coverage](https://img.shields.io/codecov/c/github/ajcrites/gilt.svg)](https://codecov.io/github/ajcrites/gilt)\n[![version](https://img.shields.io/npm/v/gilt.svg)](https://www.npmjs.com/package/gilt)\n[![license](https://img.shields.io/npm/l/gilt.svg)](https://github.com/ajcrites/gilt/blob/master/LICENSE)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n\n![gilt](https://raw.githubusercontent.com/ajcrites/gilt/master/assets/gilt-1.gif)\n\nI generally work in the terminal and use `git` on the command line. This does\nmost of what I need it to do, but I always felt a little guilty watching some\nof my peers use cool `git` GUIs and be able to do some nice things like view\ndiffs or checkout commits with a single click whereas I would have to copy some\noutput into new commands to do this as an extra step.\n\nI haven't found an equivalent command line interactive git tool that has all\nthe functionality I wanted, so I decided to create one. I bring you `gilt`,\nbuilt using [blessed](https://www.npmjs.com/package/blessed).\n\nDon't feel _guilty_ about using the command line for version control!\nFeel `gilt`y.\n\n## Purpose\n`gilt` was created as a command line alternative for interactive git GUIs. It\nattempts to simplify navigating and working with git in common ways while not\nlosing any git command line functionality or flexibility at all.\n\nEssentially what `gilt` does is run your intended git command, parse its\noutput, and lay over an interactive TUI (terminal user interface).\n\n`gilt` is _not_ currently intended to a full wrapper for `git` and passes\ncommands through as a convenience. Please continue to use `git` as your command\nfor your normal workflows and use `gilt` when you want its special\nfunctionality.\n\n## Usage\n```\ngilt [git-command]\n```\n\nFor example, use `gilt log --pretty=oneline` or `gilt status -s`.\n\nSee below for a list of available gilt commands.\n\nMost commands allow scrolling through selected blocks (commit hashes, files,\netc.) using \u003ckbd\u003ej\u003c/kbd\u003e/\u003ckbd\u003edown\u003c/kbd\u003e and \u003ckbd\u003ek\u003c/kbd\u003e/\u003ckbd\u003eup\u003c/kbd\u003e.\nDefault interaction is done through \u003ckbd\u003eEnter\u003c/kbd\u003e.\n\nYou may quit `gilt` at any time using any of \u003ckbd\u003eq\u003c/kbd\u003e \u003ckbd\u003eEsc\u003c/kbd\u003e, or\n\u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003ec\u003c/kbd\u003e.\n\n## Installation\nYou will need Node.js to run gilt. _It's only been tested on 9.4 at this point,\nbut it should work with most newer versions_.\n\n```\nyarn global add gilt\n```\n\n...or equivalent should be all you need to get going.\n\n### Copying to Clipboard\n\nIf you are using OS X, you'll have to install `reattach-to-user-namespace`\nwhich you can do with homebrew.\n\nThis is currently not supported on other OSen.\n\n## Available Commands\n`gilt` is in active development and new commands may be added or the\nfunctionality of existing commands may be changed or removed. If gilt is not\nable to parse the output of a command, it will simply attempt to pass it\nthrough to the user.\n\nCurrently, `gilt` does not page output of passed through commands. This means\nthat if you want to use your built-in git pager, you're better off just using\n`git unsupported-command` rather than using `gilt`.\n\n`gilt` also attempts to guess the base git command that is being used by\ngit aliases. For example, if you have `[alias] lg = log --color --graph\n--abbrev-commit`, `gilt lg` will be able to determine that this is the output of a\n`git log` command and parse and treat it as such so it should work similar to\nif you had just used `git log` or the same as `git log --color --graph\n--abrev-commit`.\n\n_*Note:* due to the complexity and variability of git aliases, the intended\ncommand may not be properly determined by `gilt`. In this case, it will just\npass the output through_.\n\n### `log`\n`gilt log` will parse output to find commit hashes and allow you to scroll\nthrough these hashes and interact with them using the following key commands:\n\n* \u003ckbd\u003ej\u003c/kbd\u003e, \u003ckbd\u003edown\u003c/kbd\u003e - select next hash.\n* \u003ckbd\u003ek\u003c/kbd\u003e, \u003ckbd\u003eup\u003c/kbd\u003e - select previous hash.\n* \u003ckbd\u003eu\u003c/kbd\u003e, \u003ckbd\u003ePage Up\u003c/kbd\u003e - move up 5 hashes\n* \u003ckbd\u003ed\u003c/kbd\u003e, \u003ckbd\u003ePage Down\u003c/kbd\u003e - move down 5 hashes\n* \u003ckbd\u003eenter\u003c/kbd\u003e, \u003ckbd\u003ef\u003c/kbd\u003e - view diff of selected hash.\n  * specifically, this runs `git -c core.pager='less -+F' show -w \u003ccommit\u003e`.\n* \u003ckbd\u003ec\u003c/kbd\u003e - checkout the selected hash.\n* \u003ckbd\u003er\u003c/kbd\u003e - perform an interactive rebase from this commit.\n* \u003ckbd\u003ey\u003c/kbd\u003e - copy the selected hash to the clipboard.\n\n### `status`\n`gilt status` will parse output to find filenames and allow you to scroll\nthrough these files and interact with them using the following key commands:\n\n* \u003ckbd\u003ej\u003c/kbd\u003e, \u003ckbd\u003edown\u003c/kbd\u003e - select next file.\n* \u003ckbd\u003ek\u003c/kbd\u003e, \u003ckbd\u003eup\u003c/kbd\u003e - select previous file.\n* \u003ckbd\u003eu\u003c/kbd\u003e, \u003ckbd\u003ePage Up\u003c/kbd\u003e - move up 5 files\n* \u003ckbd\u003ed\u003c/kbd\u003e, \u003ckbd\u003ePage Down\u003c/kbd\u003e - move down 5 files\n* \u003ckbd\u003eenter\u003c/kbd\u003e, \u003ckbd\u003ee\u003c/kbd\u003e - runs `$EDITOR \u003cselected-file\u003e`.\n* \u003ckbd\u003ef\u003c/kbd\u003e - view diff of the current file\n  * specifically, this runs `git -c core.pager='less -+F' diff -w \u003cfile\u003e`.\n* \u003ckbd\u003ex\u003c/kbd\u003e - remove the selected file (you are prompted for y/n first).\n* \u003ckbd\u003ey\u003c/kbd\u003e - copy the selected filename to the clipboard.\n\n*Note:* You must set your `$EDITOR` environment variable to use the editor\nfunctionality.\n\n*Note:* Due to the wide variety of ways that `git status` can be used to\nformat output as well as the seemingly infinite number of ways filenames can\nbe specified, it's very easy for `gilt` to recieve some false positives or\nmiss some actual filenames in the output. It should do a decent job of getting\nfilenames for `gilt status` or `gilt status -s`.\n\n## Known Issues\n* Pass through commands are not paged.\n* The mouse doesn't interact with `gilt` command output at all.\n* The user's pager is not used for git output from within gilt. Instead,\n `less -+F` is used because if the output were less than one page the process\n would exit immediately and return to `gilt` without displaying anything.\n* Copying to clipboard requires `reattach-to-user-namespace` on OS X and is not\n supported on any other OS.\n\n## Upcoming Additions\n\n* [ ] Search + highlight and select functionality\n  * [ ] for `log`\n  * [ ] for `status`\n* [ ] Add parsing of sub-blocks such as authors, branch names, and more.\n  * [ ] for `log`\n  * [ ] for `status`\n* [ ] Add ability to select more than one block\n  * [ ] toggle\n  * [ ] shift\n* [ ] Add more commands\n* [x] Automated testing of some kind\n* [ ] Mouse interactions\n* [ ] Page pass through output\n* [ ] Retain original `git` output\n* [ ] Use user defined pager for `diff` of `git log`.\n* [ ] Add API docs\n* [ ] Create a website\n\n## Development\nTo get set up for development, simply clone the repo and `yarn install` and\nyou should be good to go.\n\n`yarn prepublishOnly` will create the output command in `lib/index.js` which you\ncan run as an executable.\n\nI recommend running `yarn link` to link the repository for local development\nwhich should allow you use `gilt` on the command line. Then run `npx tsc-watch`\nand any changes you make to the source should update `gilt`.\n\n### Adding Custom Parsers\nIf you're not satisfied with an existing parser or you want to add a new parser\nfor yourself, you can write your own command using gilt.\n\nGilt offers a bit of flexibility in terms of how you set up handling for\ncommands. You can use the built in `gilt` API to determine what command the\nuser is trying, run the command, and use the built-in gilt functionality.\n\nFor example, you may want to parse the output of a git subcommand and you may\nwant to set up navigation and key/mouse bindings for a subcommand or both.\n\n```node\n#!/usr/bin/env node\n// better-gilt\n\n// implement parser for git lg\n\nimport { parseArgs, run } from 'gilt';\nimport { Gilt } from 'gilt/Gilt';\n\nimport { betterParser, BetterCommand } from './better-gilt';\n\n// Get the git subcommand the user is trying to run\nconst fullCommand = parseArgs();\n// The git subcommand itself, e.g. `'log'`, `'status'`\nconst gitCommand = fullCommand[0];\n\nclass BetterGilt extends Gilt {\n    run(fullCommand) {\n        // Sets up blessed / command line interface\n        this.start(fullCommand);\n\n        // Set the content for the command line interface.\n        // The imaginary `betterParser` parses the output to create Blocks\n        this.navigator.setContent(this.content, betterParser(this.content));\n\n        // BetterCommand extends Command and implements the `run` method which\n        // sets up key bindings and other interface functionality\n        const command = new BetterCommand(this.program, this.navigator);\n        command.run();\n    }\n}\n\nconst betterGilt = new BetterGilt;\n\nif ('lg' === gitCommand) {\n    betterGilt.run();\n} else {\n    // Fall back to the default gilt functionality for all other commands\n    run();\n}\n```\n\nYou must run the `Navigator.setContent` method with parameters of the content to\ndisplay and an array of \"data blocks\" which are representations of the key list\nelements of the output of the command -- for example, commit hashes and\nfilenames. See [`Block`](./src/command/Block.ts) for the interface.  A block has\na `block` property which is a string of the acutual element (the hash or\nfilename) and an `offset` which is its position in output used by navigation.\n\nYou can make the `content` and `blocks` anything you want, but these are\nusually the output of the git subcommand and the blocks representing the\nnavigation elements of that content.\n\nYou can also extend [`Command`](./src/command/Command.ts) to create a command\nthat sets up key bindings and interacts with the display. You must inject a\n[`Program`](./src/command/Program.ts) and [`Navigator`](./src/command/Navigator.ts)\ninto the constructor of your command. This will give you access to blessed\noperators on the program/navigator allowing you to set up key bindings, etc.\nwhile using the program and navigator APIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajcrites%2Fgilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajcrites%2Fgilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajcrites%2Fgilt/lists"}