Skip to content

Commit 56f0079

Browse files
docs: update cli help strings
Signed-off-by: Mathew Wicks <[email protected]>
1 parent 1bc4590 commit 56f0079

File tree

3 files changed

+64
-22
lines changed

3 files changed

+64
-22
lines changed

cmd/deploykf/generate.go

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,47 @@ import (
1515
"github.com/deployKF/cli/internal/version"
1616
)
1717

18-
const generateHelp = `
19-
XXXXXXXXXX
20-
XXXXXXXXXX
21-
XXXXXXXXXX
22-
XXXXXXXXXX
18+
const generateHelp = `This command will generate an output folder containing Kubernetes manifests.
19+
20+
ARGUMENTS:
21+
----------------
22+
23+
You must provide either '--source-version' OR '--source-path' to specify the source of the generator:
24+
- If '--source-version' is provided, the provided version tag will be downloaded from the 'deployKF/deployKF' GitHub.
25+
- If '--source-path' is provided, the source will be read from the provided local directory or '.zip' file.
26+
27+
You may provide one or more '--values' files that contain your configuration values:
28+
- For more information on how to structure your values files, see the 'deployKF/deployKF' GitHub repository.
29+
30+
You must provide '--output-dir' to specify the output directory for the generated manifests:
31+
- If the directory does not exist, it will be created.
32+
- If the directory is non-empty, it will be cleaned before generating the manifests.
33+
However, it must contain a '.deploykf_output' marker file, otherwise the command will fail.
34+
35+
OUTPUT:
36+
----------------
37+
38+
The '.deploykf_output' marker file contains the following information:
39+
- generated_at: the time the generator was run
40+
- source_version: the source version that was used (if '--source-version' was provided)
41+
- source_path: the path of the source artifact that was used
42+
- source_hash: the SHA256 hash of the source artifact that was used
43+
- cli_version: the version of the deployKF CLI that was used
44+
45+
EXAMPLES:
46+
----------------
47+
48+
To generate manifests from a GitHub source version:
49+
50+
$ deploykf generate --source-version v0.1.0 --values ./values.yaml --output-dir ./GENERATOR_OUTPUT
51+
52+
To generate manifests from a local source zip file:
53+
54+
$ deploykf generate --source-path ./deploykf.zip --values ./values.yaml --output-dir ./GENERATOR_OUTPUT
55+
56+
To generate manifests from a local source directory:
57+
58+
$ deploykf generate --source-path ./deploykf --values ./values.yaml --output-dir ./GENERATOR_OUTPUT
2359
`
2460

2561
type generateOptions struct {
@@ -34,18 +70,18 @@ func newGenerateCmd(out io.Writer) *cobra.Command {
3470

3571
var cmd = &cobra.Command{
3672
Use: "generate",
37-
Short: "XXXXXXXXXX",
73+
Short: "Generate Kubernetes manifests from deployKF templates and config values",
3874
Long: generateHelp,
3975
RunE: func(cmd *cobra.Command, args []string) error {
4076
return o.run(out)
4177
},
4278
}
4379

4480
// add local flags
45-
cmd.Flags().StringVarP(&o.sourceVersion, "source-version", "V", "", "XXXXXXX")
46-
cmd.Flags().StringVar(&o.sourcePath, "source-path", "", "")
47-
cmd.Flags().StringSliceVarP(&o.values, "values", "f", []string{}, "XXXXXXX")
48-
cmd.Flags().StringVarP(&o.outputDir, "output-dir", "O", "", "XXXXXXX")
81+
cmd.Flags().StringVarP(&o.sourceVersion, "source-version", "V", "", "a version tag from the 'deployKF/deployKF' GitHub repository")
82+
cmd.Flags().StringVar(&o.sourcePath, "source-path", "", "a local path to a directory or '.zip' file containing a generator source")
83+
cmd.Flags().StringSliceVarP(&o.values, "values", "f", []string{}, "a YAML file containing configuration values")
84+
cmd.Flags().StringVarP(&o.outputDir, "output-dir", "O", "", "the output directory in which to generate the manifests")
4985

5086
// mark local flags
5187
cmd.MarkFlagsMutuallyExclusive("source-version", "source-path")
@@ -56,13 +92,11 @@ func newGenerateCmd(out io.Writer) *cobra.Command {
5692

5793
func (o *generateOptions) run(out io.Writer) error {
5894
// TODO: verify the provided `--values`:
59-
// - ensure we test with multiple provided values files (also try with none)
60-
// - check the YAML schema against a spec that is defined in the generator
61-
// - check that all listed files exist
62-
// - consider more complex verification, like mutually-exclusive fields, etc.
95+
// - check the YAML schema against a spec that is defined in the generator source
96+
// - check that all provided file paths exist (before gomplate fails)
6397

6498
// initialise the source helper
65-
// TODO: let users provide their own repo/owner
99+
// TODO: let users provide their own repo/owner for the source
66100
sourceHelper := generate.NewSourceHelper()
67101

68102
// create a temporary directory to store our generator source,

cmd/deploykf/root.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@ import (
77
"github.com/spf13/cobra"
88
)
99

10-
const rootHelp = `
11-
XXXXXXXXXX
12-
XXXXXXXXXX
13-
XXXXXXXXXX
14-
XXXXXXXXXX
10+
const rootHelp = `deployKF is your open-source helper for deploying MLOps tools on Kubernetes.
11+
12+
Common actions for deployKF:
13+
14+
- deploykf generate: Generate Kubernetes manifests from deployKF templates and config values
15+
16+
The default directories depend on the Operating System. The defaults are listed below:
17+
18+
| Operating System | Assets Cache Path |
19+
|------------------|--------------------------------|
20+
| Linux | $HOME/.deploykf/assets |
21+
| macOS | $HOME/.deploykf/assets |
22+
| Windows | %userprofile%\.deploykf\assets |
1523
`
1624

1725
func newRootCmd(out io.Writer) *cobra.Command {
1826
var cmd = &cobra.Command{
1927
Use: "deploykf",
20-
Short: "XXXXXXXXXX",
28+
Short: "deployKF is your open-source helper for deploying MLOps tools on Kubernetes",
2129
Long: rootHelp,
2230
SilenceUsage: true,
2331
}

cmd/deploykf/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func newVersionCmd(out io.Writer) *cobra.Command {
4141

4242
var cmd = &cobra.Command{
4343
Use: "version",
44-
Short: "Print version information",
44+
Short: "Print CLI version information",
4545
Long: versionHelp,
4646
Args: require.NoArgs,
4747
RunE: func(cmd *cobra.Command, args []string) error {

0 commit comments

Comments
 (0)