{"id":13508945,"url":"https://github.com/erlef/rebar3_hex","last_synced_at":"2025-05-15T01:09:21.905Z","repository":{"id":30275694,"uuid":"33827181","full_name":"erlef/rebar3_hex","owner":"erlef","description":"Rebar3 Hex library","archived":false,"fork":false,"pushed_at":"2025-04-29T02:23:39.000Z","size":884,"stargazers_count":101,"open_issues_count":24,"forks_count":50,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-13T15:11:55.674Z","etag":null,"topics":["rebar3-plugin"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erlef.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},"funding":{"custom":["https://members.erlef.org/join-us","https://erlef.org/sponsors#become-a-sponsor"]}},"created_at":"2015-04-12T17:53:53.000Z","updated_at":"2025-04-28T16:04:22.000Z","dependencies_parsed_at":"2024-01-26T05:06:58.075Z","dependency_job_id":"44ee00e8-2530-453f-b6f1-1239d95ec6a6","html_url":"https://github.com/erlef/rebar3_hex","commit_stats":{"total_commits":313,"total_committers":36,"mean_commits":8.694444444444445,"dds":0.5750798722044728,"last_synced_commit":"db96cbbf4a6f3ac7ceaddd44607a9dad1a9a22ef"},"previous_names":["tsloughter/rebar3_hex","hexpm/rebar3_hex"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Frebar3_hex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Frebar3_hex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Frebar3_hex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlef%2Frebar3_hex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erlef","download_url":"https://codeload.github.com/erlef/rebar3_hex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254045326,"owners_count":22005342,"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":["rebar3-plugin"],"created_at":"2024-08-01T02:01:00.793Z","updated_at":"2025-05-15T01:09:16.896Z","avatar_url":"https://github.com/erlef.png","language":"Erlang","funding_links":["https://members.erlef.org/join-us","https://erlef.org/sponsors#become-a-sponsor"],"categories":["Package Management"],"sub_categories":[],"readme":"# rebar3_hex\n\n[![Build Status](https://github.com/erlef/rebar3_hex/actions/workflows/ci.yml/badge.svg)](https://github.com/erlef/rebar3_hex/actions/workflows/ci.yml)\n[![Hex pm](https://img.shields.io/hexpm/v/rebar3_hex.svg)](https://hex.pm/packages/rebar3_hex)\n[![Docs](https://img.shields.io/badge/hex-docs-green.svg?style=flat)](https://hexdocs.pm/rebar3_hex)\n[![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-25.0%20to%2027.0-blue)](http://www.erlang.org)\n\nrebar3_hex is a plugin for [Rebar3](https://www.rebar3.org/) that bundles providers to interact with [Hex](https://hex.pm/).\n\n\u003e 💡 **rebar3_hex is a tool for package authors**\n\u003e If your Erlang project is not meant to be published on Hex, Rebar3 itself should be enough for you.\n\n## Setup\n\nAdd to your global rebar3 config in `~/.config/rebar3/rebar.config`:\n\n```erlang\n{plugins, [rebar3_hex]}.\n```\n\nAlternatively, you can add to your project's rebar3 config in project plugins :\n\n```erlang\n{project_plugins, [rebar3_hex]}.\n```\n\n**NOTE** : Be sure **not** to add `rebar3_hex` to the plugins section within a projects rebar3 config as this will\nbecome a dependency for others downloading your package from hex.pm\n\n### Documentation\n\nrebar3_hex by default expects you to configure a documentation provider. We recommend using\n[rebar3_ex_doc](https://hexdocs.pm/rebar3_ex_doc/) for publishing documentation along with your package for a\nconsistent format and style on [hex.pm](https://hex.pm/).\n\nExample :\n\n```erlang\n\n{ex_doc, [\n    {extras, [\"README.md\", \"LICENSE\"]},\n    {main, \"README.md\"},\n    {source_url, \"https://github.com/namespace/your_app\"}\n]}.\n\n{hex, [{doc, ex_doc}]}.\n```\n\nAlternatively, or on Erlang versions older than OTP-24, you can use the edoc provider that ships with rebar3 :\n\n```erlang\n{hex, [{doc, edoc}]}.\n```\n\n## Basic usage\n\nYou should read the [docs](https://hexdocs.pm/rebar3_hex/) for a complete over for each provider, but below is a\nbrief overview of basic usage.\n\n### Authenticating User\n\nIf you already have a user for [hex.pm](https://hex.pm) run:\n\n\n```shell\n$ rebar3 hex user auth\n```\n\nNote that this will ask for your hex.pm username and password, as well as a password for encrypting your api token that\nhas write permissions to the repository. When publishing a package you will have to give this password to decrypt the\ntoken in order to publish.\n\nSee the [docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_user.html) for more information.\n\n### Building\n\nThe `build` provider is very useful for seeing exactly what would be published using either the `publish` or `cut` task\nwithout any chance of actually publishing the package or docs. Tarballs for the package and docs are written to\n`_build/\u003cprofile\u003e/lib/your_app/hex/` by default.\n\n\n```\n$ rebar3 hex build\n```\n\nSee the [docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_build.html) for more information.\n\n### Publishing\n\nTwo providers are available for publishing packages, `publish` and `cut`\n\nBy default `publish` builds and pushes your package and docs to a repository. See the\n[docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_publish.html) for more information.\n\n``` shell\n$ rebar3 hex publish\n```\n\n`cut` is available to provide some additional functionality around versioning and git tags. See the\n[docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_cut.html) for more information.\n\n``` shell\n$ rebar3 hex cut\n```\n\nIn either case, both providers will display the details of what is being published\n(what files, the version, dependencies) and ask if it should continue, so be sure to read the\noutput carefully and make sure it is publishing what you expected.\n\n### Managing package owners\n\nOwners can be added, removed, and listed for packages you are an owner of with the `hex owner` command. Packages\ncan also be transfered to other registered users on hexpm as well.\n\n``` shell\n$ rebar3 hex owner [add | remove | list | transfer] \u003cpackage\u003e \u003cemail\u003e\n```\n\nSee the [docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_owner.html) for more information.\n\n### Retiring packages\n\nPackages can be flagged as retired on hexpm via the `retire` provider :\n\n```\n$ rebar3 hex retire PACKAGE VERSION REASON --message\n```\n\nThey can also be unretired in case a mistake was made :\n\n```\n$ rebar3 hex retire PACKAGE VERSION --unretire\n```\n\nSee the [docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_retire.html) for more information.\n\n### Organizations\n\nrebar3_hex supports working with organizations via the `organization` provider.\n\nSimply add your organization to either your global rebar.config (i.e., `~/.config/rebar3/rebar.config` ) or a local\nproject rebar.config.\n\n```erlang\n{hex, [{repos, [#{name =\u003e \u003c\u003c\"hexpm:your_org\"\u003e\u003e}]}]}.\n```\n\nYou can then authenticate with with the organization repository. Be sure you have already authenticated with the main\nrepository first:\n\n```\n$ rebar3 hex auth    # make sure you're authenticated to the main repo first\n$ rebar3 hex organization auth hexpm:your_org  # authenticate to the org\n```\n\nNow you can generate, revoke, and list keys for your organizations. See below for an example of generating a key for use\nin CI.\n\nSee the [docs](https://hexdocs.pm/rebar3_hex/rebar3_hex_organization.html) for more information.\n\n#### Read-Only Repo Key for CI\n\nIf you have a private organization or other private repository it is recommended that you use a repo specific\nauth token for reading from the repository in CI. To generate a token:\n\n```shell\n$ rebar3 hex organization auth hexpm:myrepo\nSuccessfully authenticated to hexpm:myrepo\n```\n\nNow you can generate a key to use in CI for your organization\n\n```\n$ rebar3 hex organization key hexpm:myrepo generate\nabc123\n```\n\nThen in CI use whatever method is available for setting an environment variable to the token and add this call at the\nbeginning of your CI runs to add the token to your rebar3 hex config. Below we'll use the environment `REPO_KEY` as an\nexample.\n\n```shell\n$ rebar3 hex organization auth hexpm:myrepo --key $REPO_KEY\n```\n\n### Searching hexpm\n\nA `search` provider is available to search packages across hex.pm as a convenience.\n\n```\n$ rebar3 hex search\n```\n\n# Further reading\nSee [Publishing packages](https://hex.pm/docs/rebar3-publish) on hexpm for more setup and usage instructions. See the\n[docs](https://hexdocs.pm/rebar3_hex) for detailed documentation for all available providers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlef%2Frebar3_hex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferlef%2Frebar3_hex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlef%2Frebar3_hex/lists"}