Environment variables
Setup, run and archive scripts, terminals and agents in a workspace get these variables.
They come after the repository's [environment_variables], so a repository cannot override them.
| Variable | Value |
|---|---|
KOREV_WORKSPACE_NAME | The workspace name |
KOREV_WORKSPACE_PATH | The worktree path |
KOREV_WORKSPACE_ID | The workspace id |
KOREV_ROOT_PATH | The repository's main checkout |
KOREV_DEFAULT_BRANCH | The workspace's target branch |
KOREV_PORT | The first of the ten ports reserved for the workspace |
KOREV_IS_LOCAL | 1 |
Agent processes also get KOREV_SESSION_ID.
With Sign agent commits with a Korev key on, agents and scripts also get KOREV_SIGNING_KEY and GIT_CONFIG_* variables. These make git sign each commit with the Korev key. Your own terminal does not get them.
Ask chats do not run in a workspace, so they get none of these.
Ports
KOREV_PORT starts at 55000 and goes up in steps of ten, one block per active workspace. A workspace owns $KOREV_PORT to $KOREV_PORT+9. A restored workspace gets a new block.
In scripts, the shell expands $KOREV_PORT and $((KOREV_PORT + 1)). In preview_urls, Korev expands them itself.
Variables from your login shell
Korev reads these from your login shell when it starts, and passes them to everything it starts:
PATHSSH_AUTH_SOCK, so git and agents can use your SSH agent, for example Secretive or 1PasswordSSL_CERT_FILE,SSL_CERT_DIR,NODE_EXTRA_CA_CERTS,REQUESTS_CA_BUNDLEandGIT_SSL_CAINFO, so tools trust your company's certificates
Korev does not copy any other variable from your shell, so a token you export in ~/.zshrc does not reach the agents. Put the variables a workspace needs in the repository's [environment_variables]. After you change your shell config, quit and open Korev again.
Variables Korev removes
Korev removes GH_TOKEN, GITHUB_TOKEN, GH_ENTERPRISE_TOKEN and GITHUB_ENTERPRISE_TOKEN from everything it starts, so gh uses its own sign-in.