-
Notifications
You must be signed in to change notification settings - Fork 440
fix: improve init command help and docs
#7853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,10 +7,27 @@ export const createInitCommand = (program: BaseCommand) => | |||||||||||||
| program | ||||||||||||||
| .command('init') | ||||||||||||||
| .description( | ||||||||||||||
| 'Configure continuous deployment for a new or existing project. To create a new project without continuous deployment, use `netlify sites:create`', | ||||||||||||||
| `Initialize a Netlify project in the current directory | ||||||||||||||
|
|
||||||||||||||
| Links this directory to a new or existing Netlify project and saves the project ID locally. | ||||||||||||||
| \`netlify init\` can be used with or without Git/continuous deployment. | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify this. Be more explicit. Assume the user is initializing their very first Netlify project, so they aren't familiar with these concepts. |
||||||||||||||
|
|
||||||||||||||
| The init command can: | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| - Create a new Netlify project, or link to an existing one | ||||||||||||||
| - Add \`.netlify/\` to \`.gitignore\` | ||||||||||||||
| - Create or update \`netlify.toml\` with detected build settings (optional) | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| - Connect a Git repository for continuous deployment (optional) | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this link to the relevant page in the Netlify docs? |
||||||||||||||
|
|
||||||||||||||
| If no Git remote is detected, you can still create a project and deploy manually with \`netlify deploy\`.`, | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| ) | ||||||||||||||
| .option('-m, --manual', 'Manually configure a git remote for CI') | ||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What exactly does this mean? When should it be used? Document this. |
||||||||||||||
| .option('--git-remote-name <name>', 'Name of Git remote to use. e.g. "origin"') | ||||||||||||||
| .addExamples([ | ||||||||||||||
| 'netlify init', | ||||||||||||||
| 'netlify init --manual', | ||||||||||||||
| 'netlify init --force', | ||||||||||||||
| 'netlify init --git-remote-name upstream', | ||||||||||||||
|
Comment on lines
+27
to
+29
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include inline 'comments' explaining what these examples do
Suggested change
|
||||||||||||||
| ]) | ||||||||||||||
| .addHelpText('after', () => { | ||||||||||||||
| const docsUrl = 'https://docs.netlify.com/cli/get-started/' | ||||||||||||||
| return ` | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with "Configure a new or existing Netlify project in the current directory"
And let's keep some mention of
sites:create, but just not in the first line (which serves as the 'title'). Maybe near the bottom, after having explained everything thatinitdoes, callsites:createout as an alternative that does much less.