lip pkg init
Create a lip.toml for a new package in the current directory.
Synopsis
lip pkg init [-h | --help]Description
lip pkg init asks for the package id, then writes lip.toml in the current working directory.
-
When
lip.tomlalready exists there, the command fails and writes nothing. -
lip asks on the terminal for the package id, a Go module path such as
github.com/user/repo, and asks again until the answer is valid. For a package in a git repository, the id is the path of the repository. -
It writes a package file with exactly these values,
<id>being your answer:tomlformat = 4 id = "<id>" version = "0.1.0" [[variants.""]] side = "server" platform = "win-x64"
When standard input or standard error is not a terminal, lip cannot ask, and the command fails instead. There is no option that gives the id; in a script, write lip.toml yourself.
The package installs nothing yet. See Creating packages for what to add.
lip pkg init is not a workspace operation: it needs no server, takes no lock, and touches nothing but lip.toml.
Options
| Option | Description |
|---|---|
-h, --help | Write the help and exit. |
Output
lip pkg init has no result: it writes nothing to standard output. The question and the final line are messages on standard error:
Enter the package id of the package (a Go module path, e.g. github.com/owner/repo):Exit status
| Code | Meaning |
|---|---|
0 | lip.toml was written. |
not 0 | A usage error; lip.toml exists; lip cannot ask; or the file cannot be written. |
Examples
cd MyMod
lip pkg initSee also
- Creating packages
- lip.toml
- Tools: Create lip.toml in the interface.