{"id":13595693,"url":"https://github.com/gradle/gradle-completion","last_synced_at":"2025-05-16T05:06:17.717Z","repository":{"id":40329718,"uuid":"78602385","full_name":"gradle/gradle-completion","owner":"gradle","description":"Gradle tab completion for bash and zsh","archived":false,"fork":false,"pushed_at":"2024-04-08T08:40:14.000Z","size":473,"stargazers_count":1050,"open_issues_count":63,"forks_count":141,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-04-17T08:23:18.959Z","etag":null,"topics":["bash-completion","gradle","gradle-bt","gradle-bt-core-runtime","zsh-completion"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/gradle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-01-11T04:22:42.000Z","updated_at":"2025-04-15T07:00:02.000Z","dependencies_parsed_at":"2024-04-16T14:40:40.474Z","dependency_job_id":"7fc31dcc-dcce-40cd-872d-9f39e9076b4c","html_url":"https://github.com/gradle/gradle-completion","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fgradle-completion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fgradle-completion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fgradle-completion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fgradle-completion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gradle","download_url":"https://codeload.github.com/gradle/gradle-completion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"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":["bash-completion","gradle","gradle-bt","gradle-bt-core-runtime","zsh-completion"],"created_at":"2024-08-01T16:01:55.722Z","updated_at":"2025-05-16T05:06:17.669Z","avatar_url":"https://github.com/gradle.png","language":"Shell","funding_links":[],"categories":["Completions","Shell","Kotlin"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"readme":"# gradle-completion\nBash and Zsh completion support for [Gradle](https://gradle.org).\n\nThis provides _fast_ tab completion for:\n\n * Gradle tasks for the current project and sub-projects\n * Gradle CLI switches (e.g. `--parallel`)\n * Common Gradle properties (e.g. `-Dorg.gradle.debug`)\n\nIt also handles custom default build files, so `rootProject.buildFileName = 'build.gradle.kts'` is supported.\n\nSee instructions [for bash](https://github.com/gradle/gradle-completion/blob/master/README.md#installation-for-bash-32) or [for zsh](https://github.com/gradle/gradle-completion/blob/master/README.md#installation-for-zsh-50), then consider optional [additional configuration](https://github.com/gradle/gradle-completion/blob/master/README.md#additional-configuration).\n\nHere's a demo for the gradle project itself:\n![Completion demo](gradle-completion-4.0.gif)\n\n## Installation for Zsh 5.0+\n\n### Install via [Homebrew](https://brew.sh)\n\n```\nbrew install gradle-completion\n\n# Ensure /usr/local/share/zsh/site-functions is on $fpath. You should get a result from the following\necho $fpath | grep \"/usr/local/share/zsh/site-functions\"\n```\n\n### Install as [oh-my-zsh](https://ohmyz.sh/) plugin\n\nDownload and place the plugin and completion script into your oh-my-zsh plugins directory. \n```\ngit clone https://github.com/gradle/gradle-completion ~/.oh-my-zsh/plugins/gradle-completion\n```\n\nAdd `gradle-completion` to the plugins array in your '.zshrc' file.\n```\nplugins+=(gradle-completion)\n```\n\n### Install manually\n\nDownload and place `_gradle` on your `$fpath`. I recommend `$HOME/.zsh/gradle-completion`:\n```\ngit clone https://github.com/gradle/gradle-completion ~/.zsh/gradle-completion\n```\n\nAdd the following do your '.zshrc' file:\n```\necho \"\\nfpath=($HOME/.zsh/gradle-completion \\$fpath)\" \u003e\u003e ~/.zshrc\n```\n\nStart a new terminal session. You may need to disable the `gradle` plugin for `oh-my-zsh`.\n\n#### (Optional) Manual Completion Cache Initialization\nCompletion cache initialization happens the first time you invoke completion,\nand usually takes a few seconds, depending on the size of your project. You can\nmanually initialize the cache and avoid interrupting your development mojo by\nrunning:\n\n```bash\ncd path/to/your-project\nsource ~/.zsh/gradle-completion/_gradle 1\u003e\u00262 2\u003e/dev/null; __gradle-completion-init\n```\n\n## Installation for Bash 3.2+\n\n### Install via [Homebrew](https://brew.sh)\n\n```\nbrew install gradle-completion\n\n# Source completion scripts from bash-completion in your bash profile\necho '[[ -r \"/usr/local/etc/profile.d/bash_completion.sh\" ]] \u0026\u0026 . \"/usr/local/etc/profile.d/bash_completion.sh\"' \u003e\u003e ~/.bash_profile\n\n# Load changes to bash profile\nsource ~/.bash_profile\n```\n\n### Install manually\n\nDownload and place `gradle-completion.bash` in your `bash_completion.d` folder, usually `/etc/bash_completion.d`, `/usr/local/etc/bash_completion.d`, or `$HOME/bash_completion.d`:\n```\nmkdir $HOME/bash_completion.d\ncurl -LA gradle-completion https://edub.me/gradle-completion-bash -o $HOME/bash_completion.d/gradle-completion.bash\n```\n\nNOTE: Ensure `bash-completion` 1.2+ is installed using your favorite package manager or by following the [bash-completion installation instructions](https://github.com/scop/bash-completion/blob/master/README.md#installation).\n\nAdd the following to your `.bash_profile` (macOS) or `.bashrc` (Linux) file:\n```\nsource $HOME/bash_completion.d/gradle-completion.bash\n```\n\nStart a new terminal session.\n\n#### (Optional) Manual Completion Cache Initialization\nCompletion cache initialization happens the first time you invoke completion,\nand usually takes a few seconds, depending on the size of your project. You can\nmanually initialize the cache and avoid interrupting your development mojo by\nrunning:\n\n```bash\ncd path/to/your-project\n__gradle-completion-init\n```\n\n## Additional Configuration\n\n#### Excluding build scripts from UP-TO-DATE check\nTab completion checks known build scripts to see if they've been changed and refreshes the task cache if so.\nYou can exclude build scripts from this check (and speed up completion) by specifying:\n\n```bash\n# Default is `\"/(build|integTest|out)/\"`\nexport GRADLE_COMPLETION_EXCLUDE_PATTERN=\"/(build|integTest|samples|smokeTest|testFixtures|templates|out|features)/\"\n# Essentially turn off checking for changed scripts\nexport GRADLE_COMPLETION_EXCLUDE_PATTERN=\"gradle\"\n```\n\n#### Completion cache\nOne can manually (re)generate the completion cache by invoking `__gradle-completion-init` after the\ncompletion script has been sourced. This graciously avoids an unexpected cache build when invoking\ncompletion.\n\nThe build script cache is invalidated if any *.gradle or *.gradle.kts files change.\nHowever, these completion scripts do not search for new build scripts every time completion is invoked, because\nthat would make completion ~20x slower (unless you have so really good ideas on this).\n\nBy default, the build script cache is invalidated every 3 weeks (30240 minutes).\nYou can configure this value by exporting a new value for `$GRADLE_CACHE_TTL_MINUTES`:\n```bash\nexport GRADLE_CACHE_TTL_MINUTES=$(expr 1440 \\* number_of_days_you_want)\n```\n\n#### Implicit Tasks\nGradle allows you to access tasks of subprojects from the project root implicitly.\nFor example, given these tasks:\n```\n:foo\n:help\n:bar:baz\n```\n\nYou can execute `gradle baz` from the project root and it will execute `:bar:baz`.\n\ngradle-completion will not tab complete these tasks by default because it adds a\nsignificant number of completion options, which may not be what you want and\nnegatively impacts completion speed.\n\nTo allow completion of implicit tasks, set `$GRADLE_COMPLETION_UNQUALIFIED_TASKS=true`:\n\n```bash\nexport GRADLE_COMPLETION_UNQUALIFIED_TASKS=\"true\"\n```\n\nYou may need to invalidate the cache using the cache config above or by executing `touch build.gradle`.\n\n## Troubleshooting\nIf zsh completion isn't working, first try checking your `$fpath` with `echo $fpath`.\n\nzsh completion using `./gradlew` may not work on Linux if you don't have `.` on your `$PATH`,\nso I recommend adding it in your `~/.zshrc` file:\n```bash\nexport PATH=\".:$PATH\"\n```\n\n\u003e HEADS UP: If you get an error 'parse error near `]]\"', please [upgrade zsh](http://stackoverflow.com/questions/17648621/how-do-i-update-zsh-to-the-latest-version).\nzsh 5.0.5 has a bug in script parsing that is fixed as of zsh 5.0.8. See issues #4 and #7 for more details.\n\nIf zsh completion reports \"Generating Gradle task cache...\" every time, the zsh completion cache\nmay be disabled. Enable it by adding the following to your `~/.zshrc` file:\n```bash\nzstyle ':completion:*' use-cache on\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md).\n\n## Acknowledgements\nBash completion is inspired by [Nolan Lawson's Gradle tab completion for bash](https://gist.github.com/nolanlawson/8694399).\n\nZsh completion is an improved version of [zsh](https://github.com/zsh-users/zsh)'s built-in Gradle completion.\n\nCurrent improvements over built-in support:\n - Subproject tasks are completed\n - Gradle CLI options are current as of Gradle 6.4\n - Common Gradle properties are completed\n - Handles default build file as specified in settings.gradle\n - ~20x faster completion speed for medium to large projects\n - Completion cache updates in the background after first invocation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradle%2Fgradle-completion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgradle%2Fgradle-completion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradle%2Fgradle-completion/lists"}