{"id":34632414,"url":"https://github.com/kashifkhn/haft","last_synced_at":"2026-02-18T19:01:04.865Z","repository":{"id":330303790,"uuid":"1122164452","full_name":"KashifKhn/haft","owner":"KashifKhn","description":"⚡ The missing CLI for Spring Boot. Built in Go. Accelerate development with interactive scaffolding, instant REST API boilerplate, and smart dependency management.","archived":false,"fork":false,"pushed_at":"2026-02-04T13:39:31.000Z","size":11254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-05T00:58:36.221Z","etag":null,"topics":["boiler","boilerplate","boilerplate-generator","cli","dev","devtools","java","javacli","productivity","productivity-booster","productivity-tools","scaffolding","scaffolding-framework","scaffolding-tool","scafol","spring-boot","spring-initializr"],"latest_commit_sha":null,"homepage":"https://haft.kashifkhan.dev/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KashifKhn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-24T07:54:46.000Z","updated_at":"2026-02-04T16:58:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/KashifKhn/haft","commit_stats":null,"previous_names":["kashifkhn/haft"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/KashifKhn/haft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KashifKhn%2Fhaft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KashifKhn%2Fhaft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KashifKhn%2Fhaft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KashifKhn%2Fhaft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KashifKhn","download_url":"https://codeload.github.com/KashifKhn/haft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KashifKhn%2Fhaft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29590679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boiler","boilerplate","boilerplate-generator","cli","dev","devtools","java","javacli","productivity","productivity-booster","productivity-tools","scaffolding","scaffolding-framework","scaffolding-tool","scafol","spring-boot","spring-initializr"],"created_at":"2025-12-24T16:53:30.184Z","updated_at":"2026-02-18T19:01:04.860Z","avatar_url":"https://github.com/KashifKhn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets/logo-dark.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"assets/logo-light.png\"\u003e\n    \u003cimg src=\"assets/logo-light.png\" alt=\"Haft - Spring Boot CLI and Scaffolding Tool\" width=\"320\"/\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe Spring Boot CLI that Spring forgot to build\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/KashifKhn/haft/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/KashifKhn/haft?style=for-the-badge\u0026logo=github\u0026color=blue\" alt=\"Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/KashifKhn/haft/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/KashifKhn/haft?style=for-the-badge\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/KashifKhn/haft\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/KashifKhn/haft?style=for-the-badge\" alt=\"Go Report\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://kashifkhn.github.io/haft\"\u003eDocumentation\u003c/a\u003e ·\n  \u003ca href=\"https://github.com/KashifKhn/haft/releases\"\u003eReleases\u003c/a\u003e ·\n  \u003ca href=\"https://github.com/KashifKhn/haft/issues\"\u003eReport Bug\u003c/a\u003e ·\n  \u003ca href=\"https://github.com/KashifKhn/haft/discussions\"\u003eDiscussions\u003c/a\u003e\n\u003c/p\u003e\n\n---\n# Haft - Interactive CLI for Spring Boot\n---\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cstrong\u003eTable of Contents\u003c/strong\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\u003ca href=\"#the-problem\"\u003eThe Problem\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#the-solution\"\u003eThe Solution\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#install\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## The Problem\n\nYou start a Spring Boot project with Spring Initializr. Great. Now what?\n\nEvery new feature means the same tedious ritual:\n- Create `UserEntity.java`\n- Create `UserRepository.java`  \n- Create `UserService.java`\n- Create `UserServiceImpl.java`\n- Create `UserController.java`\n- Create `UserRequest.java`\n- Create `UserResponse.java`\n- Create `UserMapper.java`\n\n**8 files. Every. Single. Time.**\n\nCopy-paste from existing code. Fix the class names. Fix the imports. Miss something. Debug. Repeat.\n\n## The Solution\n\n```bash\nhaft generate resource User\n```\n\nDone. All 8 files. Properly structured. **Matching your project's existing patterns.**\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/demo.gif\" alt=\"Haft Demo\" width=\"700\"/\u003e\n\u003c/p\u003e\n\n## Intelligent Code Generation\n\nHaft doesn't just generate boilerplate — it **learns from your codebase** and generates code that matches your existing conventions.\n\n### What Haft Detects Automatically\n\n| Detection | What It Does |\n|-----------|--------------|\n| **Architecture Pattern** | Layered, Feature/Package-by-Feature, Hexagonal, Clean, Modular |\n| **Feature Style** | Flat (`user/UserController.java`) vs Nested (`user/controller/UserController.java`) |\n| **DTO Naming** | `UserRequest`/`UserResponse` vs `UserDTO` |\n| **ID Type** | `Long` vs `UUID` with correct annotations |\n| **Lombok Usage** | `@Data`, `@Builder`, `@NoArgsConstructor`, `@AllArgsConstructor` |\n| **Mapper Type** | MapStruct, ModelMapper, or manual mapping |\n| **Base Entity** | Extends your `BaseEntity` if detected |\n| **Validation Style** | Jakarta (`jakarta.validation`) vs Javax (`javax.validation`) |\n| **Swagger/OpenAPI** | Adds `@Operation`, `@Tag` annotations if detected |\n| **Database Type** | JPA, MongoDB, Cassandra, R2DBC |\n\n### Profile Caching\n\nFirst run scans your project and caches the profile to `.haft/profile.json`. Subsequent runs are **instant**.\n\n```bash\n# First run (~200ms) - scans and caches\nhaft generate resource User\n\n# Second run (~10ms) - uses cache\nhaft generate resource Product\n\n# Force re-scan if needed\nhaft generate resource Order --refresh\n```\n\n## Why Haft?\n\n| | Spring Initializr | Haft |\n|---|---|---|\n| Project Bootstrap | ✅ | ✅ |\n| Works Offline | ❌ | ✅ |\n| Resource Generation | ❌ | ✅ |\n| **Intelligent Detection** | ❌ | ✅ |\n| **Architecture Aware** | ❌ | ✅ |\n| **Test Generation** | ❌ | ✅ |\n| Dependency Management | ❌ | ✅ |\n| Interactive TUI | ❌ | ✅ |\n| Lifecycle Companion | ❌ | ✅ |\n\n**Haft works completely offline.** No web browser. No internet dependency. Just you and your terminal.\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/KashifKhn/haft/main/install.sh | bash\n```\n\u003e **Note:** You can inspect the [install.sh](https://github.com/KashifKhn/haft/blob/main/install.sh) script before running it. We prioritize security and transparency.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eLinux\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\n# AMD64\ncurl -L https://github.com/KashifKhn/haft/releases/latest/download/haft-linux-amd64.tar.gz | tar xz\nsudo mv haft-linux-amd64 /usr/local/bin/haft\n\n# ARM64\ncurl -L https://github.com/KashifKhn/haft/releases/latest/download/haft-linux-arm64.tar.gz | tar xz\nsudo mv haft-linux-arm64 /usr/local/bin/haft\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003emacOS\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\n# Intel\ncurl -L https://github.com/KashifKhn/haft/releases/latest/download/haft-darwin-amd64.tar.gz | tar xz\nsudo mv haft-darwin-amd64 /usr/local/bin/haft\n\n# Apple Silicon\ncurl -L https://github.com/KashifKhn/haft/releases/latest/download/haft-darwin-arm64.tar.gz | tar xz\nsudo mv haft-darwin-arm64 /usr/local/bin/haft\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eWindows\u003c/strong\u003e\u003c/summary\u003e\n\n```powershell\nInvoke-WebRequest -Uri \"https://github.com/KashifKhn/haft/releases/latest/download/haft-windows-amd64.zip\" -OutFile \"haft.zip\"\nExpand-Archive -Path \"haft.zip\" -DestinationPath \".\"\nMove-Item \"haft-windows-amd64.exe\" \"$env:LOCALAPPDATA\\Microsoft\\WindowsApps\\haft.exe\"\n```\n\nOr download manually from [Releases](https://github.com/KashifKhn/haft/releases).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eGo\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ngo install github.com/KashifKhn/haft/cmd/haft@latest\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eFrom Source\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/KashifKhn/haft.git\ncd haft\nmake build\nsudo mv bin/haft /usr/local/bin/\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eShell Completions\u003c/strong\u003e\u003c/summary\u003e\n\nEnable tab completions for your shell:\n\n```bash\n# Bash\nhaft completion bash \u003e /etc/bash_completion.d/haft\n\n# Zsh\nhaft completion zsh \u003e \"${fpath[1]}/_haft\"\n\n# Fish\nhaft completion fish \u003e ~/.config/fish/completions/haft.fish\n\n# PowerShell\nhaft completion powershell \u003e haft.ps1\n```\n\n\u003c/details\u003e\n\n## Quick Start\n\n### Create a New Project\n\n```bash\nhaft init\n```\n\nAn interactive wizard guides you through project setup:\n\n```\n? Project name: my-api\n? Group ID: com.example  \n? Java version: 21\n? Spring Boot: 3.4.1\n? Dependencies: web, data-jpa, lombok, validation\n```\n\n### Generate Resources (Smart Mode)\n\n```bash\ncd my-app\n\n# Generate a complete CRUD resource\n# Haft automatically detects your architecture and conventions\nhaft generate resource User\n```\n\n**Generated files match your project structure:**\n\n```\n# If your project uses Feature/Package-by-Feature (flat style):\nuser/\n├── UserController.java\n├── UserService.java\n├── UserServiceImpl.java\n├── UserRepository.java\n├── User.java\n├── UserMapper.java\n└── dto/\n    ├── UserRequest.java\n    └── UserResponse.java\n\n# If your project uses Layered architecture:\ncontroller/UserController.java\nservice/UserService.java\nservice/impl/UserServiceImpl.java\nrepository/UserRepository.java\nentity/User.java\ndto/UserRequest.java\ndto/UserResponse.java\nmapper/UserMapper.java\n```\n\n### Generate with Tests\n\n```bash\n# Generate resource + unit/integration tests\nhaft generate resource Product\n\n# Skip test generation\nhaft generate resource Payment --skip-tests\n```\n\n**Generated test files:**\n\n```\n# ServiceTest - Unit tests with Mockito\n# ControllerTest - Integration tests with MockMvc\n# RepositoryTest - Integration tests with @DataJpaTest\n# EntityTest - Unit tests for entity\n```\n\n### Individual Generators\n\n```bash\nhaft generate controller Product   # haft g co Product\nhaft generate service Order        # haft g s Order\nhaft generate repository Payment   # haft g repo Payment\nhaft generate entity Customer      # haft g e Customer\nhaft generate dto Invoice          # Request + Response DTOs\n```\n\n### Generate Security Configuration\n\n```bash\n# Interactive selection of security types\nhaft generate security\n\n# Generate JWT authentication\nhaft generate security --jwt\n\n# Generate session-based authentication\nhaft generate security --session\n\n# Generate OAuth2 authentication (Google, GitHub, Facebook)\nhaft generate security --oauth2\n\n# Generate all security types\nhaft generate security --all\n```\n\n**Generated files for JWT:**\n```\nsecurity/\n├── SecurityConfig.java\n├── JwtUtil.java\n├── JwtAuthenticationFilter.java\n├── AuthenticationController.java\n├── CustomUserDetailsService.java\n└── dto/\n    ├── AuthRequest.java\n    ├── AuthResponse.java\n    ├── RegisterRequest.java\n    └── RefreshTokenRequest.java\n```\n\n### Manage Dependencies\n\n```bash\n# Interactive search picker\nhaft add\n\n# Browse by category\nhaft add --browse\n\n# Add using shortcuts (330+ available)\nhaft add lombok validation jwt\n\n# Add using Maven coordinates (auto-verified)\nhaft add org.mapstruct:mapstruct\n\n# Remove dependencies\nhaft remove lombok\nhaft remove   # Interactive picker\n```\n\n### Development Workflow\n\n```bash\nhaft dev serve   # Start with hot-reload\nhaft dev build   # Build project\nhaft dev test    # Run tests\nhaft dev clean   # Clean artifacts\n```\n\n### Project Analysis\n\n```bash\nhaft info              # Project information\nhaft info --loc        # With lines of code\nhaft routes            # List REST endpoints\nhaft routes --files    # With file locations\nhaft stats             # Code statistics\nhaft stats --cocomo    # COCOMO cost estimates\n```\n\n## Features\n\n- **Intelligent Detection** — Learns from your codebase patterns\n- **Architecture Aware** — Supports Layered, Feature, Hexagonal, Clean, Modular\n- **Test Generation** — Unit and integration tests with Mockito, MockMvc\n- **Profile Caching** — Instant subsequent runs with `.haft/profile.json`\n- **Interactive TUI** — Beautiful terminal interface with keyboard navigation\n- **Offline First** — No internet required, all metadata bundled\n- **Smart Defaults** — Sensible defaults that match industry standards\n- **Back Navigation** — Made a mistake? Press `Esc` to go back\n- **Dependency Search** — Find any dependency with `/`\n- **Maven Central Verification** — Auto-verify and fetch latest versions\n\n## Keyboard Shortcuts\n\n| Key | Action |\n|-----|--------|\n| `↑` `↓` | Navigate |\n| `Enter` | Select |\n| `Esc` | Go back |\n| `Space` | Toggle |\n| `/` | Search |\n| `Tab` | Next category |\n| `0-9` | Jump to category |\n\n## Supported Architectures\n\nHaft automatically detects and generates code for:\n\n| Architecture | Description |\n|--------------|-------------|\n| **Layered** | Traditional `controller/`, `service/`, `repository/`, `entity/` |\n| **Feature** | Package-by-feature with nested or flat structure |\n| **Hexagonal** | Ports \u0026 Adapters with `adapter/`, `application/`, `domain/` |\n| **Clean** | Clean Architecture with `usecase/`, `gateway/`, `infrastructure/` |\n| **Modular** | Modular monolith with `api/`, `internal/` |\n\n## Roadmap\n\n- [x] Project initialization wizard\n- [x] All Spring Initializr dependencies  \n- [x] Maven \u0026 Gradle support\n- [x] Intelligent architecture detection\n- [x] Test generation\n- [x] Profile caching\n- [x] `haft generate resource` — Full CRUD generation\n- [x] `haft add` / `haft remove` — Dependency management\n- [x] `haft dev` — Development commands\n- [x] `haft info` / `haft routes` / `haft stats` — Project analysis\n- [x] Shell completions (bash, zsh, fish, powershell)\n- [x] Security configuration (JWT, Session, OAuth2)\n- [x] Custom templates\n- [ ] Neovim integration\n- [ ] VS Code extension\n- [ ] IntelliJ plugin\n\n## Built With\n\n* **[Go](https://go.dev/)** - High-performance compiled binary.\n* **[Bubble Tea](https://github.com/charmbracelet/bubbletea)** - The TUI framework.\n* **[Cobra](https://github.com/spf13/cobra)** - CLI command structure.\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt for developers who value their time\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashifkhn%2Fhaft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkashifkhn%2Fhaft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashifkhn%2Fhaft/lists"}