vix new
vix new creates a new Vix project.
Use it when you want to start an application, backend service, web project, Vue fullstack project, game project, or reusable C++ library.
vix new apiOverview
vix new is the project creation command in Vix.
It creates a ready-to-use project with:
- source files
- project configuration
- Vix metadata
- generated tasks
- build setup
- runtime configuration when needed
- template-specific structure
It is the recommended way to start a Vix project because it creates a structure that works immediately with:
vix build
vix run
vix dev
vix tests
vix check
vix task2
3
4
5
6
Usage
vix new <name|path> [options]Basic examples
# Create a default application
vix new api
# Create a project in the current directory
vix new .
# Create a backend service
vix new api --template backend
# Create a server-rendered web project
vix new blog --template web
# Create a Vue fullstack project
vix new dashboard --template vue
# Create a game project
vix new mario --game
# Create a game project with template syntax
vix new platformer --template game
# Create a header-only library
vix new tree --lib
# Create inside another directory
vix new blog -d ./projects
# Overwrite an existing directory
vix new api --force2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
What vix new can create
| Type | Command | Use when |
|---|---|---|
| Application | vix new api | You want a small runnable C++ app. |
| Application | vix new api --app | You want to be explicit about the default app template. |
| Backend | vix new api --template backend | You want a production-oriented API or backend service. |
| Web | vix new blog --template web | You want server-rendered HTML with Vix. |
| Vue | vix new dashboard --template vue | You want a Vue frontend with a Vix C++ backend. |
| Game | vix new mario --game | You want a Vix game project. |
| Game | vix new mario --template game | Same idea using template syntax. |
| Library | vix new tree --lib | You want a reusable header-only C++ library. |
Default behavior
By default, vix new creates an application project.
vix new apiThis is equivalent to:
vix new api --appUse the default application template when you want:
- a small executable app
- a simple HTTP app
- a local tool
- a demo
- a prototype
- a project that can grow later
Application template
Create an application:
vix new helloor:
vix new hello --appEnter the project:
cd helloBuild it:
vix buildRun it:
vix runStart development mode:
vix devThe application template is the smallest real Vix project.
It is useful when you want to start clean without a large backend, web, Vue, game, or library structure.
Backend template
Create a backend project:
vix new api --template backendEnter the project:
cd apiCreate your local environment file:
cp .env.example .envStart development mode:
vix devTest the health endpoint:
curl http://127.0.0.1:8080/healthUse the backend template when you need:
- API routes
- production-oriented folders
- config files
- health endpoints
- middleware-ready structure
- database-ready structure
- a stronger backend foundation than the default app template
Web template
Create a web project:
vix new blog --template webEnter the project:
cd blogCreate your local environment file:
cp .env.example .envStart development mode:
vix devOpen:
http://127.0.0.1:8080Use the web template when you want:
- server-rendered HTML
- static assets
- Vix templates
- a simple web app structure
- an app that does not need a separate frontend framework
Vue template
Create a Vue fullstack project:
vix new dashboard --template vueEnter the project:
cd dashboardInstall dependencies when needed:
vix installStart development mode:
vix devUse the Vue template when you want:
- a Vue frontend
- a Vix C++ backend
- one fullstack project
- frontend and backend development together
In dev mode, Vix can detect the Vue frontend and start the frontend dev server when the project contains the expected frontend structure.
Game template
Create a game project:
vix new mario --gameor:
vix new mario --template gameEnter the project:
cd marioBuild it:
vix buildRun it:
vix runUse the game template when you want:
- a game-oriented project structure
- a simulation
- a real-time prototype
- a custom engine foundation
- a project based on the Vix game runtime
Library template
Create a header-only library:
vix new tree --libEnter the project:
cd treeBuild the generated project:
vix build --build-target allEnable tests:
vix build --build-target all -- -Dtree_BUILD_TESTS=ONRun tests:
vix testsUse the library template when you want:
- reusable C++ code
- a header-only package
- an
include/directory - tests
- examples
- a future package for the Vix Registry
Why libraries use --build-target all
vix build builds the main project target by default.
For an application named api, this works because the generated project creates an executable target named:
apiFor a header-only library named tree, the project usually exposes an interface target and optional tests or examples.
So for generated libraries, use:
vix build --build-target allThis asks CMake and Ninja to build all enabled generated targets.
Template selection
You can select a template with a flag:
vix new api --app
vix new tree --lib
vix new mario --game2
3
You can also use --template:
vix new api --template backend
vix new blog --template web
vix new dashboard --template vue
vix new platformer --template game2
3
4
Supported --template values:
backend
web
vue
game2
3
4
Interactive mode
When Vix can interact with the terminal and you do not provide a specific template, it can ask you to choose a template interactively.
This is useful when you run:
vix new myprojectand want to choose the project type from a menu.
In scripts or CI, use explicit flags or non-interactive mode.
Non-interactive mode
Use VIX_NONINTERACTIVE=1 to disable prompts:
VIX_NONINTERACTIVE=1 vix new apiCreate a library without prompts:
VIX_NONINTERACTIVE=1 vix new tree --libCI also disables prompts:
CI=1 vix new apiUse non-interactive mode when running vix new from scripts, CI jobs, or automated setup commands.
Create in the current directory
Use . to initialize the current directory:
vix new .This is useful when you already created the repository manually.
Example:
mkdir api
cd api
git init
vix new .2
3
4
If the current directory is not empty, Vix may ask for confirmation in interactive mode.
In non-interactive mode, use --force if you intentionally want to write template files into the current directory.
vix new . --forceCreate inside another directory
Use -d or --dir to choose the base directory:
vix new blog -d ./projectsThis creates:
./projects/blogEquivalent form:
vix new blog --dir ./projectsOverwrite an existing directory
By default, Vix avoids overwriting existing project files.
Use --force only when you intentionally want to overwrite an existing directory:
vix new api --forceUse this carefully.
If the destination exists and is not empty, files may be replaced.
Conflicting options
Choose only one project type.
Wrong:
vix new api --app --libWrong:
vix new api --lib --template backendWrong:
vix new game --game --template vueCorrect:
vix new api --appor:
vix new api --template backendor:
vix new tree --libor:
vix new mario --gameGenerated application structure
A generated application has a structure similar to:
api/
├── CMakeLists.txt
├── CMakePresets.json
├── README.md
├── api.vix
├── vix.json
├── .env
├── .env.example
├── src/
│ └── main.cpp
└── tests/
└── test_basic.cpp2
3
4
5
6
7
8
9
10
11
12
The executable target matches the project name.
For example:
vix new api
cd api
vix build2
3
This builds the api target.
Generated backend structure
A generated backend project has a production-oriented structure.
It can include folders for routes, handlers, middleware, configuration, and application code.
The exact structure can evolve with Vix versions, but the purpose stays the same:
backend template
-> production-oriented C++ API foundation2
Use it when the project is meant to become a real backend service.
Generated web structure
A generated web project is designed for server-rendered web apps.
It can include:
src/
templates/
public/
.env
.env.example
vix.json2
3
4
5
6
Use it when you want Vix to serve HTML, templates, and static files.
Generated Vue structure
A generated Vue project is a fullstack project.
It can include:
backend C++ app
frontend/
frontend/package.json
vix.json
.env
.env.example2
3
4
5
6
Use vix dev to run the development workflow.
Generated game structure
A generated game project is designed for Vix game workflows.
It can include:
src/
assets/
CMakeLists.txt
CMakePresets.json
vix.json
README.md2
3
4
5
6
Use:
vix build
vix run2
to build and start the game.
Generated library structure
A generated header-only library has a structure similar to:
tree/
├── CMakeLists.txt
├── CMakePresets.json
├── README.md
├── tree.vix
├── vix.json
├── include/
│ └── tree/
│ └── tree.hpp
├── examples/
│ ├── CMakeLists.txt
│ └── basic.cpp
└── tests/
└── test_basic.cpp2
3
4
5
6
7
8
9
10
11
12
13
14
Build it with:
vix build --build-target allEnable tests with:
vix build --build-target all -- -Dtree_BUILD_TESTS=ONRun tests:
vix testsGenerated manifest files
A new project can include:
vix.json
<project>.vix
vix.app2
3
The exact files depend on the template.
vix.json
vix.json stores project metadata, dependencies, variables, and reusable tasks.
It is used by commands such as:
vix task
vix add
vix install
vix check2
3
4
<project>.vix
Some templates generate a .vix manifest file.
It can be used with commands such as:
vix run app.vix
vix dev app.vix2
vix.app
Some templates use the vix.app workflow.
vix.app describes a simple Vix application target.
It can be used by:
vix build
vix run
vix dev2
3
without requiring the user to manually write a CMakeLists.txt for simple apps.
Generated tasks
Generated projects can include reusable tasks in vix.json.
Examples:
vix task dev
vix task test
vix task ci2
3
Tasks make project workflows repeatable.
The exact generated tasks depend on the template.
Feature selection
For some templates, interactive mode can ask which features you want.
Feature selection can apply to application, backend, or Vue projects.
Examples of feature categories can include:
- database support
- static runtime options
- full static options
- backend-related project features
The exact available features can evolve with Vix versions.
In non-interactive mode, choose the template explicitly and configure features later.
Application workflow
Create:
vix new apiEnter:
cd apiBuild:
vix buildRun:
vix runDevelop:
vix devBackend workflow
Create:
vix new api --template backendEnter:
cd apiCreate local env:
cp .env.example .envStart dev mode:
vix devTest health:
curl http://127.0.0.1:8080/healthWeb workflow
Create:
vix new blog --template webEnter:
cd blogCreate local env:
cp .env.example .envStart dev mode:
vix devOpen:
http://127.0.0.1:8080Vue workflow
Create:
vix new dashboard --template vueEnter:
cd dashboardInstall dependencies when needed:
vix installStart dev mode:
vix devGame workflow
Create:
vix new mario --gameEnter:
cd marioBuild:
vix buildRun:
vix runLibrary workflow
Create:
vix new tree --libEnter:
cd treeBuild all generated targets:
vix build --build-target allEnable tests:
vix build --build-target all -- -Dtree_BUILD_TESTS=ONRun tests:
vix testsAfter project creation
Common next commands:
cd <project>
vix build
vix run
vix dev2
3
4
If the project has dependencies:
vix installIf you want validation:
vix checkIf you want tests:
vix testsIf you want to run generated tasks:
vix task <name>Options
| Option | Description |
|---|---|
<name|path> | Project name or destination path. |
--app | Generate an application project. This is the default. |
--application | Alias-style application option. |
--type=app | Generate an application project. |
--type=application | Generate an application project. |
--lib | Generate a header-only library project. |
--library | Alias-style library option. |
--type=lib | Generate a library project. |
--type=library | Generate a library project. |
--game | Generate a game project. |
--type=game | Generate a game project. |
--template <name> | Generate a template project: backend, web, vue, or game. |
--template=<name> | Same as --template <name>. |
-d, --dir <path> | Base directory for project creation. |
--dir=<path> | Same as --dir <path>. |
--force | Overwrite an existing directory or write into a non-empty current directory. |
-h, --help | Show command help. |
Environment variables
| Variable | Description |
|---|---|
VIX_NONINTERACTIVE=1 | Disable interactive prompts. |
CI=1 | Disable interactive prompts in CI environments. |
Examples:
VIX_NONINTERACTIVE=1 vix new api
VIX_NONINTERACTIVE=1 vix new tree --lib
CI=1 vix new api --template backend2
3
Common mistakes
Running commands outside the generated project
Wrong:
vix new api
vix dev2
Correct:
vix new api
cd api
vix dev2
3
Creating a library when you need an app
Wrong for a backend service:
vix new api --libCorrect:
vix new apior:
vix new api --template backendUsing vix build directly in a header-only library
Wrong:
vix new tree --lib
cd tree
vix build2
3
Correct:
vix new tree --lib
cd tree
vix build --build-target all2
3
Running library tests before enabling them
Wrong:
vix new tree --lib
cd tree
vix tests2
3
Correct:
vix new tree --lib
cd tree
vix build --build-target all -- -Dtree_BUILD_TESTS=ON
vix tests2
3
4
Combining incompatible project types
Wrong:
vix new api --lib --template backendCorrect:
vix new api --template backendUsing --force too early
Avoid this unless you really want to overwrite files:
vix new api --forcePrefer creating a clean folder first.
Troubleshooting
Missing project name
Wrong:
vix new --template backendCorrect:
vix new api --template backendUnknown template
Wrong:
vix new app --template desktopSupported templates:
backend
web
vue
game2
3
4
Correct:
vix new app --template backendDirectory is not empty
If the target directory exists and is not empty, Vix will avoid overwriting by default.
Use a clean directory or pass:
vix new api --forceonly when you intentionally want to overwrite.
Base directory is invalid
Wrong:
vix new blog --dir ./missing-folderCreate the base directory first:
mkdir -p ./projects
vix new blog --dir ./projects2
Build target not found in a library
You are probably in a generated header-only library.
Use:
vix build --build-target allNo tests available in a library
Enable tests first:
vix build --build-target all -- -Dtree_BUILD_TESTS=ONThen run:
vix testsReplace tree with your project name.
When to use each template
Use the application template when you want the smallest runnable app. Use the backend template when you want a production-oriented API or backend service. Use the web template when you want server-rendered HTML. Use the Vue template when you want a frontend and backend in one project. Use the game template when you want a game, simulation, prototype, or custom engine foundation. Use the library template when you want reusable C++ code that can later be packaged and shared.
Related commands
| Command | Purpose |
|---|---|
vix build | Build the generated project. |
vix run | Build and run the generated app. |
vix dev | Start development mode with reload. |
vix tests | Run tests. |
vix check | Validate the project. |
vix install | Install project dependencies. |
vix add | Add dependencies. |
vix task | Run generated or custom tasks. |
Next step
Build the generated project.