Gckit-CLI code generation command line tool, mainly for iOS(of course also support custom, such as Dart, Java) Swift or Objective-C syntax file generation, The ViewController, Model, and Cell files can be generated using a simple JSON file. The generated file types and file paths can be customized. One-click generation maximized development efficiency, no more copy-and-paste operations, developers only need to focus on business code development.

Ideal for development

When doing client development, most of the interface is drawn based on the JSON data returned from the background. When obtaining JSON data, corresponding models, ViewControllers and cells need to be created, which are bound with JSON in most cases. That is, after obtaining JSON, the corresponding Model, ViewController, Cell, etc., can be easily determined. Gckit-cli is based on this development. A simple JSON file can be used to generate the corresponding Model, ViewController, Cell and other files in one click.

The installation

Node. Js environment

$ brew install node
Copy the code

See the Official Node.js information for more installation options

After the installation is complete, you can run the following command to check whether the installation is successful:

$node -v v10.7.0 $NPM -v 6.4.1Copy the code

Install the Gckit CLI tool

$ npm install gckit -g
Copy the code

Then run commands to check whether the installation is successful

$ gckit --help
Copy the code

Simply try

Executing Shell commands

$ gckit g product vc
Copy the code

The corresponding file is then generated in the current directory:

The command will generate a Swift ViewController file based on the default configuration relative to the current directory

instructions

  • vc: Specifies the generated file typeViewController
  • product: indicates the input parametername
  • gforgenerateShort for Build file

Refer to the Gckit-CLI documentation for more information.