Codewise is a powerful CLI tool that simplifies common DevOps tasks such as:
- Encoding/decoding files
- JSON/YAML conversions
- Dockerfile generation
- Kubernetes manifest scaffolding
- Rendering templates with Go's
text/template
engine
git clone https://github.com/aryansharma9917/Codewise-CLI.git
cd Codewise-CLI
go build -o codewise main.go
sudo mv codewise /usr/local/bin/
codewise <command> [flags]
Conversion Type | Description | Example |
---|---|---|
JTY |
JSON to YAML | codewise encode --input input.json --output output.yaml --type JTY |
YTJ |
YAML to JSON | codewise encode --input input.yaml --output output.json --type YTJ |
KVTJ |
.env to JSON | codewise encode --input .env --output env.json --type KVTJ |
B64E |
Base64 Encode | codewise encode --input input.txt --output encoded.txt --type B64E |
B64D |
Base64 Decode | codewise encode --input encoded.txt --output decoded.txt --type B64D |
Generate a Dockerfile:
codewise generate dockerfile --output Dockerfile
Generate a Kubernetes manifest:
codewise generate k8s --output deployment.yaml
Use Go .tpl
template and .yaml
values file to generate output YAML:
codewise template --template template.tpl --values values.yaml --output rendered.yaml
docker build -t aryansharma04/codewise-cli:latest .
docker run --rm -v $(pwd):/app aryansharma04/codewise-cli:latest <command>
Example:
docker run --rm -v $(pwd):/app aryansharma04/codewise-cli:latest encode --input /app/input.json --output /app/output.yaml --type JTY
Make sure Go is installed:
go test ./... -v
Test coverage includes:
- ✅ JSON to YAML
- ✅ YAML to JSON
- ✅ ENV to JSON
- ✅ Base64 encode/decode
- ✅ Template rendering
.
├── cmd/ # CLI command handlers
├── pkg/
│ ├── encoder/ # Encoding & conversion logic
│ ├── generator/ # Project scaffolding logic
│ └── validator/ # Future: Schema & config validation
├── templates/ # Go template files
├── tests/ # Unit tests
├── testdata/ # Sample input files for testing
├── Dockerfile
├── Makefile
├── go.mod
├── main.go
└── README.md
# Fork and clone the repo
git clone https://github.com/<your-username>/Codewise-CLI.git
cd Codewise-CLI
# Create a feature branch
git checkout -b my-feature
# Make changes and push
git add .
git commit -m "Add awesome feature"
git push origin my-feature
Then open a Pull Request 🚀
Licensed under the MIT License. See LICENSE
for more.
Check out the behind-the-scenes story and development journey in Aryan's detailed blog post:
📖 I Built a DevOps CLI Tool in Go – Meet Codewise-CLI
Dive into how this tool was built from scratch, its motivations, challenges, features, and future roadmap.