> For the complete documentation index, see [llms.txt](https://eucalypt.gitbook.io/eucalypt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eucalypt.gitbook.io/eucalypt/cli/generate/model.md).

# Model

Generates a model.

### Command

```ruby
$ eucalypt generate model
# Alias/shortened
$ eucalypt g model
$ eucalypt g m
```

### Arguments

* `[NAME]` - The name of the model.

* `*[COLUMN:TYPE]` - The columns/attributes for the model's database table, along with their types (argument can be empty).

### Options/flags

* `--spec`, `--no-spec`, *(Default: True)*

  Specify whether or not to generate a spec file along with the model.

* `--table`, `--no-table`, *(Default: True)*

  Specify whether or not to generate a table creation migration along with the model.

### Examples

* `$ eucalypt g model tweet`

  Generates a new model with default options (and no columns).

* `$ eucalypt g model tweet text:string likes:integer`

  Generates a new model with default options (and two columns)

* `$ eucalypt g model tweet text:string likes:integer --no-spec`

  Generates a new model without a corresponding spec file (and two columns).

* `$ eucalypt g model tweet --no-table`

  Generates a new model file with a corresponding spec file, but with no table creation migration.
