1 | # Project Generators
|
2 | Project generators are [command handlers](CommandHandlers.md) that create
|
3 | projects. A
|
4 | [seed repo](https://the-composition.com/no-more-copy-paste-bf6c7f96e445) is
|
5 | a starting point: it's a working starter project that gets transformed to create a new project, based on parameters
|
6 | supplied by the user.
|
7 |
|
8 | This library provides a convenient way to write a generator. In the `handle` method of your
|
9 | [command handler](https://docs.atomist.com/automation/commands/), call this generate function:
|
10 |
|
11 |
|
12 | ```typescript
|
13 | import { generate } from "@atomist/automation-client/operations/generate/generatorUtils";
|
14 |
|
15 |
|
16 | generate(seedProject,
|
17 | ctx,
|
18 | {token: params.githubToken},
|
19 | params.projectEditor(ctx, params),
|
20 | GitHubProjectPersister,
|
21 | params)
|
22 | ```
|
23 |
|
24 | See an example in
|
25 | [NewAutomation](https://github.com/atomist/automation-client-samples-ts/tree/master/src/commands/generator/NewAutomation.ts).
|