
## Install Vary

One command installs the [varyup](/docs/varyup/) toolchain manager and the latest Vary compiler.

**Linux / macOS:**

```bash
curl -fsSL https://github.com/ccollicutt/vary/releases/latest/download/install.sh | sh
```

**Windows (PowerShell):**

```powershell
irm https://github.com/ccollicutt/vary/releases/latest/download/install.ps1 | iex
```

After running the installer, add `~/.vary/bin` (Linux/macOS) or `%LOCALAPPDATA%\vary\bin` (Windows) to your PATH. See the platform guides below for the exact command.

Restart your shell, then verify:

```bash
vary --version
```

For manual install steps or options, see the platform guides: [Linux](/docs/install-linux/), [Windows](/docs/install-windows/), [macOS](/docs/install-macos/).

---

## Your first program

Create a file called `hello.vary`:

```vary
print("Hello, world!")
```

Run it:

```bash
vary run hello.vary
```

Vary runs top-level code directly. No `main` function needed.

## A slightly bigger example

```vary
def greet(name: Str) -> Str {
    return f"Hello, {name}!"
}

let message = greet("Vary")
print(message)
```

Functions use `def`, types go after the parameter name, and blocks use braces.

## Project structure

Create a new project with:

```bash
vary new my-project
```

This generates:

```text
my-project/
  .vscode/
    tasks.json
  src/
    main.vary
  test/
    main_test.vary
  vary.toml
  README.md
  .gitignore
```

The [`vary.toml`](/docs/configuration/) file configures your project name, source directories, test settings, and mutation testing policy. The `.vscode/` directory includes pre-configured build, test, format, and mutate tasks.

To include a [Dev Container](/docs/vscode/) configuration, pass `--devcontainer`:

```bash
vary new my-project --devcontainer
```

This adds a `.devcontainer/devcontainer.json` so anyone who clones the project can open it in VS Code and start working immediately.

## Common commands

```bash
vary run src/main.vary           # compile and run
vary check src/main.vary         # type-check without running
vary test test/                  # run all tests in a directory
vary test test/main_test.vary    # run a single test file
vary fmt src/                    # format source files
vary mutate src/main.vary --tests test/main_test.vary  # mutation testing
```

## Running tests

Vary has a built-in test runner. Write tests with the `test` block syntax:

```vary-snippet
test "greet includes the name" {
    observe greet("Alice") == "Hello, Alice!"
}
```

Run them:

```bash
vary test test/main_test.vary
```

## Writing Vary with LLMs

LLMs don't have training data on Vary, but we ship an [LLM skill](/docs/writing-vary-with-llms/) that gives AI coding assistants the full language reference (grammar, types, stdlib, and toolchain commands). With the skill loaded, tools like Claude Code write valid Vary code without falling back to Python habits.

The skill is bundled in every Vary installation at `llm-skill/`. To use it, point your AI coding tool at that directory. See [Writing Vary with LLMs](/docs/writing-vary-with-llms/) for setup details.

## Next steps

| Topic | What you'll learn |
|-------|-------------------|
| [VS Code](/docs/vscode/) | Dev Container setup, LSP features, configuration |
| [Writing Vary with LLMs](/docs/writing-vary-with-llms/) | Using AI coding tools with Vary |
| [Syntax overview](/docs/syntax-overview/) | How the language works |
| [Types](/docs/types/) | Vary's type system |
| [Testing](/docs/test-dsl/) | The test runner and mutation testing |

