# 28

> Command line utility to download and upload 28.io queries.

Latest version **3.4.0** (published 2017-04-14) · 0 weekly downloads

## Install

```sh
npm install 28
pnpm add 28
yarn add 28
bun add 28
```

Provides the command `28`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2017-04-14 |
| First published | 2014-02-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 14 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | William Candillon |
| Maintainers | wcandillon |
| Keywords | jsoniq, xquery, dev, cloud |

## Links

- npm: https://www.npmjs.com/package/28
- Repository: https://github.com/28msec/28
- Homepage: https://28.io
- Issues: https://github.com/28msec/28/issues
- npm.io page: https://npm.io/package/28

## Dependencies (14)

- [q](https://npm.io/package/q.md) ~1.0.1
- [read](https://npm.io/package/read.md) ~1.0.5
- [touch](https://npm.io/package/touch.md) 0.0.3
- [watch](https://npm.io/package/watch.md) 0.16.0
- [colors](https://npm.io/package/colors.md) ^1.0.3
- [lodash](https://npm.io/package/lodash.md) 3.7.0
- [xqlint](https://npm.io/package/xqlint.md) 0.0.7
- [request](https://npm.io/package/request.md) ^2.51.0
- [final-fs](https://npm.io/package/final-fs.md) ~1.6.0
- [commander](https://npm.io/package/commander.md) ^2.7.1
- [28.io-nodejs](https://npm.io/package/28.io-nodejs.md) 1.0.0
- [cat-settings](https://npm.io/package/cat-settings.md) ~1.0.0
- [omelette-fork](https://npm.io/package/omelette-fork.md) ^0.3.1
- [update-notifier](https://npm.io/package/update-notifier.md) ~0.2.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.4.0 (latest) — 2017-04-14
- 3.2.1 — 2016-11-14
- 3.2.0 — 2016-11-11
- 3.1.0 — 2016-10-06
- 3.0.8 — 2016-08-05
- 3.0.7 — 2016-07-04
- 3.0.6 — 2016-04-06
- 3.0.5 — 2016-03-21
- 3.0.4 — 2016-01-19
- 3.0.3 — 2016-01-19
- 3.0.2 — 2016-01-19
- 3.0.1 — 2016-01-18
- 3.0.0 — 2016-01-12
- 2.1.8 — 2016-01-07
- 2.1.7 — 2016-01-07
- … 85 more at https://npm.io/package/28/versions

## README

#28.io CLI

[![Build Status](http://img.shields.io/travis/28msec/28/master.svg?style=flat)](https://travis-ci.org/28msec/28) [![NPM version](http://img.shields.io/npm/v/28.svg?style=flat)](http://badge.fury.io/js/28) [![Code Climate](http://img.shields.io/codeclimate/github/28msec/28.svg?style=flat)](https://codeclimate.com/github/28msec/28)

Sign up and create an account at http://hq.28.io/account/register.
A video tutorial that shows the 28 cli in action is available [here](https://youtu.be/NILlys4h7Fs?t=53s).
Getting started instructions are also available [here](https://github.com/28msec/28/blob/master/getting-started.md).

## Installation
Install Node.js and NPM for your system (Mac, Windows or Linux). And install the command line tool using:

```
$ npm install 28 -g
```
## Usage

### Login

You can now authorize the client using your email and password. Your password is never stored on the system:

```
$ 28 login <your email>
```

### Projects:

```
$ 28 projects list
```

```
$ 28 projects create <project name>
```

```
$ 28 project delete <project name>
```
### Download Project

```
$28 download <project name> [-d, --delete-orphaned] [-o, --overwrite <yes, no, ask, if-newer>] [-s, --simulate]
```
Options:

* `-h, --help`              Output usage information.
* `-o, --overwrite <value>`  Overwrite remote files. Value can be yes, no, if-newer, or ask.
* `-s, --simulate`           Simulate for extra safety.
* `-d, --delete-orphaned`    Delete orphaned files.


### Upload Project

```
$28 upload <project name> [-d, --delete-orphaned] [-o, --overwrite <yes, no, ask, if-newer>] [-s, --simulate]
```

Options:

* `-h, --help`               output usage information.
* `-o, --overwrite <value>`  Overwrite remote files. Value can be yes, no, if-newer, or ask.
* `-s, --simulate`           Simulate for extra safety.
* `-d, --delete-orphaned`    Delete orphaned files.

### Truncate Project

```bash
$28 truncate <project name> [-s, --simulate]
```

Options:

* `-h, --help`               output usage information.
* `-s, --simulate`           Simulate for extra safety.


### Watch Project

```bash
$28 watch <project name>
```

### Code checking

The xqlint commands checks your code for static errors and warning using [xqlint](http://github.com/wcandillon/xqlint).

```bash
$28 xqlint <path> [-s, --style-check <yes, no>]
```

## Synchronizing 

The upload and download commands can be used to synchronize local files with a 28.io project and vice versa.
Assume you started a new project called test on 28.io. You would like to download the project files:
```
$28 download test
```
If you make local changes to this project, you can upload them back to your 28.io project.
In order to make sure that everything is in order, you can use the *simulate* option that will display the actions to perform without doing them.
```
$28 upload test --overwrite if-newer --delete-orphaned --simulate
```
Once you are ready, you can run the same command without the *simulate* option.
You can use the *download* command to periodically get updates from your 28.io project:
```
$28 download test --overwrite if-newer --delete-orphaned
```

# Using the CLI on premise

In order to use the 28 CLI against an 28msec instance installed on premise, simply run the following command where `/path/to/cellstore/docker-config.json` is the path of the cellstore configuration file: 

```bash
$28 init </path/to/cellstore/docker-config.json>
```

## Settings

By default, a setting file named *.28.json* is created in your home directory.
You can override these default settings by creating your own *.28.json* file in the current working directory.
This is how the default settings looks like:

```json
{
    "access_token": "",
    "refresh_token": "",
    "project_tokens": {},
    "email": "",
    "protocol": "https",
    "project_name": "portal",
    "project_domain": "28.io",
    "ignore": [
        "lib/io/28/api/.*"
    ]
}
```
* *access_token*, *refresh_token*, *project_tokens*, and *email* properties can be filled using the ``28 login`` command.
* *protocol* property can be *http* or *https*.
* *project_name* property is the name of the prefix of the 28.io API endpoint.
* *project_domain* property is the suffix of the 28.io API endpoint.
* *ignore* property contains a list of regular expressions that will filter out files from being uploaded and downloaded.


### Configure auto-complete

Auto-complete is supported for Mac and Linux.
You need bash-completion installed.
####Mac OS X
On OS X you can run `brew install bash-completion` if you have homebrew installed.
Add bash-completion to your `.bash_profile`:

```bash
if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi
```

####Linux
On Ubuntu you can run `apt-get install bash-completion`.

To enable it in zsh, run:

```bash
echo '. <(28 --completion)' >> .zshrc
```

To enable it in bash, run:

```bash
28 --completion >> ~/28.completion.sh
echo 'source ~/28.completion.sh' >> ~/.bash_profile
```

---
_Source: https://npm.io/package/28 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
