godev

command module
v0.0.0-...-75364bd Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README ΒΆ

godev πŸš€

Go Version Go Report Card PkgGoDev

Less boilerplate, more building. The all-in-one command center and project scaffolder for modern Go development.

πŸ’‘ Why godev?

As a Go novice, I was once overwhelmed by the 'preliminary chores'. From choosing between go fmt and gofumpt to configuring golangci-lint and better project structures, various CLI commands like gofumpt -w ., golangci-lint run ./..., go mod tidy, etc. Every new project felt like a tedious loop of 'copy-paste' from the last one. I thought I need a tool that just worked and I don't like to use Makefile, so I built godev. It's born to free you from these chores, so you can focus on what matters: writing your code.

It provides a unified CLI to:

  1. Manage: A single entry point for project init, testing, linting, building, and releasing.
  2. Diagnose: A "Doctor" that doesn't just find issues, but understands Go development environments.
  3. Scaffold: Initialize modern Go project with preset template and configuration.

✨ Key Features

  • πŸ“¦ One-Stop Scaffolding: Create Go projects following best practices (.golangci.yml, go.mod, etc.).
  • 🩺 Interactive Doctor: Comprehensive health checks for your Go version, modules, and toolchain.
  • πŸ› οΈ Unified Workflow: Integrated commands for unit and integration tests, stop remembering complex flags.
  • βš™οΈ Standardized Tooling: Automatically set up VS Code settings, gofumpt, and golangci-lint.

πŸ“¦ Installation

go install github.com/thought2code/godev@latest
Building from Source
git clone https://github.com/thought2code/godev.git
cd godev
go build -o godev main.go
Prerequisites
  • Go 1.25 or later (latest stable recommended)

πŸš€ Usage

1. Initialize a New Project

Don't waste time on folder structures.

# Initialize in current directory
godev init

# Initialize with project name
godev init myproject

# Initialize in specific directory
godev init /path/to/myproject

The init command creates a new Go project with:

  • Pre-configured VS Code settings
  • .gitignore file
  • golangci-lint-v2 configuration
  • Latest Go module setup
  • Professional project structure
2. Check Environment Health

Is your GOPATH messed up? Are you missing tools?

godev doctor

The doctor command diagnoses your development environment:

  • Validates Go module file (go.mod)
  • Checks Go version compatibility
  • Verifies essential Go tools installation
  • Provides actionable remediation advice
3. Smart Testing

No more long, messy go test ./... flags.

godev test unit           # Run unit tests
godev test unit -v        # Run unit tests with verbose output
godev test unit -c        # Run unit tests with coverage and save the cover profile
godev test unit --html    # Run unit tests with coverage and open report in your browser
godev test integ          # Run integration tests

πŸ“ Project Structure

When you initialize a new project, godev creates:

myproject/
β”œβ”€β”€ .vscode/
β”‚   β”œβ”€β”€ extensions.json    # Recommended VS Code extensions
β”‚   β”œβ”€β”€ launch.json        # Debug configuration
β”‚   └── settings.json      # Recommended VS Code settings
β”œβ”€β”€ .gitignore             # Git ignore rules
β”œβ”€β”€ .golangci.yml          # Linting configuration
β”œβ”€β”€ go.mod                 # Go module file
└── README.md              # Project documentation

πŸ“š Commands Reference

Command Description Example
godev Show help information godev
godev init [project] Initialize new Go project godev init myapp
godev doctor Diagnose development environment godev doctor
godev test unit Run unit tests godev test unit
godev test integ Run integration tests godev test integ

πŸ”§ Development Tools Integration

godev automatically set up and recommend these essential Go development tools:

βš™οΈ Configuration

VS Code Integration

The generated .vscode/settings.json includes:

  • Go extension configuration
  • Format on save with gofumpt
  • Auto-import organization
  • Linting integration
Linting Configuration

The .golangci.yml file provides:

  • Comprehensive linter rules
  • Performance optimizations
  • Custom rule configurations

πŸ—οΈ Project Architecture

The project follows a clean architecture:

godev/
β”œβ”€β”€ cmd/                 # CLI commands
β”‚   β”œβ”€β”€ root.go          # Root command setup
β”‚   β”œβ”€β”€ init.go          # Project initialization
β”‚   β”œβ”€β”€ doctor.go        # Environment diagnostics
β”‚   β”œβ”€β”€ tools.go         # Go tools management
β”‚   └── test.go          # Testing commands
β”œβ”€β”€ internal/            # Internal packages
β”‚   β”œβ”€β”€ osutil/          # OS utilities (filesystem, exec, etc.)
β”‚   β”œβ”€β”€ strconst/        # String constants
β”‚   └── tui/             # Terminal UI utilities (colorized output, etc.)
β”œβ”€β”€ template/            # Preset project templates
└── main.go              # Application entry point

Contributing 🀝

We welcome and appreciate contributions ❀️

Development Setup
  1. Fork the repository
  2. Clone your fork: git clone https://github.com/your-username/godev.git
  3. Create a feature branch: git checkout -b feature/amazing-feature
  4. Make your changes and add tests
  5. Run tests: go test ./...
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to the branch: git push origin feature/amazing-feature
  8. Open a Pull Request

πŸ’¬ Support

πŸ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
tui