Help us shape the future of Go! Take the 2026 Go Developer Survey

xenv

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT

README

xenv

xenv is a local development environment and SDK manager.

It manages:

  • SDK/toolchain activation, such as Go and Node.js
  • Environment variables
  • PATH entries
  • Project-local environment state through .xenv.toml
  • Shell integration for bash, zsh, PowerShell, and cmd/clink

Install

go install github.com/inhere/xenv/cmd/xenv@latest

Quick Start

Initialize configuration:

xenv init

Enable shell integration.

Bash:

eval "$(xenv shell --type bash)"

Zsh:

eval "$(xenv shell --type zsh)"

PowerShell:

Invoke-Expression (& xenv shell --type pwsh)

List configured SDKs:

xenv tools list

Index locally installed SDKs:

xenv tools index

Activate a version:

xenv use go:latest
xenv use node:20

Set environment variables:

xenv set APP_ENV local
xenv unset APP_ENV

Manage PATH:

xenv path add ./bin
xenv path remove ./bin

Project State

Use -s or --save to save changes to the nearest .xenv.toml file:

xenv use -s go:1.24
xenv set -s APP_ENV local
xenv path add -s ./bin

Example .xenv.toml:

paths = [
  "./bin",
]

[sdks]
go = "1.24"
node = "20"

[envs]
APP_ENV = "local"

Configuration

Default configuration path:

~/.config/xenv/config.yaml

Default state files:

~/.config/xenv/global.toml
~/.xenv/session/<session_id>.json

Local SDK index:

~/.xenv/tools.local.json

Development

Run tests:

go test ./...

Build:

go build ./cmd/xenv

Directories

Path Synopsis
cmd
xenv command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL