<commit_before>![status](https://secure.travis-ci.org/wearefractal/status.png?branch=master)

## Information

<table>
<tr>
<td>Package</td><td>status</td>
</tr>
<tr>
<td>Description</td>
<td>System automation on steroids</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.6</td>
</tr>
</table>

## Introduction

Shh... It's okay - everything is going to be alright. status is here to make all of your nightmares go away. 

status provides a flexible JSON interface on top of any commands/tasks/sensors/signals/hardware/etc you want to automate. status operations can be run locally (via the CLI) or remotely (via the REST server).

## Usage

### Command Line

```
# Specify a plugin and the output you want back
# In this example I specify the 'uptime' plugin with the 'total' operation
$ status uptime total
{"total":{"hours":7,"minutes":40,"seconds":6}}

# You can pass arguments to operations too!
# Arguments can be any javascript objects separated by commas
$ status processes grep["skype"]
{"grep":[{"id":"1234", "name":"skype"}]}

# Chaining operations will run them asynchronously
$ status cpu temp:usage:speed
{"temp":107.6, "usage":10, "speed":2100}

# Combine them all and have fun!
$ status cpu temp["celsius"]:usage["total","mhz"]:speed["ghz"]
{"temp":42, "usage":100, "speed":2.1}
```

### REST API

```
# Specify a plugin and the output you want back
# In this example I specify the 'uptime' plugin with the 'total' operation
POST /status/uptime "total"
{"total":{"hours":7,"minutes":40,"seconds":6}}

# You can pass arguments to operations too!
# Arguments can be any javascript objects separated by commas
POST /status/uptime "grep['skype']"
{"grep":[{"id":"1234", "name":"skype"}]}

# Chaining operations will run them asynchronously
POST /status/cpu "temp:usage:speed"
{"temp":107.6, "usage":10, "speed":2100}

# Combine them all and have fun!
POST /status/cpu "temp['celsius']:usage['total','mhz']:speed['ghz']"
{"temp":42, "usage":100, "speed":2.1}
```

## Writing Plugins

Let's write a plugin called "coolkern" that returns the kernel version

```coffee-script
{exec} = require "child_process"

coolkern =
  meta:
    name: "coolkern"
    author: "YOU"
    version: "0.0.1"

  version: (done) ->
    exec "uname -r", (err, stdout, stderr) ->
      done stdout
```

Simple enough, right? Now add it to status 

```coffee-script
status = require 'status'
status.load coolkern
```<commit_msg>add list of included plugins<commit_after>![status](https://secure.travis-ci.org/wearefractal/status.png?branch=master)

## Information

<table>
<tr>
<td>Package</td><td>status</td>
</tr>
<tr>
<td>Description</td>
<td>System automation on steroids</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.6</td>
</tr>
</table>

## Introduction

Shh... It's okay - everything is going to be alright. status is here to make all of your nightmares go away. 

status provides a flexible JSON interface on top of any commands/tasks/sensors/signals/hardware/etc you want to automate. status operations can be run locally (via the CLI) or remotely (via the REST server).

## Usage

### Command Line

```
# Specify a plugin and the output you want back
# In this example I specify the 'uptime' plugin with the 'total' operation
$ status uptime total
{"total":{"hours":7,"minutes":40,"seconds":6}}

# You can pass arguments to operations too!
# Arguments can be any javascript objects separated by commas
$ status processes grep["skype"]
{"grep":[{"id":"1234", "name":"skype"}]}

# Chaining operations will run them asynchronously
$ status cpu temp:usage:speed
{"temp":107.6, "usage":10, "speed":2100}

# Combine them all and have fun!
$ status cpu temp["celsius"]:usage["total","mhz"]:speed["ghz"]
{"temp":42, "usage":100, "speed":2.1}
```

### REST API

```
# Specify a plugin and the output you want back
# In this example I specify the 'uptime' plugin with the 'total' operation
POST /status/uptime "total"
{"total":{"hours":7,"minutes":40,"seconds":6}}

# You can pass arguments to operations too!
# Arguments can be any javascript objects separated by commas
POST /status/uptime "grep['skype']"
{"grep":[{"id":"1234", "name":"skype"}]}

# Chaining operations will run them asynchronously
POST /status/cpu "temp:usage:speed"
{"temp":107.6, "usage":10, "speed":2100}

# Combine them all and have fun!
POST /status/cpu "temp['celsius']:usage['total','mhz']:speed['ghz']"
{"temp":42, "usage":100, "speed":2.1}
```

## Included Plugins

```
cpu@0.0.1 - CPU information
  * temp
  * usage
  * speed
spotify@0.0.1 - Spotify controls/information
  * next
  * previous
  * toggle
  * pause
  * play
  * stop
  * open
  * playing
processes@0.0.1 - Process information
  * all
  * mine
  * grep
ram@0.0.1 - RAM information
  * total
  * free
  * used
os@0.0.1 - System information
  * load
  * uptime
  * arch
  * platform
  * type
  * hostname
  * kernel
  * cpus
  * network
```

## Writing Plugins

Let's write a plugin called "coolkern" that returns the kernel version

```coffee-script
{exec} = require "child_process"

coolkern =
  meta:
    name: "coolkern"
    author: "YOU"
    version: "0.0.1"

  version: (done) ->
    exec "uname -r", (err, stdout, stderr) ->
      done stdout
```

Simple enough, right? Now add it to status 

```coffee-script
status = require 'status'
status.load coolkern
```
{'fraction_non_alphanumeric': 0.15932715932715932, 'fraction_numerical': 0.023625023625023625, 'mean_word_length': 4.547169811320755, 'pattern_counts': {'":': 52, '<': 43, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1387716', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1743, 'n_words': 577}