github.com/wmuizelaar/kpt@v0.0.0-20221018115725-bd564717b2ed/site/reference/cli/pkg/init/README.md (about)

     1  ---
     2  title: "`init`"
     3  linkTitle: "init"
     4  type: docs
     5  description: >
     6    Initialize an empty package.
     7  ---
     8  
     9  <!--mdtogo:Short
    10      Initialize an empty package.
    11  -->
    12  
    13  `init` initializes an existing empty directory as a kpt package by adding a
    14  Kptfile and a placeholder `README.md` file.
    15  
    16  ### Synopsis
    17  
    18  <!--mdtogo:Long-->
    19  
    20  ```
    21  kpt pkg init [DIR] [flags]
    22  ```
    23  
    24  #### Args
    25  
    26  ```
    27  DIR:
    28    init fails if DIR does not already exist. Defaults to the current working directory.
    29  ```
    30  
    31  #### Flags
    32  
    33  ```
    34  --description
    35    Short description of the package. (default "sample description")
    36  
    37  --keywords
    38    A list of keywords describing the package.
    39  
    40  --site
    41    Link to page with information about the package.
    42  ```
    43  
    44  <!--mdtogo-->
    45  
    46  ### Examples
    47  
    48  {{% hide %}}
    49  
    50  <!-- @makeWorkplace @verifyExamples-->
    51  
    52  ```
    53  # Set up workspace for the test.
    54  TEST_HOME=$(mktemp -d)
    55  cd $TEST_HOME
    56  ```
    57  
    58  {{% /hide %}}
    59  
    60  <!--mdtogo:Examples-->
    61  
    62  <!-- @pkgInit @verifyStaleExamples-->
    63  
    64  ```shell
    65  # Creates a new Kptfile with metadata in the cockroachdb directory.
    66  $ mkdir cockroachdb; kpt pkg init cockroachdb --keywords "cockroachdb,nosql,db"  \
    67      --description "my cockroachdb implementation"
    68  ```
    69  
    70  ```shell
    71  # Creates a new Kptfile without metadata in the current directory.
    72  $ kpt pkg init
    73  ```
    74  
    75  <!--mdtogo-->