ViewAR-CLI - Command Line Interface
In this section, we show you how to install the viewar-cli, create an app and deploy it.
Before installing the developer tools, you'll need to make sure that you have two prerequisites installed:
- node.js (version 6.0.0 or higher)
- the npm (>= v3.0.0) package manager
- git (get it from https://meet.google.com/linkredirect?authuser=0&dest=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fgit-osx-installer%2Ffiles%2F)
Install node.js from https://nodejs.org/en/download/.
Next, install the viewar-cli globally by entering the following command into your terminal:
npm install -g viewar-cli
(Maybe you need to use
sudo npm install -g viewar-cli to have the right permissions.)
You will only need to install this tool once. When out of date, it will alert you and provide update instructions.
Log in with your user
In order to init a project, you need to log in with your account.
If you want to clone and init one of our samples, here is a list of our samples:
|Sample/Template Name||Description||Github URL|
|base6||Our standard template for furniture and product visualisation.||https://github.com/viewar/viewar-template-base6|
|qr-navigation (COMING SOON)||An app for indoor navigation using QR codes.||-|
Run your app for testing and developing
ViewAR System comes with a local development environment letting you program, debug and test AR applications directly in your browser. Once an app has been created and the dependencies are installed, change the working directory to PROJECT_NAME, and start the development server.
You can start the development server with WebGL support:
You can also run your template in so-called mock mode. It will not load any 3D content but still enable you to simulate all calls, notifications and behaviours directly in your browser.
It comes with 2 buttons in the bottom-right corner, letting you simulate tracking found and tracking lost. Furthermore, it displays thumbnails for scene elements, letting you mimic object selections. This is the fastest way to develop and debug AR applications.
npm run start:mock
Your web browser will open
http://localhost:8080/ to access the application.
Start creating your app
To edit the application's code start from
Deploy your app
To deploy the app you first need to create an application at http://developer.viewar.com. In order to activate your template to an app, you need to run:
viewar deploy APP-ID APP-VERSION
You can look up all the available commands by simply running
viewar without any parameters.