snow init¶
Creates project directory from template.
Syntax¶
snow init
<path>
--template <template>
--template-source <template_source>
--variable <variables>
--no-interactive
--format <format>
--verbose
--debug
--silent
--enhanced-exit-codes
Arguments¶
pathDirectory to be initialized with the project. This directory must not already exist.
Options¶
--template TEXTwhich template (subdirectory of –template-source) should be used. If not provided, whole source will be used as the template.
--template-source TEXTlocal path to template directory or URL to git repository with templates. Default: https://github.com/snowflakedb/snowflake-cli-templates.
--variable, -D TEXTString in
key=valueformat. Provided variables will not be prompted for.--no-interactiveDisable prompting. Default: False.
--format [TABLE|JSON|JSON_EXT|CSV]Specifies the output format. Default: TABLE.
--verbose, -vDisplays log entries for log levels
infoand higher. Default: False.--debugDisplays log entries for log levels
debugand higher; debug logs contain additional information. Default: False.--silentTurns off intermediate output to console. Default: False.
--enhanced-exit-codesDifferentiate exit error codes based on failure type. Default: False.
--helpDisplays the help text for this command.
Usage notes¶
The snow init command initializes a directory specified in the <path> parameter with a chosen template. It renders all files mentioned in the files_to_render list in the template.yml, resolving all variables enclosed in <! … !>. If a template.yml file is not present in the template’s root directory, the command finishes with an error. For information about creating project templates, see Bootstrapping a project from a template.
By default, the command interactively prompts you for each parameter defined in the template.yml file. You can bypass the interactive prompts in the following ways:
Use the
-Doption to specify the values for each parameter contained in the project template.Use the
--no-interactiveoption to use default values, if defined, for each template parameter in thetemplate.ymlfile.Use a combination of the
-Dand--no-interactiveoptions to define values for some parameters and use the specified default values for the template.Note
If you do not provide a value using the
-Doption that does not have a corresponding default value defined, the snow init command terminates with an error.
Examples¶
Bootstrap a Snowpark project that prompts for the parameters specified in the
example_snowparktemplate contained in the snowflake-cli-templates Git repository.snow init new_snowpark_project --template example_snowpark Project identifier (used to determine artifacts stage path) [my_snowpark_project]: What stage should the procedures and functions be deployed to? [dev_deployment]: snowpark
Initialized the new project in new_snowpark_projectBootstrap a Streamlit project by using the
-Doption to provide the values for some of the parameters specified in the local../local_templates/example_streamlittemplate and prompt for others.snow init new_streamlit_project --template-source ../local_templates/example_streamlit -D query_warehouse=dev_wareshouse -D stage=testing Name of the streamlit app [streamlit_app]: My streamlit
Initialized the new project in new_streamlit_project