- Go 1.22 or later
- Git
git clone https://github.com/vngcloud/greennode-cli.git
cd greennode-cli/go
go build -o grn .
./grn --versioncd go
CGO_ENABLED=0 go build -o grn .git checkout main && git pull
git checkout -b feat/your-feature-namecd go
# Write code
CGO_ENABLED=0 go build -o grn .
./grn vks <your-command> --helpEvery PR should include a changelog fragment:
./scripts/new-change -t feature -c vks -d "Add your feature description"Change types: feature, bugfix, enhancement, api-change
Follow Conventional Commits:
feat(vks): add describe-events command
fix(auth): fix token refresh race condition
docs(readme): update installation instructions
- PR to
mainwhen release-ready - CI must pass before merge
- At least 1 approval required
- Create
go/cmd/vks/<command_name>.go - Define
cobra.Commandwith Use, Short, RunE - Register in
go/cmd/vks/vks.go:VksCmd.AddCommand(newCmd) - Add
validator.ValidateID()for any ID args - Add
--dry-runfor create/update/delete - Add
--force+ confirmation for delete - Create
docs/commands/vks/<command-name>.md— command reference page - Add entry to
docs/commands/vks/index.mdtable - Add nav entry to
mkdocs.yml
- Create
go/cmd/<service>/directory - Create parent command with
cobra.Command - Register in
go/cmd/root.go:rootCmd.AddCommand(serviceCmd)
- All source code text in English
- Use cobra patterns for all commands
- Validate user inputs (IDs used in URLs)
- Use
--dry-runfor create/update/delete commands - Add
--forceto skip confirmation on delete commands
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.