Repository: cli/cli
File: pkg/cmd/project/project.go (Go)

Code before:
	cmdFieldCreate "github.com/cli/cli/v2/pkg/cmd/project/field-create"
	cmdFieldDelete "github.com/cli/cli/v2/pkg/cmd/project/field-delete"
	cmdFieldList "github.com/cli/cli/v2/pkg/cmd/project/field-list"
	cmdItemAdd "github.com/cli/cli/v2/pkg/cmd/project/item-add"
	cmdItemArchive "github.com/cli/cli/v2/pkg/cmd/project/item-archive"
	cmdItemCreate "github.com/cli/cli/v2/pkg/cmd/project/item-create"
	cmdItemDelete "github.com/cli/cli/v2/pkg/cmd/project/item-delete"
	cmdItemEdit "github.com/cli/cli/v2/pkg/cmd/project/item-edit"
	cmdItemList "github.com/cli/cli/v2/pkg/cmd/project/item-list"
	cmdLink "github.com/cli/cli/v2/pkg/cmd/project/link"
	cmdList "github.com/cli/cli/v2/pkg/cmd/project/list"
	cmdTemplate "github.com/cli/cli/v2/pkg/cmd/project/mark-template"
	cmdUnlink "github.com/cli/cli/v2/pkg/cmd/project/unlink"
	cmdView "github.com/cli/cli/v2/pkg/cmd/project/view"
	"github.com/cli/cli/v2/pkg/cmdutil"
	"github.com/spf13/cobra"
)

func NewCmdProject(f *cmdutil.Factory) *cobra.Command {
	var cmd = &cobra.Command{
		Use:   "project <command>",
		Short: "Work with GitHub Projects.",
		Long: heredoc.Docf(`
			Work with GitHub Projects.

			Note that the token you are using must have 'project' scope,
			which is not set by default. You can verify your token scope
			by running 'gh auth status' and add the project scope by
			running %[1]sgh auth refresh -s project%[1]s.
		`, "`"),
		Example: heredoc.Doc(`
			$ gh project create --owner monalisa --title "Roadmap"
			$ gh project view 1 --owner cli --web
			$ gh project field-list 1 --owner cli
			$ gh project item-list 1 --owner cli
		`),
		GroupID: "core",
	}

	cmd.AddCommand(cmdList.NewCmdList(f, nil))
	cmd.AddCommand(cmdCreate.NewCmdCreate(f, nil))
	cmd.AddCommand(cmdCopy.NewCmdCopy(f, nil))
	cmd.AddCommand(cmdClose.NewCmdClose(f, nil))
	cmd.AddCommand(cmdDelete.NewCmdDelete(f, nil))
	cmd.AddCommand(cmdEdit.NewCmdEdit(f, nil))
	cmd.AddCommand(cmdLink.NewCmdLink(f, nil))
	cmd.AddCommand(cmdView.NewCmdView(f, nil))
	cmd.AddCommand(cmdTemplate.NewCmdMarkTemplate(f, nil))
	cmd.AddCommand(cmdUnlink.NewCmdUnlink(f, nil))

	// items

Review comment (security):
```suggestion
			Note that the token you are using must have %[1]sproject%[1]s scope,
```

Bringing this in line with `gh auth login` doc behavior:

https://github.com/cli/cli/blob/69fff52026428c0130d812037573b5c9cc0e77bb/pkg/cmd/auth/login/login.go#L72

Code after:
	cmdFieldCreate "github.com/cli/cli/v2/pkg/cmd/project/field-create"
	cmdFieldDelete "github.com/cli/cli/v2/pkg/cmd/project/field-delete"
	cmdFieldList "github.com/cli/cli/v2/pkg/cmd/project/field-list"
	cmdItemAdd "github.com/cli/cli/v2/pkg/cmd/project/item-add"
	cmdItemArchive "github.com/cli/cli/v2/pkg/cmd/project/item-archive"
	cmdItemCreate "github.com/cli/cli/v2/pkg/cmd/project/item-create"
	cmdItemDelete "github.com/cli/cli/v2/pkg/cmd/project/item-delete"
	cmdItemEdit "github.com/cli/cli/v2/pkg/cmd/project/item-edit"
	cmdItemList "github.com/cli/cli/v2/pkg/cmd/project/item-list"
	cmdLink "github.com/cli/cli/v2/pkg/cmd/project/link"
	cmdList "github.com/cli/cli/v2/pkg/cmd/project/list"
	cmdTemplate "github.com/cli/cli/v2/pkg/cmd/project/mark-template"
	cmdUnlink "github.com/cli/cli/v2/pkg/cmd/project/unlink"
	cmdView "github.com/cli/cli/v2/pkg/cmd/project/view"
	"github.com/cli/cli/v2/pkg/cmdutil"
	"github.com/spf13/cobra"
)

func NewCmdProject(f *cmdutil.Factory) *cobra.Command {
	var cmd = &cobra.Command{
		Use:   "project <command>",
		Short: "Work with GitHub Projects.",
		Long: heredoc.Docf(`
			Work with GitHub Projects.

			The minimum required scope for the token is: %[1]sproject%[1]s.
			You can verify your token scope by running %[1]sgh auth status%[1]s and
			add the %[1]sproject%[1]s scope by running %[1]sgh auth refresh -s project%[1]s.
		`, "`"),
		Example: heredoc.Doc(`
			$ gh project create --owner monalisa --title "Roadmap"
			$ gh project view 1 --owner cli --web
			$ gh project field-list 1 --owner cli
			$ gh project item-list 1 --owner cli
		`),
		GroupID: "core",
	}

	cmd.AddCommand(cmdList.NewCmdList(f, nil))
	cmd.AddCommand(cmdCreate.NewCmdCreate(f, nil))
	cmd.AddCommand(cmdCopy.NewCmdCopy(f, nil))
	cmd.AddCommand(cmdClose.NewCmdClose(f, nil))
	cmd.AddCommand(cmdDelete.NewCmdDelete(f, nil))
	cmd.AddCommand(cmdEdit.NewCmdEdit(f, nil))
	cmd.AddCommand(cmdLink.NewCmdLink(f, nil))
	cmd.AddCommand(cmdView.NewCmdView(f, nil))
	cmd.AddCommand(cmdTemplate.NewCmdMarkTemplate(f, nil))
	cmd.AddCommand(cmdUnlink.NewCmdUnlink(f, nil))

	// items
	cmd.AddCommand(cmdItemList.NewCmdList(f, nil))