Appstax command-line guide

Introduction

The appstax command-line tool is used for managing your apps from the terminal on your PC or Mac. With it you can create new apps, deploy code to hosting, download SDK's and much more.

Installing

Quick install on Mac OSX: install the latest version from the terminal:
curl -s https://appstax.com/download/cli/install_osx.sh | sudo /bin/bash

Quick install on Linux:
curl -s https://appstax.com/download/cli/install_linux.sh | sudo /bin/bash

Manual installation: Download the latest release and copy the appropriate binary to somewhere on your system PATH.

On windows, place appstax.exe in c:\Windows\System32 or any custom PATH you have configured in your environment variables.

Basics

Here are a few things you need to know in order to use our command-line tool to develop your apps:

If you are using Windows

On windows, you need to open the Command Prompt to start entering commands. You find it by clicking the Start button, All Programs, Accessories, and then Command Prompt.

To make a new directory you use the md command:
md c:\my-new-app creates a new directory "my-new-app" on the root of your c: disk.

To select a directory to work in you use the cd command:
cd c:\my-new-app

If you are using Max OS X

On a Mac you open the Terminal application to enter commands. Select Applications in Finder and find it in the Utilities folder.

To make a new directory you use the mkdir command:
mkdir my-new-app creates a new directory "my-new-app" in your home directory.

To select a directory to work in you use the cd command:
cd my-new-app

If you are using Linux

We think you already know how to use the command-line.

Command overview

appstax init        # Initialize an appstax app in the current directory
appstax info        # Info about app configured in current directory
appstax deploy      # Deploy public and servercode files to <yourapp>.appstax.io
appstax server      # Create and manage servercode
appstax open        # Open your browser to the specified destination
appstax signup      # Sign up for a new appstax account
appstax login       # Log in (also done automatically from other commands)
appstax logout      # Log out
appstax serve       # Run development http server on localhost:9000
appstax collection  # Create and view collections

You can also type appstax help to see a list of available commands.

Command details

appstax init

Usage: appstax init

Interactive command that initializes the current directory with an appstax.conf file and an optional app template.

appstax info

Usage: appstax info

Shows information (name, description, appkey, etc.) about the app configured in the current directory.

appstax deploy

Usage: appstax deploy <target>

  • target: public, server or all

public deploys files in you public directory to Appstax Hosting, and server deploys files in you server directory to Appstax ServerCode.

appstax server

Usage: appstax server <operation> [<options>]

  • operation: create, delete, start, stop, status or log

create launches a new server, and delete removes it. start/stop controls server status, and staus shows the current status. log <lines> prints the last x number of lines from the server log.

appstax open

Usage: appstax open [<target>]

  • target: deployed (default), admin, local

Opens a browser window to the specified targed. deployed opens your configured *.appstax.io subdomain, admin opens the Appstax Admin UI and local opens localhost:9000 (the same address where appstax serve starts.)

appstax signup

Usage: appstax signup

Interactive command that asks for an email and password and creates a new appstax account. You need to agree to the Terms of Service.

appstax login

Usage: appstax login

Interactive command to log in. You rarely need to use this command, as the other commands will ask you to log in if neccesary.

The command-line tool saves your session id in ~/.appstax/session and uses this for any subsequent command you enter. Use appstax logout to invalidate and delete this session.

appstax logout

Usage: appstax logout

End the current session. The session id stored in ~/.appstax/session will be deleted and the session is invalidated on the server.

appstax serve

Usage: appstax serve

Starts a local web server on http://localhost:9000 that serves the files in your public directory. Stop the server with ctl-c.

appstax collection

Usage: appstax collection <name> [<columns>]

Creates a collection with the given name and an optional set of columns. Columns are separated by space, and the format for a column is <name>:<type>. Allowed column types are string, number, boolean and file.

Example: The following command creates a collection named posts with four columns: a content column with type string, a value column with type number, a checked column with type boolean and an attachment column with type file.

appstax collection posts content:string value:number checked:boolean attachment:file