A powerful command-line interface tool for creating and managing Comet Framework projects. Streamline your development workflow with automated project scaffolding and component generation.
- Go 1.18 or higher
- Git
go install github.com/ramoncl001/comet-cli@latestgit clone https://github.com/ramoncl001/comet-cli.git
cd comet-cli
go build -o comet ./main.go
sudo mv comet /usr/local/bin/# Create a new Comet project
comet-cli new my-project module.name
# Navigate to your project
cd my-project
# Add a controller
comet-cli add controller User controllers
# Add a service
comet-cli add service User services
# Add middleware
comet-cli add middleware Auth middlewares
# Run your project
go run .comet-cli new [project-name] [module-name]
Creates a new Comet project with the specified name and Go module path.
project-name: The directory name for your new projectmodule-name: The Go module path (e.g.,github.com/username/project)
comet-cli new awesome-api github.com/yourusername/awesome-apicomet-cli add [type] [name] [location]
Generates new components for your Comet project.
type: The type of component to create (controller,service, ormiddleware)name: The name of the component (e.g.,User)location: The directory where the component should be created
# Create a controller in the controllers directory
comet-cli add controller User controllers
# Create a service in the services directory
comet-cli add service User services
# Create middleware in the middleware directory
comet-cli add middleware Auth middlewares
# Create component in current directory
comet-cli add controller Health .When you create a new project with comet-cli new, it generates the following structure:
your-project
├── go.mod
├── go.sum
├── infrastructure
├── main.go
├── middlewares
│ └── your_middleware.go
└── modules
└── foo
├── controllers
│ └── foo_controller.go
├── domain
└── services
└── foo_service.go
Handle HTTP requests and responses. Generated with proper Comet Framework structure including:
-
Request handling
-
Response generation
-
Dependency injection support
-
Route registration
Business logic components with:
-
Dependency injection support
-
Interface implementation
-
Scoped lifecycle management
HTTP request processing middleware with:
-
Standard Comet middleware interface
-
Request/response interception
-
Error handling
This project is licensed under the MIT License - see the LICENSE file for details.
# Ensure Go bin directory is in your PATH
export PATH=$PATH:$(go env GOPATH)/bin# On Unix systems, you might need to make the binary executable
chmod +x $(go env GOPATH)/bin/comet-cli# Clean module cache and rebuild
go clean -modcache
go mod tidy