Install the Tecton CLI
This page is for the Tecton CLI on a terminal (typically on a laptop).
For installation information for the tecton
package for use in interactive
notebooks. Please refer to the instructions for your particular environment:
- Databricks: Connecting Databricks Notebooks
- EMR: Connecting EMR Notebook
- Snowflake: Connecting Snowflake Notebooks,
The Tecton CLI is primarily used for
managing workspaces,
applying feature repository changes to a workspace
(via the tecton apply
command), and creating API keys.
To set up the Tecton CLI on a terminal (typically on a laptop), follow these steps:
Install Python​
- The Tecton CLI for Spark (Databricks and EMR) supports Python >=3.8.
- The Tecton CLI for Snowflake supports Python >=3.8, <3.12.
If you are joining a team that already uses Tecton, install the version of the Tecton CLI and the same version of Python that are already in use in your organization.
New users should aim to install the most recent version of the Tecton CLI and of Python.
Python Environments​
Installing more than one Tecton CLI version into the same workspace can lead to inconsistent behavior. We recommend using Pyenv or Anaconda to manage your Tecton CLI and Python installations and environments:
Pyenv​
The popular Python version manager pyenv allows you to install different versions of Python, and the pyenv extension pyenv-virtualenv allows you to create a virtual environment using a specific Python version you've installed via pyenv. Once you've installed both packages, you can install Python 3.8 and create a virtual environment using it with the following commands. We use 3.8.12 as an example version of Python 3.8.
pyenv install 3.8.12
pyenv virtualenv 3.8.12 tecton
pyenv activate tecton
Anaconda​
Anaconda uses an alternative package manager to the standard Python pip
package management, however it can install pip packages as well. Anaconda's
package repository also has pre-compiled binaries for Python versions and
popular libraries which are handy if you have trouble building Python using a
Python version manager.
To install Python with Anaconda:
-
Install Anaconda. You can also use the stripped down Miniconda installer.
-
Create a new
conda
environment with Python 3.8:conda create -n tecton python=3.8 pip`.
# Add `nomkl` after `pip` for x86 Anaconda installs on Mac M1 computers -
Activate the conda environment with:
conda activate tecton
After completing your Pyenv or Anaconda installation, install the Tecton CLI.
Apple M1 (arm64) Silicon Considerations​
The Tecton CLI >= 0.4 supports Mac M1 machines without depending on the Rosetta2
library. The Tecton CLI pip
dependencies have arm64 wheels except for
grpcio
. To use the Tecton CLI >= 0.4 on Mac M1 machines:
- Update your macOS to Monterey 12.1 or higher.
- Update to the latest version of the XCode Command Line Tools.
- Install and compile the
grpcio
dependencies.
Contact Tecton support if you encounter any difficulties installing Tecton >= 0.4 with Monterey >= 12.1 on Mac M1 machines.
Install the Tecton CLI​
The Tecton CLI is hosted on PyPI and you can
install the latest version using pip
. To learn more about the stable and beta
Tecton CLI versions please see
Release Notes.
The pip
command to install the Tecton CLI depends on the data platform you are
using, as follows.
Data Platform | Command to Install Tecton CLI | Notes |
---|---|---|
Spark | pip install 'tecton[pyspark]' | Tecton support for Spark 2 installations reached end of life on December 31, 2021. |
Databricks | pip install 'tecton[databricks-connect]' | Supports databricks-connect users using Databricks as their Spark compute engine. See the Databricks Connect documentation for more information. |
Snowflake | pip install 'tecton[snowflake]' | Support for Tecton on Snowflake, which uses the Snowflake compute engine. |
Installation of the Tecton CLI when unit tests will be run​
If you are using Spark and you will be running
unit tests, use one of the following
commands, instead of pip install tecton
, to install the Tecton CLI:
- To install with Pyspark 3.1:
pip install 'tecton[pyspark]'
- To install with Pyspark 3.2:
pip install 'tecton[pyspark3.2]'
- To install with Pyspark 3.3:
pip install tecton pyspark==3.3
Tecton CLI installation examples​
👉 To install the latest stable release (recommended):
pip install tecton
👉 To install a specific version of the Tecton CLI:
pip install tecton==0.6.7
👉 To install the latest beta for a given minor release:
pip install 'tecton~=0.9.0b0' [--upgrade]
The PyPI Release History page has a complete list of the Tecton CLI versions, including beta versions.
Validate the Tecton CLI installation​
You can validate the installation using tecton version
. If the installation
succeeded, the output will contain the CLI version number and other information:
$ tecton version
Version: 0.5.7
Git Commit: a5ec28b4394217c27c93e9d1c4c8e721b48a4421
Build Datetime: 2022-04-11T21:19:14
Use the Tecton CLI to sign in to your deployment​
Automatic authentication (recommended)​
Connect the CLI to your Tecton deployment using tecton login
, which
automatically authenticates and sets credentials:
$ tecton login
Enter configuration. Press enter to use current value
Tecton Cluster URL [example: https://yourco.tecton.ai]: https://foo.tecton.ai
✅ Authentication successful!
Manual authentication​
If automatic authentication fails, use the --manual
flag to generate a URL
where an authentication code can be found.
$ tecton login --manual
Enter configuration. Press enter to use current value
Tecton Cluster URL [example: https://yourco.tecton.ai]: https://foo.tecton.ai
Requesting authorization for Tecton CLI via browser.
If browser doesn\'t open automatically, visit the following link: <go to this URL>
Paste the authentication code here:abcdef123456789
✅ Updated configuration at /Users/username/.tecton/config
Setting up Shell Completion​
The Tecton CLI supports shell completion (aka tab completion, autocomplete) for zsh, bash, and fish. For typical setups, shell completion can be set up as follows:
- zsh
- bash
- fish
# Generate and save the Tecton auto-complete script.
tecton completion --zsh > ~/.tecton-complete.zsh
# Enable zsh auto-completion. (Not needed if you already have auto-complete enabled, e.g. are using oh-my-zsh.)
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
# Add sourcing the script into your .zshrc.
echo '. ~/.tecton-complete.zsh' >> ~/.zshrc
# Generate and save the Tecton auto-complete script.
tecton completion --bash > ~/.tecton-complete.bash
# Add sourcing the script into your .bashrc.
echo '. ~/.tecton-complete.bash' >> ~/.bashrc
# Generate and save the Tecton auto-complete script to your fish configs.
tecton completion --fish > ~/.config/fish/completions/tecton.fish