npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

exitus-spring-cli

v0.1.8

Published

CLI tool for generating Spring Boot components following Exitus patterns (Model, Mapper, Service, Controller, Search)

Downloads

757

Readme

exitus-spring-cli

CLI tool for generating Spring Boot components following Exitus patterns (Model, Mapper, Service, Controller, Search).

Table of Contents

  1. Installation
  2. Usage
  3. Commands
  4. Templates
  5. Examples
  6. Contributing
  7. License

Installation

To install Exitus Spring CLI globally, run the following command:

npm install -g exitus-spring-cli

Or run locally with npx:

npx exitus-spring-cli new <entity-name>

Usage

Once installed, you can use the CLI to generate new Spring Boot components. The basic syntax is:

exitus-spring-cli new <entity-name> [options]

Or using the short alias:

esc new <entity-name> [options]

Commands

new

The new command is used to create a new Spring Boot entity with all layers. It generates:

  • Model - Java entity class with getters/setters
  • Mapper - MyBatis mapper interface with CRUD operations
  • Service - Business logic layer
  • Controller - REST API endpoints
  • Search - Java Record for search parameters

Options

| Option | Description | Default | |--------|-------------|---------| | -o, --out <path> | Output directory for generated files | . | | -p, --package <package> | Base package name | com.exitus.educ.academico | | -s, --schema <schema> | Database schema name | academico | | --skip-model | Skip generating the Model class | false | | --skip-mapper | Skip generating the Mapper interface | false | | --skip-service | Skip generating the Service class | false | | --skip-controller | Skip generating the Controller class | false | | --skip-search | Skip generating the Search record | false | | --only-model | Generate only the Model class | false | | --only-mapper | Generate only the Mapper interface | false | | --only-service | Generate only the Service class | false | | --only-controller | Generate only the Controller class | false | | --only-search | Generate only the Search record | false | | --dry-run | Preview generated files without creating them | false | | -f, --fields <fields> | Comma-separated list of fields | Default fields |

list

Lists all available component types:

exitus-spring-cli list

init

Initialize exitus-spring-cli configuration in your project (coming soon).

Templates

Exitus Spring CLI generates the following files following Exitus patterns:

Model

package com.exitus.educ.academico.model;

import org.apache.commons.lang3.builder.*;
import java.util.Date;

public class Tarefa {
    private String codigo;
    private String nome;
    // ... getters, setters, equals, hashCode, toString
}

Mapper

package com.exitus.educ.academico.mapper;

import org.apache.ibatis.annotations.*;

@Mapper
public interface TarefaMapper {
    @Select("SELECT * FROM academico.tarefa_pesquisar(...)")
    Tarefa selectByPrimaryKey(@Param("usuario") UUID usuario, @Param("codigo") UUID codigo);
    // ... selectEntries, insert, updateFull, delete
}

Service

package com.exitus.educ.academico.service;

@Service("tarefaService")
public class TarefaService {
    @Autowired
    private TarefaMapper mapper;
    // ... selectByPrimaryKey, selectEntries, save, delete
}

Controller

package com.exitus.educ.academico.controller;

@RestController
public class TarefaController extends GenericController<Tarefa> {
    // GET /rest/tarefa/{codigo}
    // POST /rest/tarefa/search
    // POST /rest/tarefa
    // PUT /rest/tarefa
    // DELETE /rest/tarefa/{codigo}
}

Search

package com.exitus.educ.academico.search;

public record TarefaSearch(
    String pesquisa,
    Integer pagina,
    Integer totalRegistros
) {}

Examples

Generate a complete entity

exitus-spring-cli new Tarefa -p com.exitus.educ.academico -s academico

Generate with custom fields

exitus-spring-cli new MaterialAprendizagem \
  -p com.exitus.educ.academico \
  -s aprendizagem \
  -f "codigo:String,nome:String,conteudo:String,arquivado:Boolean,usuario:Usuario,dataCriacao:Date"

Preview without creating files (dry-run)

exitus-spring-cli new Tarefa --dry-run

Generate only the Model

exitus-spring-cli new Tarefa --only-model

Skip specific components

exitus-spring-cli new Tarefa --skip-search --skip-controller

Generate to a specific directory

exitus-spring-cli new Tarefa -o src/main/java/com/exitus/educ/academico

Field Types

Supported field types:

| Java Type | Description | |-----------|-------------| | String | Text fields | | Integer | Integer numbers | | Long | Long integers | | Boolean | Boolean values | | Date | Date/time fields | | Double | Decimal numbers | | Float | Float numbers | | BigDecimal | Precise decimal numbers | | UUID | UUID identifiers | | Usuario | User entity reference |

Project Structure

Generated files follow this structure:

src/main/java/com/exitus/educ/academico/
├── controller/
│   └── TarefaController.java
├── mapper/
│   └── TarefaMapper.java
├── model/
│   └── Tarefa.java
├── search/
│   └── TarefaSearch.java
└── service/
    └── TarefaService.java

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Make your changes and commit them
  4. Push your branch and create a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.


Version: 0.1.0
Author: Exitus Team
Repository: github.com/ensinho/exitus-spring-cli