Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please document how to install the cli tools #500

Closed
Ramblurr opened this issue Dec 10, 2021 · 2 comments
Closed

Please document how to install the cli tools #500

Ramblurr opened this issue Dec 10, 2021 · 2 comments

Comments

@Ramblurr
Copy link

I see that in cmd/ there is an hclfmt tool.

How can I install this tool to format my hcl2 files (specifically, nomad job specs)? Are there pre built binaries available? I couldn't find any at https://releases.hashicorp.com/

@apparentlymart
Copy link
Contributor

Hi @Ramblurr,

The applications that use HCL typically include a formatting command of their own which understands each application's specific conventions. While you could in principle use the generic hclfmt to achieve some basic formatting of your Nomad job specifications, it might also be worth discussing with the Nomad team the possibility of it offering a command like nomad fmt so that you don't need to install anything extra to achieve that. (This matches with terraform fmt and packer fmt, but perhaps the Nomad team will have a reason to choose a different convention.)

In the meantime though, if you wish to use hclfmt then you'll need to build it yourself from source code, because we maintain this repository primarily as a library and don't publish the ancillary tools as products in their own right. (They exist mainly as examples for applications to build from.)

@nahsi
Copy link

nahsi commented Dec 30, 2021

@Ramblurr you can install hclfmt using go install

go install github.com/hashicorp/hcl/v2/cmd/hclfmt@latest

Here is a proposal to Nomad team: hashicorp/nomad#11757

@kmoe kmoe closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants