Skip to content

vx.toml Reference

Complete reference for the vx.toml project configuration file.

File Location

Place vx.toml in your project root. vx searches for it in the current directory and parent directories.

Version Requirement

Use min_version to specify the minimum vx version required:

toml
min_version = "0.6.0"

Complete Example

toml
min_version = "0.6.0"

[project]
name = "my-fullstack-app"
description = "AI-powered fullstack application"
version = "1.0.0"
license = "MIT"
repository = "https://github.com/org/repo"

[tools]
node = "20"
uv = "latest"
go = "1.22"
rust = "stable"

[tools.node]
version = "20"
postinstall = "corepack enable"
os = ["linux", "darwin", "windows"]

[python]
version = "3.12"
venv = ".venv"
package_manager = "uv"

[python.dependencies]
requirements = ["requirements.txt", "requirements-dev.txt"]
packages = ["pytest", "black", "ruff"]
git = ["https://github.com/user/repo.git"]
dev = ["pytest", "mypy"]

[env]
NODE_ENV = "development"
DEBUG = "true"

[env.required]
API_KEY = "Your API key"
DATABASE_URL = "Database connection string"

[env.optional]
CACHE_DIR = "Optional cache directory"

[env.secrets]
provider = "auto"
items = ["DATABASE_URL", "API_KEY"]

[scripts]
dev = "npm run dev"
test = "pytest"
build = "go build -o app"

[scripts.start]
command = "python main.py"
description = "Start the server"
args = ["--host", "0.0.0.0", "--port", "8080"]
cwd = "src"
env = { DEBUG = "true" }
depends = ["build"]

[settings]
auto_install = true
parallel_install = true
cache_duration = "7d"
shell = "auto"
log_level = "info"

[hooks]
pre_setup = "echo 'Starting setup...'"
post_setup = ["vx run db:migrate", "vx run seed"]
pre_commit = "vx run lint && vx run test:unit"
enter = "vx sync --check"

[services.database]
image = "postgres:16"
ports = ["5432:5432"]
env = { POSTGRES_PASSWORD = "dev" }
healthcheck = "pg_isready"

[services.redis]
image = "redis:7-alpine"
ports = ["6379:6379"]

[services.app]
command = "npm run dev"
depends_on = ["database", "redis"]
ports = ["3000:3000"]
env_file = ".env.local"

[dependencies]
lockfile = true
audit = true
auto_update = "minor"

[dependencies.node]
package_manager = "pnpm"
registry = "https://registry.npmmirror.com"

[dependencies.python]
index_url = "https://pypi.tuna.tsinghua.edu.cn/simple"

Sections

[project]

Project metadata.

FieldTypeDescription
namestringProject name
descriptionstringProject description
versionstringProject version
licensestringLicense identifier (e.g., MIT, Apache-2.0)
repositorystringRepository URL
toml
[project]
name = "my-project"
description = "A sample project"
version = "1.0.0"
license = "MIT"
repository = "https://github.com/org/repo"

[tools]

Tool versions to use. Supports simple version strings or detailed configuration.

Simple Version

toml
[tools]
node = "20"          # Major version
uv = "latest"        # Latest stable
go = "1.21.5"        # Exact version
rust = "stable"      # Channel

Detailed Configuration

toml
[tools.node]
version = "20"
postinstall = "corepack enable"
os = ["linux", "darwin", "windows"]
install_env = { NODE_OPTIONS = "--max-old-space-size=4096" }
FieldTypeDescription
versionstringVersion string
postinstallstringCommand to run after installation
osstring[]Limit to specific operating systems
install_envtableEnvironment variables for installation

Version Specifiers

FormatExampleDescription
Major"20"Latest 20.x.x
Minor"20.10"Latest 20.10.x
Exact"20.10.0"Exact version
Latest"latest"Latest stable
LTS"lts"Latest LTS (Node.js)
Channel"stable"Channel (Rust)

[python]

Python environment configuration.

FieldTypeDefaultDescription
versionstring-Python version
venvstring".venv"Virtual environment path
package_managerstring"uv"Package manager (uv, pip, poetry)
toml
[python]
version = "3.12"
venv = ".venv"
package_manager = "uv"

[python.dependencies]

Python dependencies.

FieldTypeDescription
requirementsstring[]Requirements files
packagesstring[]Direct packages
gitstring[]Git URLs
devstring[]Dev dependencies
toml
[python.dependencies]
requirements = ["requirements.txt"]
packages = ["requests", "pandas"]
git = ["https://github.com/user/repo.git"]
dev = ["pytest", "black"]

[env]

Environment variables with support for required/optional declarations and secrets.

Static Variables

toml
[env]
NODE_ENV = "development"
DEBUG = "true"

Required Variables

Variables that must be set (vx will warn if missing):

toml
[env.required]
API_KEY = "Description of the variable"
DATABASE_URL = "Database connection string"

