Version 0.1.0 #3

Merged
FernandoJVideira merged 12 commits from dev into main 2026-08-25 20:42:49 +00:00
16 changed files with 40 additions and 49 deletions
Showing only changes of commit 613efed0f2 - Show all commits

No files matched your search

+1 -1
View File
@@ -30,4 +30,4 @@ go.work.sum
.env
# Binary
/basalt
/draft*
+2 -1
View File
@@ -1,3 +1,4 @@
[submodule "assets/testdata/api_tmpl"]
path = assets/testdata/api_tmpl
url = git@gitea.fernandovideira.com:FernandoJVideira/api_tmpl.git
url = [email protected]:FernandoJVideira/api_tmpl.git
branch = dev
+6 -12
View File
@@ -1,31 +1,25 @@
PKG_NAME="gitea.fernandovideira.com/fernandojvideira/keystone"
PKG_NAME="git.fernandovideira.com/FernandoJVideira/draft"
version:
@go run -ldflags "-X ${PKG_NAME}/cmd.version=v1.0.0" ./main.go version
generate-templates:
@echo "Initializing submodules..."
@git submodule update --init --recursive
@echo "Generating embedded templates..."
@go run tools/sync_templates.go
build: prepare-embed
@echo "Building for $(GOOS)/$(GOARCH)..."
@GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X ${PKG_NAME}/cmd.version=v0.0.1" -o $(OUTPUT) ./main.go
windows:
@$(MAKE) build GOOS=windows GOARCH=amd64 OUTPUT=keystone.exe
@$(MAKE) build GOOS=windows GOARCH=amd64 OUTPUT=draft_windows_amd64.exe
win-arm:
@$(MAKE) build GOOS=windows GOARCH=arm64 OUTPUT=keystone.exe
@$(MAKE) build GOOS=windows GOARCH=arm64 OUTPUT=draft_windows_arm64.exe
linux:
@$(MAKE) build GOOS=linux GOARCH=amd64 OUTPUT=keystone
@$(MAKE) build GOOS=linux GOARCH=amd64 OUTPUT=draft_linux_amd64
mac:
@$(MAKE) build GOOS=darwin GOARCH=arm64 OUTPUT=keystone
@$(MAKE) build GOOS=darwin GOARCH=arm64 OUTPUT=draft_darwin_arm64
prepare-embed:
@git submodule update --init --recursive
@mkdir -p assets/embedded
@go run tools/sync_templates.go
@GOOS="" GOARCH="" go run tools/sync_templates.go
+11 -15
View File
@@ -1,6 +1,6 @@
# Keystone
# Draft
A powerful CLI tool for bootstrapping Go API projects with best practices built-in. Keystone helps you quickly scaffold production-ready Go APIs with support for both HTTP (REST) and gRPC architectures.
A powerful CLI tool for bootstrapping Go API projects with best practices built-in. Draft helps you quickly scaffold production-ready Go APIs with support for both HTTP (REST) and gRPC architectures.
## Features
@@ -17,8 +17,8 @@ A powerful CLI tool for bootstrapping Go API projects with best practices built-
### From Source
```bash
git clone https://github.com/yourusername/keystone.git
cd keystone
git clone [email protected]:FernandoJVideira/draft.git
cd draft
make build
```
@@ -38,14 +38,14 @@ make windows
make win-arm
```
The compiled binary will be named `basalt` (or `basalt.exe` on Windows).
The compiled binary will be named `draft_<os>_<arch>` (e.g. `draft_darwin_arm64`, or `draft_windows_amd64.exe` on Windows).
## Usage
### Create a New API Project
```bash
keystone new api
draft new api
```
This interactive command will:
@@ -67,7 +67,7 @@ This interactive command will:
### Generate a New Service
```bash
keystone new service
draft new service
```
Creates a new service file in `internal/service/` with:
@@ -78,7 +78,7 @@ Creates a new service file in `internal/service/` with:
### Generate a New Handler
```bash
keystone new handler
draft new handler
```
Creates a new handler in the appropriate directory:
@@ -88,7 +88,7 @@ Creates a new handler in the appropriate directory:
### Generate a Cryptographic Key
```bash
keystone new key
draft new key
```
Generates a secure random key for use in your application (default: 32 characters).
@@ -96,12 +96,12 @@ Generates a secure random key for use in your application (default: 32 character
### Check Version
```bash
keystone version
draft version
```
## Project Structure
When you create a new project, Keystone generates a structured Go API with:
When you create a new project, Draft generates a structured Go API with:
```
your-project/
@@ -154,7 +154,3 @@ This project is licensed under the MIT License - see the LICENSE file for detail
## Author
Built by LKResuts for internal usage to bootstrap Go APIs.
---
**Note:** The binary is compiled as `basalt`, but the CLI tool is referred to as `keystone` in documentation and usage.
+3 -3
View File
@@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
"gitea.fernandovideira.com/fernandojvideira/keystone/assets"
"git.fernandovideira.com/FernandoJVideira/draft/assets"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
)
@@ -19,8 +19,8 @@ func init() {
var apiCmd = &cobra.Command{
Use: "api",
Short: "Create a new Keystone API project",
Long: `Create a new Keystone API project with the necessary structure and files.`,
Short: "Create a new Draft API project",
Long: `Create a new Draft API project with the necessary structure and files.`,
Run: genProject,
}
+1 -1
View File
@@ -23,7 +23,7 @@ func init() {
var handlerCmd = &cobra.Command{
Use: "handler",
Short: "Create a new handler",
Long: `Create a new handler for your Keystone project.`,
Long: `Create a new handler for your Draft project.`,
Run: genHandler,
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"strings"
"text/template"
"gitea.fernandovideira.com/fernandojvideira/keystone/assets"
"git.fernandovideira.com/FernandoJVideira/draft/assets"
)
const (
+1 -1
View File
@@ -16,7 +16,7 @@ var defaultSize = 32
var keyCmd = &cobra.Command{
Use: "key [size]",
Short: "Generate a new cryptographic key",
Long: `Generate a new cryptographic key for use in Keystone projects.`,
Long: `Generate a new cryptographic key for use in Draft projects.`,
Run: func(cmd *cobra.Command, args []string) {
var keyLength int
if cmd.Flags().Lookup("size").Changed {
+3 -3
View File
@@ -4,7 +4,7 @@ import (
"github.com/spf13/cobra"
)
const oldModuleName = "github.com/FernandoJVideira/simple_bank"
const oldModuleName = "github.com/FernandoJVideira/api_tmpl"
const srcDir = "embedded/api_tmpl"
type MainTemplateData struct {
@@ -18,7 +18,7 @@ func init() {
var newCmd = &cobra.Command{
Use: "new",
Short: "Create a new Keystone project",
Long: `Create a new Keystone project with the necessary structure and files.`,
Short: "Create a new Draft project",
Long: `Create a new Draft project with the necessary structure and files.`,
Run: genProject,
}
+3 -3
View File
@@ -8,9 +8,9 @@ import (
)
var rootCmd = &cobra.Command{
Use: "keystone",
Short: "Keystone is a CLI tool for bootstrapping Go APIs",
Long: `Keystone is a CLI tool built by LKResuts for internal usage to bootstrap Go APIs`,
Use: "draft",
Short: "Draft is a CLI tool for bootstrapping Go APIs",
Long: `Draft is a CLI tool built by LKResuts for internal usage to bootstrap Go APIs`,
}
func Execute() {
+1 -1
View File
@@ -24,7 +24,7 @@ type ServiceTemplateData struct {
var serviceCmd = &cobra.Command{
Use: "service",
Short: "Create a new service",
Long: `Create a new service for your Keystone project.`,
Long: `Create a new service for your Draft project.`,
Run: genService,
}
+3 -3
View File
@@ -14,9 +14,9 @@ func init() {
var versionCmd = &cobra.Command{
Use: "version",
Short: "Display the version of Keystone",
Long: `Display the current version of the Keystone CLI tool.`,
Short: "Display the version of Draft",
Long: `Display the current version of the Draft CLI tool.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Keystone CLI version: %s\n", version)
fmt.Printf("Draft CLI version: %s\n", version)
},
}
+1 -1
View File
@@ -1,4 +1,4 @@
module gitea.fernandovideira.com/fernandojvideira/keystone
module git.fernandovideira.com/FernandoJVideira/draft
go 1.25.5
+1 -1
View File
@@ -1,6 +1,6 @@
package main
import "gitea.fernandovideira.com/fernandojvideira/keystone/cmd"
import "git.fernandovideira.com/FernandoJVideira/draft/cmd"
func main() {
cmd.Execute()
+1 -1
View File
@@ -13,7 +13,7 @@ import (
const (
sourceDir = "assets/testdata/api_tmpl"
targetDir = "assets/embedded"
oldModuleName = "github.com/FernandoJVideira/simple_bank"
oldModuleName = "github.com/FernandoJVideira/api_tmpl"
moduleTemplate = "{{ .ModuleName }}"
)