Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ sudo rpm -ivh cosign-${LATEST_VERSION}-1.x86_64.rpm
```

</details>
<details markdown="1"><summary><b>Linux: dkpg</b></summary><br>
<details markdown="1"><summary><b>Linux: dpkg</b></summary><br>

```sh
LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v")
Expand Down Expand Up @@ -320,7 +320,59 @@ nix-shell -p tenv

<a id="manual-installation"></a>
#### Manual Installation
Get the most recent packaged binaries (`.deb`, `.rpm`, `.apk`, `pkg.tar.zst `, `.zip` or `.tar.gz` format) by visiting the [release page](https://github.com/tofuutils/tenv/releases). After downloading, unzip the folder and seamlessly integrate it into your system's `PATH`.

Download the latest packaged binaries from the [release page](https://github.com/tofuutils/tenv/releases) (`.tar.gz` for Linux/macOS, `.zip` for Windows, or distro packages like `.deb`, `.rpm`, `.apk`, `pkg.tar.zst`).

<details markdown="1"><summary><b>Linux: system-wide installation (requires root)</b></summary><br>

If you have root access via `sudo` or `su`, you can install tenv for all users on the system.

Determine your architecture (`x86_64`, `arm64`, `armv6`, or `i386`) and run:

```sh
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prose at line 330 tells users to "Determine your architecture (x86_64, arm64, armv6, or i386) and run:", but both code blocks (here and at line 356) still hardcode x86_64. A user on arm64 who follows the instruction would run a command that downloads the wrong binary with no indication of where to substitute.

Introduce an ARCH variable at the top of each code block:

ARCH=x86_64  # change to arm64, armv6, or i386 if needed
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_${ARCH}.tar.gz"

sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C /usr/local/bin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tenv release tarball contains non-binary files alongside the executables: CHANGELOG.md, LICENSE, and README.md. Running sudo tar xzf ... -C /usr/local/bin extracts all of them directly into /usr/local/bin, which is incorrect.

Extract to a staging directory first, then copy only the binaries:

TMP=$(mktemp -d)
sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C "$TMP"
sudo cp "$TMP"/tenv "$TMP"/tofu "$TMP"/terraform "$TMP"/terragrunt "$TMP"/terramate "$TMP"/tf "$TMP"/atmos /usr/local/bin/
rm -rf "$TMP"

```

This extracts the binaries directly into `/usr/local/bin`, which is typically already in `$PATH`.

Alternatively, install to a dedicated directory and create symlinks:

```sh
sudo mkdir -p /usr/local/tenv
sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C /usr/local/tenv
sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tarball ships seven binaries: tenv, tofu, terraform, terragrunt, terramate, tf, and atmos. Creating a symlink only for tenv leaves the other six inaccessible, making this alternative approach functionally incomplete compared to the direct-to-bin option above.

Create symlinks for all binaries:

for bin in tenv tofu terraform terragrunt terramate tf atmos; do
  sudo ln -sf "/usr/local/tenv/$bin" "/usr/local/bin/$bin"
done

The same gap applies to the user-local section at line 358: tar xzf ... -C ~/bin will also deposit CHANGELOG.md, LICENSE, and README.md into ~/bin.

```

</details>

<details markdown="1"><summary><b>Linux: user-local installation (no root required)</b></summary><br>

If you do not have root access, install tenv into your home directory:

```sh
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz"
mkdir -p ~/bin
tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C ~/bin
```

Then ensure `~/bin` is on your `PATH`. Add the following to `~/.profile` (or `~/.bashrc`):

```sh
export PATH="$HOME/bin:$PATH"
```

Reload your shell:

```sh
source ~/.profile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reload command hardcodes source ~/.profile, but the preceding prose tells users to add the export to ~/.profile (or ~/.bashrc). A user who followed the parenthetical and edited ~/.bashrc would run source ~/.profile and see no effect.

On most modern Linux distros, ~/.bashrc is the right target for interactive shell configuration. Either change the source command to match whichever file was edited, or standardize on ~/.bashrc throughout:

source ~/.bashrc

```

> **Note:** tenv stores managed tool versions under `~/.tenv` by default. Without root, all installed tools are local to your user account.

</details>

<a id="docker-installation"></a>

Expand Down