Optional Variables

Optional variables with descriptions:

toml
[env.optional]
CACHE_DIR = "Optional cache directory"
LOG_LEVEL = "Logging level (default: info)"

Secrets

Load secrets from secure storage:

toml
[env.secrets]
provider = "auto"  # auto | 1password | vault | aws-secrets
items = ["DATABASE_URL", "API_KEY"]

[scripts]

Runnable scripts with support for simple commands and detailed configuration.

Simple Scripts

toml
[scripts]
dev = "npm run dev"
test = "pytest"
build = "go build -o app"

Detailed Scripts

toml
[scripts.start]
command = "python main.py"
description = "Start the server"
args = ["--host", "0.0.0.0"]
cwd = "src"
env = { DEBUG = "true" }
depends = ["build"]
FieldTypeDescription
commandstringCommand to run
descriptionstringHuman-readable description
argsstring[]Default arguments
cwdstringWorking directory
envtableEnvironment variables
dependsstring[]Scripts to run first

[settings]

Behavior settings.

FieldTypeDefaultDescription
auto_installbooltrueAuto-install missing tools
parallel_installbooltrueInstall in parallel
cache_durationstring"7d"Cache duration
shellstring"auto"Shell to use (auto, bash, zsh, fish, pwsh)
log_levelstring"info"Log level
toml
[settings]
auto_install = true
parallel_install = true
cache_duration = "7d"
shell = "auto"
log_level = "info"

[settings.experimental]
monorepo = false
workspaces = false

[hooks] v0.6.0+

Lifecycle hooks for automation.

HookWhen it runs
pre_setupBefore vx setup
post_setupAfter vx setup
pre_commitBefore git commit (requires git hooks setup)
enterWhen entering project directory
toml
[hooks]
pre_setup = "echo 'Starting setup...'"
post_setup = ["vx run db:migrate", "vx run seed"]
pre_commit = "vx run lint && vx run test:unit"
enter = "vx sync --check"

[hooks.custom]
deploy = "vx run build && vx run deploy"

Hooks can be a single command string or an array of commands.

[services] v0.6.0+

Service definitions for local development (similar to docker-compose).

toml
[services.database]
image = "postgres:16"
ports = ["5432:5432"]
env = { POSTGRES_PASSWORD = "dev" }
volumes = ["./data:/var/lib/postgresql/data"]
healthcheck = "pg_isready"

[services.redis]
image = "redis:7-alpine"
ports = ["6379:6379"]

[services.app]
command = "npm run dev"
depends_on = ["database", "redis"]
ports = ["3000:3000"]
env_file = ".env.local"
working_dir = "./frontend"
FieldTypeDescription
imagestringDocker image
commandstringCommand to run (for non-container services)
portsstring[]Port mappings (host:container)
envtableEnvironment variables
env_filestringEnvironment file path
volumesstring[]Volume mounts
depends_onstring[]Service dependencies
healthcheckstringHealth check command
working_dirstringWorking directory

[dependencies] v0.6.0+

Smart dependency management configuration.

toml
[dependencies]
lockfile = true
audit = true
auto_update = "minor"  # none | patch | minor | major

[dependencies.node]
package_manager = "pnpm"  # npm | yarn | pnpm | bun
registry = "https://registry.npmmirror.com"

[dependencies.python]
index_url = "https://pypi.tuna.tsinghua.edu.cn/simple"
extra_index_urls = []

[dependencies.constraints]
"lodash" = ">=4.17.21"  # Security constraint
"*" = { licenses = ["MIT", "Apache-2.0", "BSD-3-Clause"] }
FieldTypeDescription
lockfileboolGenerate lockfile
auditboolRun security audit
auto_updatestringAuto-update strategy
nodetableNode.js specific settings
pythontablePython specific settings
constraintstableDependency constraints

Future Sections (Planned)

The following sections are planned for future releases:

SectionVersionDescription
[ai]v0.7.0AI code generation integration
[docs]v0.7.0Documentation auto-generation
[team]v0.8.0Team collaboration rules
[remote]v0.8.0Remote development environments
[security]v0.9.0Security scanning rules
[test]v0.9.0Test pipeline configuration
[telemetry]v0.9.0Performance monitoring
[container]v1.0.0Container deployment
[versioning]v1.0.0Version control strategy

Validation

vx validates vx.toml on load. Common errors:

  • Invalid TOML syntax
  • Unknown tool names
  • Invalid version specifiers
  • Missing required fields
  • Circular script dependencies

Run validation manually:

bash
vx config validate

Tips

  1. Commit to git: Share configuration with team
  2. Use specific versions: For reproducibility in production
  3. Document env vars: Use descriptions in [env.required]
  4. Define scripts: Make common tasks easy to discover
  5. Use hooks: Automate repetitive setup tasks
  6. Service dependencies: Ensure services start in correct order

See Also

Released under the MIT License.