{"id":16259580,"url":"https://github.com/tahul/vscode-commit-prompt","last_synced_at":"2025-03-19T22:30:32.035Z","repository":{"id":97473383,"uuid":"325037350","full_name":"Tahul/vscode-commit-prompt","owner":"Tahul","description":"⛏ Commit faster and cleaner with keybound formatted commit prompt for VS Code","archived":false,"fork":false,"pushed_at":"2024-02-15T19:48:40.000Z","size":26993,"stargazers_count":17,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-19T04:27:02.575Z","etag":null,"topics":["commit","prompt","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=yaelguilloux.vscode-commit-prompt","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/Tahul.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}},"created_at":"2020-12-28T14:43:30.000Z","updated_at":"2024-09-24T07:45:22.000Z","dependencies_parsed_at":"2024-02-15T20:44:56.023Z","dependency_job_id":null,"html_url":"https://github.com/Tahul/vscode-commit-prompt","commit_stats":{"total_commits":161,"total_committers":2,"mean_commits":80.5,"dds":0.006211180124223614,"last_synced_commit":"849a24a992f6f5c1ecc8f4b250f3bd1acd6eb3db"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tahul%2Fvscode-commit-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tahul%2Fvscode-commit-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tahul%2Fvscode-commit-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tahul%2Fvscode-commit-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tahul","download_url":"https://codeload.github.com/Tahul/vscode-commit-prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244515585,"owners_count":20464915,"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":["commit","prompt","vscode-extension"],"created_at":"2024-10-10T16:03:44.202Z","updated_at":"2025-03-19T22:30:30.593Z","avatar_url":"https://github.com/Tahul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛏ vscode-commit-prompt\n\n![VS Marketplace Badge](./docs/vscode-commit-prompt.png)\n\nCommit and manage issues **faster** and **cleaner** with keyboard **prompts** for VS Code.\n\n- 🕹️ Add \u0026 commit multiple files without using your mouse once.\n- 💄 Improve your git history with two strong default presets.\n- 👥 Specify your own questions, types, and scopes and share them with your team.\n- ✅ Minimalist approach to GitHub issues management from VS Code quick prompts.\n\n## ⌨️ Actions\n\n### Committing\n\n![Demo](./docs/commit.gif)\n\nAll actions that relate to committing code (add, push, commit, undo) revolve around `Cmd+Y` by default.\n\n- `cmd+y` =\u003e commit\n- `shift+cmd+y` =\u003e push\n- `alt+cmd+y` =\u003e undo\n- `shift+alt+cmd+y` =\u003e add\n\n#### Commit\n\nOpens the `Commit` prompt.\n\nPrompts for `Add` beforehand if you enabled [`addBeforeCommit`](#-vscode-settings).\n\nPrompt for resolvable closable GitHub issues if you enabled [`githubToken`](#-vscode-settings).\n\nPush after your commit if you enabled [`pushAfterCommit`](#-vscode-settings).\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.commit\",\n    \"key\": \"ctrl+y\",\n    \"mac\": \"cmd+y\"\n  }\n  ```\n\n#### Fast commit **(new ✨)**\n\nOpens the `Commit` prompt for the current file and skips `body`, `issues` and any other extraneous steps.\n\nThis command is made to speed single-file commits.\n\nIt will resolve a default for the `subject` field using the file name.\n\n\u003e It has no default keybinding, I use `Cmd+Shift+S` myself, to mimick a _remote-save_ feature.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.fast\",\n    \"key\": \"\",\n    \"mac\": \"\"\n  }\n  ```\n\n#### Add\n\nOpens the `Add` prompt.\n\nShow changes from the current working tree and allow you to add them individually.\n\nAllows to add `all` (`git add ${workspaceRoot}`) with the first prompt item.\n\nWill `rm` unchecked files from the staged files.\n\nWill be prompted in `Commit` flow with [`addBeforeCommit`](#-vscode-settings), you usually won't need this keybinding.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.add\",\n    \"key\": \"shift+alt+ctrl+y\",\n    \"mac\": \"shift+alt+cmd+y\"\n  }\n  ```\n\n#### Push\n\nOpens the `Push` prompt.\n\nShows the list of commits that will be pushed.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.push\",\n    \"key\": \"shift+ctrl+y\",\n    \"mac\": \"shift+cmd+y\"\n  }\n  ```\n\n#### Undo\n\nOpen the `Undo` prompt.\n\nAllows to undo the last commit and keep the changes (`git reset --soft HEAD^`).\n\nAllows to discard the changes (`git reset --hard HEAD^`).\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.undo\",\n    \"key\": \"alt+ctrl+y\",\n    \"mac\": \"alt+cmd+y\" // Alt is Option on Mac 😉\n  }\n  ```\n\n### Issues\n\n![Demo](./docs/issue.gif)\n\nAll actions that relate to GitHub issues revolve around `Cmd+U` by default.\n\nAny action related to GitHub issues will need you to provide `githubToken`.\n\nIf you do not provide it or the extension fails to gather your issues, it will silently fail, and let you keep using the commit features.\n\n- `cmd+u` =\u003e open\n- `shift+cmd+u` =\u003e close\n- `alt+cmd+u` =\u003e assign\n- `shift+alt+cmd+u` =\u003e unassign\n\n#### Open\n\nOpen issues on GitHub.\n\nAllows to create a new minimal issue with a similar shape as a commit.\n\nLists open issues on GitHub and orders between assigned and unassigned issues.\n\nYou can toggle if new issues get auto-assigned to you using [`autoAssignOpenedIssues`](#-vscode-settings).\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.open\",\n    \"key\": \"ctrl+u\",\n    \"mac\": \"cmd+u\"\n  }\n  ```\n\n#### Close\n\nClose open issues from GitHub.\n\nLists open issues on GitHub and orders between assigned and unassigned issues.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.close\",\n    \"key\": \"shift+ctrl+u\",\n    \"mac\": \"shimft+cmd+u\"\n  }\n  ```\n\n#### Assign\n\nSelf-assign open issues from GitHub.\n\nLists open issues that are not assigned to you.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.assign\",\n    \"key\": \"alt+ctrl+u\",\n    \"mac\": \"alt+cmd+u\"\n  }\n  ```\n\n#### Unassign\n\nSelf-unassign open issues from GitHub.\n\nLists open issues that are assigned to you.\n\n- Default:\n  ```json\n  {\n    \"command\": \"vscode-commit-prompt.unassign\",\n    \"key\": \"shift+alt+ctrl+u\",\n    \"mac\": \"shift+alt+cmd+u\"\n  }\n  ```\n\n## ⚙️ Config\n\nThere are two ways to handle the configuration of this extension.\n\nThe first is to use the configuration parameters from VSCode, you will find all the available settings under `commit-prompt` keys.\n\nThe second is to use config files from the current repository you are working with.\n\nThe per-repository config can be specified from 3 places:\n\n- `.cprc` file placed at root.\n- `.cp.json` file placed at root.\n- \"config\" key in `package.json`.\n\nThe format must be the following:\n\n```json\n{\n  \"config\": {\n    \"commit-prompt\": {}\n  }\n}\n```\n\n\u003e If you are willing to share settings like `scopes` with your team, I recommend you use the package.json config key or `.vscode/settings.json`.\n\n### 👤 VSCode settings\n\n```json\n{\n  \"configuration\": {\n    \"properties\": {\n      \"commit-prompt.addAllByDefault\": {\n        \"default\": false,\n        \"description\": \"Ticks by default `Add all` when opening a new `git add` prompt.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.addBeforeCommit\": {\n        \"default\": true,\n        \"description\": \"Always show git add prompt before writing your commit.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.autoAssignOpenedIssues\": {\n        \"default\": true,\n        \"description\": \"Automatically assign yourself to any opened issues.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.commitQuestions\": {\n        \"default\": [],\n        \"description\": \"Overwrites commits questions from other configuration sources and presets.\",\n        \"type\": \"array\"\n      },\n      \"commit-prompt.githubPerPage\": {\n        \"default\": 25,\n        \"description\": \"The amount of issues to fetch per page. The smaller the faster your prompts will feel.\",\n        \"type\": \"number\"\n      },\n      \"commit-prompt.githubToken\": {\n        \"description\": \"Needed to query the GitHub API to manage issues.\",\n        \"type\": \"string\"\n      },\n      \"commit-prompt.issuesQuestions\": {\n        \"default\": [],\n        \"description\": \"Overwrites issues questions from other configuration sources and presets.\",\n        \"type\": \"array\"\n      },\n      \"commit-prompt.preset\": {\n        \"default\": \"conventional-commits\",\n        \"description\": \"Select between the two default presets if you don't override from repository config.\",\n        \"enum\": [\"conventional-commits\", \"cz-emoji\"],\n        \"type\": \"string\"\n      },\n      \"commit-prompt.pushAfterCommit\": {\n        \"default\": false,\n        \"description\": \"Always push after a commit.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.scopes\": {\n        \"default\": [],\n        \"description\": \"Overwrites scopes from other configuration sources and presets.\",\n        \"type\": \"array\"\n      },\n      \"commit-prompt.showOutputChannel\": {\n        \"default\": \"status\",\n        \"description\": \"The extension preferred output channel after commit.\",\n        \"enum\": [\"status\", \"popup\", \"none\"],\n        \"type\": \"string\"\n      },\n      \"commit-prompt.skipCommitBody\": {\n        \"default\": false,\n        \"description\": \"Skips the long description step of the default commit prompt.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.skipCommitIssues\": {\n        \"default\": false,\n        \"description\": \"Skips the issues step of the default commit prompt.\",\n        \"type\": \"boolean\"\n      },\n      \"commit-prompt.subjectLength\": {\n        \"default\": 75,\n        \"description\": \"Override the allowed commit message subject length.\",\n        \"type\": \"number\"\n      },\n      \"commit-prompt.types\": {\n        \"default\": [],\n        \"description\": \"Overwrites types from other configuration sources and presets.\",\n        \"type\": \"array\"\n      }\n    }\n  }\n}\n```\n\n### 👥 Per repository config\n\nPer repository config exposes three parameters: `scopes`, `types`, and `questions`.\n\n#### _scopes_ (optional)\n\nScopes is a text input by default, allowing you to define a custom scope on each commit.\n\nIf you want to lock scopes and specify a list, you can by using the `scopes` attribute from config.\n\nSpecify a list of scopes, and you will be prompted to choose between them on each commit.\n\n```typescript\nconst scopes: CommitPromptScopeType;\n\nexport interface CommitPromptScopeType {\n  name: string;\n  description: string;\n}\n```\n\n```json\n{\n  \"config\": {\n    \"commit-prompt\": {\n      \"scopes\": [\n        {\n          \"name\": \"the-next-big-feature\",\n          \"description\": \"Use this scope when working on our next big feature\"\n        }\n      ]\n    }\n  }\n}\n```\n\n#### _types_ (optional)\n\nIf you specify this key in config, the default types will be overwritten by yours completely.\n\nDefault can be found in [defaultTypes.ts](https://github.com/Tahul/vscode-commit-prompt/blob/main/src/helpers/defaultTypes.ts), copy/pasting them can be a great starting point for your config.\n\n```typescript\nconst types: CommitPromptType[];\n\ninterface CommitPromptType {\n  emoji?: string; // The emoji displayed (optional)\n  code: string; // The value added to the commit message (gitmojis works)\n  description: string; // The description displayed in the prompt\n  name: string; // An id\n}\n```\n\n```json\n{\n  \"config\": {\n    \"commit-prompt\": {\n      \"types\": [\n        {\n          \"emoji\": \"💄\",\n          \"code\": \":lipstick:\",\n          \"description\": \"Updating the UI.\",\n          \"name\": \"ui\"\n        }\n      ]\n    }\n  }\n}\n```\n\n#### _questions_ (optional)\n\nSpecifying `questions` key will result in overwriting the complete default scenario.\n\nThis means you can easily build your own scenario from the config file.\n\nNote that using this key will result in both types and scopes keys being useless, as you will have to specify these keys directly from your question's payloads.\n\n```typescript\nconst questions: Question[];\n\nexport interface Question {\n  name: string;\n  type: \"oneOf\" | \"input\";\n  placeHolder: string;\n  prompts?: CommitPromptType[];\n  scopes?: CommitPromptScopeType[];\n  format?: string;\n}\n```\n\n```json\n{\n  \"config\": {\n    \"commit-prompt\": {\n      \"questions\": [\n        {\n          \"name\": \"type\",\n          \"placeHolder\": \"Select the type of change you are committing (type)\",\n          \"type\": \"oneOf\",\n          \"prompts\": [\n            {\n              \"emoji\": \"💄\",\n              \"code\": \":lipstick:\",\n              \"description\": \"Updating the UI.\",\n              \"name\": \"ui\"\n            }\n          ],\n          \"format\": \"({value})\"\n        }\n      ]\n    }\n  }\n}\n```\n\nYou can take a look at the [default commit questions](./src/helpers/defaultCommitQuestions.ts) for further customization.\n\n## ⁉️ Why?\n\n[I](https://github.com/Tahul) would like to improve my *commit* / *issues* flow that currently is the source of friction to my code sessions.\n\nSwitching between my _issues tracker_, my _code editor_ and the _Git CLI_ is the flow that takes most of my time outside of coding.\n\nAlso, I'm used to sending giant commits and that causes me pain every time I review my git history.\n\nThis aims to be a minimal, fast, and efficient way to improve my workflow and reduce friction. Maybe it could be yours too?\n\n## ⛏️ Contribute\n\nIf you want to contribute to the repository, you can clone the repo and run the app in extension mode by doing:\n\n```\ngit clone https://github.com/Tahul/vscode-commit-prompt.git \u0026\u0026 \\\ncd vscode-commit-promp \u0026\u0026 \\\npnpm install \u0026\u0026 \\\npnpm run dev\n```\n\nOnce you have run `pnpm run dev`, you can the open the [`Run and Debug`](https://code.visualstudio.com/docs/editor/debugging#:~:text=To%20bring%20up%20the%20Run,debugging%20commands%20and%20configuration%20settings.) tab of VSCode and launch `Run Extension`.\n\nThat will open a new VSCode Extension Host tab with the fully working extension, attached to the debugging terminal.\n\n## 👨‍💻 Credits\n\nThis VSCode app has been written by [Yaël GUILLOUX](https://twitter.com/yaeeelglx).\n\nThis has been heavily inspired by [cz-emoji](https://github.com/ngryman/cz-emoji) by [ngryman](https://github.com/ngryman).\n\nIf you have any questions concerning this app, don't hesitate to reach me, on [Twitter](https://twitter.com/yaeeelglx) or by [email](mailto:yael.guilloux@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahul%2Fvscode-commit-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftahul%2Fvscode-commit-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahul%2Fvscode-commit-prompt/lists"}