env:set
Introduction
env:set asks for your forge or PyPI credentials and writes them into the workspace .env, under the names the rest of the CLI reads. tokens:setup explains how to get each token.
splent env:set forge
git.splent.io username: splent-dev
git.splent.io access token:
✔ git.splent.io configuration updated.
💡 Remember to reload environment variables:
source .env
The token is typed hidden.
Setting the forge credentials
env:set forge writes SPLENT_FORGE_USER and SPLENT_FORGE_TOKEN for the forge the workspace uses. With SPLENT_FORGE_HOST=github.com it writes GITHUB_USER and GITHUB_TOKEN instead. env:set github is a hidden alias.
Setting the PyPI token
splent env:set pypi
It asks for the token and writes TWINE_USERNAME=__token__ and TWINE_PASSWORD. feature:release, product:release, check:pypi and check:env read the token from there.
Using the wizard
splent env:set --wizard
A menu offers both, until you choose Exit. Without a subcommand or --wizard, splent env:set does nothing.
Reloading your shell
Inside the CLI container the shell exported .env when you entered it, and .env never overrides a variable the shell holds. So a changed token stays stale until you run source .env or open a new shell. A variable new to .env needs no reload. See Reloading after an edit.
Advanced
On github.com,
env:set forgealso removesSPLENT_FORGE_USERandSPLENT_FORGE_TOKENfrom.env, because the CLI reads them beforeGITHUB_USERandGITHUB_TOKEN. It says so, and when your shell exports either one itself it tells you tounsetit.
Reference
| Subcommand or option | Asks for | Writes |
|---|---|---|
forge |
Username and access token | SPLENT_FORGE_USER and SPLENT_FORGE_TOKEN, or GITHUB_USER and GITHUB_TOKEN on github.com |
pypi |
PyPI token | TWINE_USERNAME=__token__ and TWINE_PASSWORD |
--wizard |
Either, from a menu | The same |
It edits .env line by line. Comments, blank lines, the order and every untouched line stay. A variable already defined is updated in place, keeping an export prefix, and a later duplicate of it is dropped. A new one is appended. A value with a newline is refused.
The file is replaced in one atomic write that keeps its mode and owner. A failed write stops with Could not write <path> (<reason>). The previous file is unchanged.
The product’s environment, dev or prod, is not set here. product:up and product:deploy write SPLENT_ENV into the product’s docker/.env (see product:env).