> 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/0.8.0/cli/generate/controller.md).

# Controller

Generates a controller.

### Command

```ruby
$ eucalypt generate controller
# Alias/shortened
$ eucalypt g controller
$ eucalypt g c
```

### Arguments

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

### Options/flags

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

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

* `--rest` alias `-r`, *(Default: False)*

  Specify whether or not to generate a REST-style controller, with [BREAD](http://paul-m-jones.com/archives/291) method route handler templates.

### Examples

* `$ eucalypt g controller tweet`

  Generates a new controller with default options.

* `$ eucalypt g controller tweet --no-spec`

  Generates a new controller without a corresponding spec file.

* `$ eucalypt g controller tweet -r`

  Generates a REST-style controller.
