-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fa94a7
commit bdcce9d
Showing
1 changed file
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# hcledit | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) | ||
[![GitHub release](https://img.shields.io/github/release/minamijoyo/hcledit.svg)](https://github.com/minamijoyo/hcledit/releases/latest) | ||
[![GoDoc](https://godoc.org/github.com/minamijoyo/hcledit/hcledit?status.svg)](https://godoc.org/github.com/minamijoyo/hcledit) | ||
|
||
## Features | ||
|
||
- Edit HCL with command line: attribute get/set, block get/list/mv | ||
- CLI-friendly: easily pipe and combine other commands | ||
- Schemaless: independent of specific HCL applications (such as Terraform) | ||
- Keep comments: very important when editing in automation scripts | ||
- HCL2 support (not HCL1) | ||
|
||
The hcledit focuses on editing HCL with command line, is not aiming for generic query tools. It was originally born for the refactoring of Terraform configurations, but is not limited to specific applications. | ||
The HCL specification is somewhat generic, so usability takes precedence over strictness if there is room for interpreting meanings in a schemaless approach. | ||
|
||
## Install | ||
|
||
### Homebrew | ||
|
||
If you are macOS user: | ||
|
||
``` | ||
$ brew install minamijoyo/hcledit/hcledit | ||
``` | ||
|
||
### Download | ||
|
||
Download the latest compiled binaries and put it anywhere in your executable path. | ||
|
||
https://github.com/minamijoyo/hcledit/releases | ||
|
||
### Source | ||
|
||
If you have Go 1.13+ development environment: | ||
|
||
``` | ||
$ git clone https://github.com/minamijoyo/hcledit | ||
$ cd hcledit/ | ||
$ make install | ||
$ hcledit --version | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
$ hcledit --help | ||
A stream editor for HCL | ||
Usage: | ||
hcledit [command] | ||
Available Commands: | ||
attribute Edit attribute | ||
block Edit block | ||
help Help about any command | ||
version Print version | ||
Flags: | ||
-h, --help help for hcledit | ||
Use "hcledit [command] --help" for more information about a command. | ||
``` | ||
|
||
### attribute | ||
|
||
``` | ||
$ hcledit attribute --help | ||
Edit attribute | ||
Usage: | ||
hcledit attribute [flags] | ||
hcledit attribute [command] | ||
Available Commands: | ||
get Get attribute | ||
set Set attribute | ||
Flags: | ||
-h, --help help for attribute | ||
Use "hcledit attribute [command] --help" for more information about a command. | ||
``` | ||
|
||
### block | ||
|
||
``` | ||
$ hcledit block --help | ||
Edit block | ||
Usage: | ||
hcledit block [flags] | ||
hcledit block [command] | ||
Available Commands: | ||
get Get block | ||
list List block | ||
mv Move block (Rename block type and labels) | ||
Flags: | ||
-h, --help help for block | ||
Use "hcledit block [command] --help" for more information about a command. | ||
``` | ||
|
||
## License | ||
|
||
MIT |