/via

Primary LanguageTypeScript

Easily start & stop your local dev environments from your cli




Watch the via demo video Watch the via demo video


Project setup

First, run

mkdir ~/.via
cp exampleConfig.json ~/.via/projects/my-project.json

Then edit my-project.json to configure your first workspace. You can create as many project.json files as you need.

Download the latest version of via and move it to /usr/local/bin/v.

You can then run v my-project start to start your project. Of course you can rename the my-project.json file to match your project's name.

Project configuration

Minimal configuration

{
  "services": {
    "app": {
        "path": "/Users/username/project/app",
        "actions": {
            "start": "docker-compose up -d",
            "stop": "docker-compose stop"
        }
    }
  }
}

You always have to specify the start and stop actions.

When running the start action, all other projects will be stopped automatically.

Adding custom actions

{
  "services": {
    "app": {
        ...
        "actions": {
            ...
            "bash": "docker-compose exec app bash"
        }
    }
  }
}

You can run individual actions like this:

v my-project app bash



Via development setup

First, follow the project setup instructions. Then, to run the project locally, install deno.

To run the code directly, run:

deno run --allow-read --allow-run --allow-env ./src/via.ts [project] [service] [action]

To build the binary, run:

deno compile --allow-read --allow-run --allow-env ./src/via.ts