Skip to main content

vers init

Initialize a new vers project with a vers.toml configuration file.

Usage

vers init                                    # Initialize with defaults
vers init --name my-project                  # Set custom project name
vers init --mem-size 1024 --vcpu-count 2     # Override VM settings

Options

OptionDefaultDescription
--name, -nDirectory nameProject name
--mem-size512Memory size in MiB
--vcpu-count1Number of virtual CPUs
--rootfs”default”Name of the rootfs image
--kernel”default.bin”Name of the kernel image
--dockerfile”Dockerfile”Name of the Docker file
--fs-size-cluster1024Total cluster filesystem size in MiB
--fs-size-vm512VM filesystem size in MiB

Examples

Initialize with defaults

vers init

Customize project settings

vers init --name my-web-app --mem-size 1024 --vcpu-count 2

Machine learning project

vers init --name ml-experiment --mem-size 2048 --vcpu-count 4

What gets created

Configuration file (vers.toml)

[machine]
mem_size_mib = 512
vcpu_count = 1
fs_size_cluster_mib = 1024
fs_size_vm_mib = 512

[rootfs]
name = "default"

[kernel]
name = "default.bin"

[builder]
name = "none"
dockerfile = "Dockerfile"

Repository structure (.vers/)

.vers/
├── HEAD              # Current VM pointer (initially empty)
├── config            # Repository configuration
└── logs/
    └── commits/      # Commit history storage

Git integration (.gitignore)

Automatically creates or updates .gitignore to exclude Vers internals from version control.

How it works

The init command:
  1. Authentication check: Prompts for login if no API key exists
  2. Directory creation: Creates .vers/ directory structure
  3. Configuration: Generates vers.toml with specified or default values
  4. Git integration: Creates/updates .gitignore with Vers-specific entries
  5. Local setup: Initializes empty HEAD file and config

Authentication

If this is your first time using Vers, init will prompt you to authenticate:
vers init
# Prompts for login if not already authenticated

Configuration details

The generated vers.toml uses these sections:
  • [machine]: VM resource allocation (memory, CPU, storage)
  • [rootfs]: Base filesystem image configuration
  • [kernel]: Kernel image specification
  • [builder]: Build system configuration (Docker, etc.)
You can edit vers.toml after initialization to adjust settings.

Prerequisites

  • Write permissions in the current directory
  • Network connectivity for authentication (if not already logged in)

See Also

  • vers up - Start your environment after initialization
  • vers login - Authenticate with Vers platform