Skip to content

Commit 7d2a59c

Browse files
authored
Initial project setup and core feature implementation (#3)
Add project metadata, documentation, and licensing files. Implement main CLI commands for environment file management, including arrange, audit, convert, create, crypto, info, output, sync, and validate. Add internal utilities, parser, crypto, and validator modules. Provide installation script, example .env file, and configure automated release workflow. Update dependencies in go.mod and add go.sum for reproducible builds.
1 parent 2ccf03c commit 7d2a59c

24 files changed

Lines changed: 3424 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.25'
25+
26+
- name: Get version
27+
id: get_version
28+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
29+
30+
- name: Build binaries
31+
run: |
32+
# Create dist directory
33+
mkdir -p dist
34+
35+
# Build for Linux AMD64
36+
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/MayR-Labs/envdoc-go/internal/commands.Version=${{ steps.get_version.outputs.VERSION }}" -o dist/envdoc-linux-amd64 .
37+
38+
# Build for Linux ARM64
39+
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X github.com/MayR-Labs/envdoc-go/internal/commands.Version=${{ steps.get_version.outputs.VERSION }}" -o dist/envdoc-linux-arm64 .
40+
41+
# Build for macOS AMD64
42+
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X github.com/MayR-Labs/envdoc-go/internal/commands.Version=${{ steps.get_version.outputs.VERSION }}" -o dist/envdoc-darwin-amd64 .
43+
44+
# Build for macOS ARM64 (Apple Silicon)
45+
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X github.com/MayR-Labs/envdoc-go/internal/commands.Version=${{ steps.get_version.outputs.VERSION }}" -o dist/envdoc-darwin-arm64 .
46+
47+
# Build for Windows AMD64
48+
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X github.com/MayR-Labs/envdoc-go/internal/commands.Version=${{ steps.get_version.outputs.VERSION }}" -o dist/envdoc-windows-amd64.exe .
49+
50+
# Make binaries executable
51+
chmod +x dist/envdoc-*
52+
53+
# List built files
54+
ls -lh dist/
55+
56+
- name: Generate checksums
57+
run: |
58+
cd dist
59+
sha256sum * > checksums.txt
60+
cat checksums.txt
61+
62+
- name: Generate release notes
63+
id: release_notes
64+
run: |
65+
cat > release_notes.md << 'EOF'
66+
## envdoc ${{ steps.get_version.outputs.VERSION }}
67+
68+
### Installation
69+
70+
Download the appropriate binary for your platform below:
71+
72+
#### Linux
73+
```bash
74+
# AMD64
75+
wget https://github.com/MayR-Labs/envdoc-go/releases/download/${{ steps.get_version.outputs.VERSION }}/envdoc-linux-amd64
76+
chmod +x envdoc-linux-amd64
77+
sudo mv envdoc-linux-amd64 /usr/local/bin/envdoc
78+
79+
# ARM64
80+
wget https://github.com/MayR-Labs/envdoc-go/releases/download/${{ steps.get_version.outputs.VERSION }}/envdoc-linux-arm64
81+
chmod +x envdoc-linux-arm64
82+
sudo mv envdoc-linux-arm64 /usr/local/bin/envdoc
83+
```
84+
85+
#### macOS
86+
```bash
87+
# Intel
88+
wget https://github.com/MayR-Labs/envdoc-go/releases/download/${{ steps.get_version.outputs.VERSION }}/envdoc-darwin-amd64
89+
chmod +x envdoc-darwin-amd64
90+
sudo mv envdoc-darwin-amd64 /usr/local/bin/envdoc
91+
92+
# Apple Silicon (M1/M2/M3)
93+
wget https://github.com/MayR-Labs/envdoc-go/releases/download/${{ steps.get_version.outputs.VERSION }}/envdoc-darwin-arm64
94+
chmod +x envdoc-darwin-arm64
95+
sudo mv envdoc-darwin-arm64 /usr/local/bin/envdoc
96+
```
97+
98+
#### Windows
99+
Download `envdoc-windows-amd64.exe` and add it to your PATH.
100+
101+
Or use the [installation script](https://github.com/MayR-Labs/envdoc-go#installation).
102+
103+
### Verify Installation
104+
```bash
105+
envdoc --version
106+
```
107+
108+
### What's Changed
109+
See the [CHANGELOG](https://github.com/MayR-Labs/envdoc-go/blob/main/CHANGELOG.md) for details.
110+
111+
### Checksums
112+
Verify the integrity of your download using the checksums in `checksums.txt`.
113+
EOF
114+
115+
- name: Create Release
116+
uses: softprops/action-gh-release@v1
117+
with:
118+
files: |
119+
dist/*
120+
body_path: release_notes.md
121+
draft: false
122+
prerelease: false
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
envdoc
8+
9+
# Test binary, built with `go test -c`
10+
*.test
11+
12+
# Output of the go coverage tool
13+
*.out
14+
15+
# Dependency directories
16+
vendor/
17+
18+
# Go workspace file
19+
go.work
20+
go.work.sum
21+
22+
# IDE specific files
23+
.idea/
24+
.vscode/
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# OS specific files
30+
.DS_Store
31+
Thumbs.db
32+
33+
# Build artifacts
34+
dist/
35+
*.log
36+
37+
# Temporary files
38+
*.tmp
39+
*.bak

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2025-01-XX
11+
12+
### Added
13+
- Initial release of envdoc
14+
- `create-example` command to generate example files from .env files
15+
- `create-schema` command to generate JSON schemas from .env files
16+
- `arrange` command to sort and group environment variables
17+
- `audit` command to find duplicate keys in .env files
18+
- `compare` command to compare keys across multiple .env files
19+
- `sync` command to synchronize keys across multiple .env files
20+
- `base64` command for encoding/decoding files
21+
- `hash` command to generate SHA256 hashes
22+
- `encrypt` command for AES-256 encryption with PBKDF2
23+
- `decrypt` command for decrypting encrypted files
24+
- `to` command to convert .env to JSON/YAML
25+
- `from` command to convert JSON/YAML to .env
26+
- `validate` command to validate .env files against JSON schemas
27+
- `doctor` command to audit all .env files in current directory
28+
- `engineer` command to sync and arrange all .env files
29+
- `version`, `documentation`, `license`, `changelog`, and `authors` commands
30+
- Interactive prompts using survey
31+
- PIN-based confirmation for destructive operations
32+
- Comprehensive markdown reports with table of contents
33+
- Clipboard integration for copying reports and hashes
34+
- Installation script (install.sh) for easy setup
35+
- GitHub Actions workflow for automated releases
36+
- Cross-platform support (Linux, macOS, Windows)
37+
- Multi-architecture support (AMD64, ARM64)
38+
39+
[unreleased]: https://github.com/MayR-Labs/envdoc-go/compare/v0.1.0...HEAD
40+
[0.1.0]: https://github.com/MayR-Labs/envdoc-go/releases/tag/v0.1.0

0 commit comments

Comments
 (0)