UNPKG

911 BMarkdownView Raw
1# Project Generators
2Project generators are [command handlers](CommandHandlers.md) that create
3projects. A
4[seed repo](https://the-composition.com/no-more-copy-paste-bf6c7f96e445) is
5a starting point: it's a working starter project that gets transformed to create a new project, based on parameters
6supplied by the user.
7
8This 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
13import { generate } from "@atomist/automation-client/operations/generate/generatorUtils";
14
15
16generate(seedProject,
17 ctx,
18 {token: params.githubToken},
19 params.projectEditor(ctx, params),
20 GitHubProjectPersister,
21 params)
22```
23
24See an example in
25[NewAutomation](https://github.com/atomist/automation-client-samples-ts/tree/master/src/commands/generator/NewAutomation.ts).