Swiftpack.co - rosberry/general as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by rosberry.
rosberry/general 3.0
Code generation for your modules
⭐️ 4
🕓 1 year ago
.package(url: "https://github.com/rosberry/general.git", from: "3.0")


New vision of source code generation. Allows to generate files and automatically add them to project hierarchy by the most easiest way. All you need is to get templates where already declared their place in progect hierarchy and specify spec file where provided default project target. Also you can specify other target if required right in command line.



  1. Setup templates and spec:

    general setup [-r <templates repo> [-g]
  2. Create a module with one of installed templates:

    general -n main -t rsb_mvp_vm_module

Run general help to see available commands and options:

OVERVIEW: Generates code from templates.

USAGE: general <subcommand>

  --version               Show the version.
  -h, --help              Show help information.

  gen (default)           Generates modules from templates.
  create                  Creates a new template.
  list                    List of available templates.
  setup                   Provides your environment with templates
  config                  Provides an access to config file
  upgrade                 Upgrades general to specified version


Now you can create your own executable file and place it under ~/.general/plugins. The only requirement - this file should provide --help option for it and each its public subcommands like swift ArgumentParser (see example above). General will find appropriate plugin by command line arguments semantic.

To learn more about the configuration file see the dedicated documentation.


  • Homebrew: brew install rosberry/tap/general
  • Mint: mint install rosberry/general
  • From source: make install



This project is owned and maintained by Rosberry. We build mobile apps for users worldwide 🌏.

Check out our open source projects, read our blog or give us a high-five on 🐦 @rosberryapps.


The project is available under the MIT license. See the LICENSE file for more info.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics