gci
brew install gci
v0.14.0
BSD-3-Clause
Control Golang package import order and make it always deterministic
72
30-day installs · #3968
409
90-day · #3125
1.2k
365-day · #3547
560
★ GitHub stars · updated 5mo ago
Build dependencies
Links
- https://github.com/daixiang0/gci
- GitHub: daixiang0/gci
- Brew formula source: Formula/g/gci.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"go"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Control Golang package import order and make it always deterministic",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:37:55+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "gci",
"github_default_branch": "master",
"github_last_commit_at": "2026-03-16T05:09:49Z",
"github_readme_excerpt": "# GCI\n\nGCI, a tool that controls Go package import order and makes it always deterministic.\n\nThe desired output format is highly configurable and allows for more custom formatting than `goimport` does.\n\nGCI considers a import block based on AST as below:\n\n```\nDoc\nName Path Comment\n```\n\nAll comments will keep as they were, except the isolated comment blocks.\n\nThe isolated comment blocks like below:\n\n```\nimport (\n \"fmt\"\n // this line is isolated comment\n\n // those lines belong to one\n // isolated comment blocks\n\n \"github.com/daixiang0/gci\"\n)\n```\n\nGCI splits all import blocks into different sections, now support six section type:\n\n- standard: Go official imports, like \"fmt\"\n- custom: Custom section, use full and the longest match (match full string first, if multiple matches, use the longest one)\n- default: All rest import blocks\n- blank: Put blank imports together in a separate group\n- dot: Put dot imports together in a separate group\n- alias: Put alias imports together in a separate group\n- localmodule: Put imports from local packages in a separate group\n\nThe priority is standard \u003e default \u003e custom \u003e blank \u003e dot \u003e alias \u003e localmodule, all sections sort alphabetically inside.\nBy default, blank, dot, and alias sections are not used, and the corresponding lines end up in the other groups.\n\nAll import blocks use one TAB(`\\t`) as Indent.\n\nSince v0.9.0, GCI always puts C import block as the first.\n\n**Note**:\n\n`nolint` is hard to handle at section level, GCI will consider it as a single comment.\n\n### LocalModule\n\nLocal module detection is done by reading the module names from `go.mod` or `go.work` files\nin *the directory where `gci` is invoked*. This means:\n\n- This mode works when `gci` is invoked from a module or workspace root (i.e., a directory\n containing `go.mod` or `go.work`)\n- If neither exists, it returns an error\n\n## Installation\n\nTo download and install the highest available release version -\n\n```shell\ngo install github.com/daixiang0/gci@latest\n```\n\nYou may ",
"github_repo": "daixiang0/gci",
"github_stars": 560,
"github_topics": [],
"homepage": "https://github.com/daixiang0/gci",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 72,
"installs_365d": 1200,
"installs_90d": 409,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "BSD-3-Clause",
"llm_generated_at": null,
"llm_model": null,
"name": "gci",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 3968,
"rank_365d": 3547,
"rank_90d": 3125,
"raw_hash": "7182d9c8f7bd8c04",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/g/gci.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.14.0",
"versioned_formulae": [],
"why_use_this": null
}