Skip to content

Writing CLI tools for Vendure #1050

Answered by michaelbromley
skid asked this question in Q&A
Discussion options

You must be logged in to vote

(copying reply from Slack)

When you call bootstrap(config) it returns an instance of the Nest application, which you can use to get any provider from the app and use directly in your CLI program, e.g.:

const app = await bootstrap(config);
const connection = app.get(TransactionalConnection);

More can be found in the Nest docs: https://docs.nestjs.com/standalone-applications#standalone-applications

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@skid
Comment options

@michaelbromley
Comment options

Answer selected by skid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants