Warning
There is not enough motivation because in my opinion it is easier to copy by hand what this cli offers. Also requires adding existing templates, which I think grammyjs/examples and grammyjs/awesome-grammY does a great job with. If we want a cli for grammy, I think it should be a utility not just for scaffold templates, but also for modifying code, like gmy add sessions conversations
, which will adjust middlewares to code.
Fast and simple command line tool to setup the needed files to quickly create Telegram bots powered by the grammY bot framework. This tool allows you to create projects from several templates, maintained by both official team and third-party users.
Here is a preview of the tool: https://asciinema.org/a/504541
Install using npm
npm i -g @grammyjs/create-grammy@latest
Install using Go.
go install github.com/grammyjs/create-grammy@latest
After installation, run create-grammy command to use the tool. You can provide a project name as the first argument.
Open a pull request by adding your own templates to the templates.json file. There are currently three platforms that you can add templates to: Deno, Node.js, and other templates.
Each template should contain the following fields:
name
— Name to be shown in the templates list in CLI. Recommended to use "owner/repository" as the name if it's a repository.type
— repository or subfolder. If your template is an entire repository, userepository
as type, or if it is a subfolder in a repository usesubfolder
as the type.owner
— GitHub repository owner.repository
— GitHub repository name.docker_prompt
— Should the CLI prompt the user to add default docker files.tsconfig_prompt
— Should the CLI prompt the user to add the default tsconfig.json file.
You also need to add the following fields according to your template:
branch
— Primary repository branch name. Try your best to keep that branch up-to-date.
path
— Path to the subfolder where the template is located at.
cache_file
— When the user chose to cache dependencies,deno cache
command will get executed for the specified file. Point to deps.ts, or the entry point of the template.