ct

command module
v0.0.0-...-bc721e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2025 License: Apache-2.0, MIT Imports: 1 Imported by: 0

README

ct

ct is a lightweight, fast, and simple config file transformer. Currently, it supports the following file types:

  • JSON
  • YAML
  • TOML
  • HCL (v1)

Usage

Flags
  -e, --escape-html                 Escapes HTML (JSON only)
  -f, --force                       Force overwrite of output file
  -h, --help                        help for ct
      --indent                      Indent output (JSON & TOML only)
  -i, --input string                Input file or extension (e.g. example.toml or toml) (accepted extensions: toml, yaml, json, hcl)
  -o, --output string               Output file or extension  (e.g. example.json or json) (accepted extensions: toml, yaml, json, hcl)
  -p, --output-permissions uint32   File permissions for output file (default 644)
  -v, --version                     version for ct
Examples
Input Output Command
Pipe (toml format) Stdout (hcl format) cat example.toml | ct -i toml -o hcl
File (json format) Stdout (yaml format) ct -i example.json -o yaml
Pipe (yaml format) File (toml format) cat example.yml | ct -i yaml -o example.toml
File (hcl format) File (json format) ct -i example.hcl -o example.json

Installation

Homebrew

You can install directly with:

brew install --cask conways-glider/tap/ct

Or, you can tap and install with:

brew tap conways-glider/tap
brew install --cask ct
Manual

Binaries for macOS, Linux, and Windows are attached to each release.

Building

To build from source:

$ git clone https://github.com/conways-glider/ct
$ cd ct
$ make build
$ ./bin/ct --version
0.0.0

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package convert provides functionality to transform data between different configuration formats.
Package convert provides functionality to transform data between different configuration formats.
Package json provides encoding and decoding functionality for JSON format.
Package json provides encoding and decoding functionality for JSON format.
Package yaml provides encoding and decoding functionality for YAML format.
Package yaml provides encoding and decoding functionality for YAML format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL