<commit_before># Inside Context

Here's what's available inside context.

|name|provides the...
|---|---|
|**parameters**|command line arguments and options|
|**config**|configuration options from the app or plugin|
|**print**|tools to print output to the command line|
|**template**|code generation from templates|
|**prompt**|tools to acquire extra command line user input
|**filesystem**|ability to copy, move & delete files & directories|
|**system**|ability to execute & copy to the clipboard|
|**http**|ability to to the web|


# context.parameters
Information about how the command was invoked.

### options
Options are the command line flags.  Always exists however it may be empty.

```sh
$ staple say hello --loud -v  # { loud: true, v: true }
$ staple wave --times 5       # { times: 5 } 
```

### string
Everything else after the command as a string.

```sh
$ staple say hello there  # hello there
```

### array
Everything else after the command, but as an array.

```sh
staple reactotron plugin full  # ['plugin', 'full']
```

### first
The first element in `array`.

```sh
staple reactotron plugin full  # plugin
```

### second
The second element in `array`.

```sh
staple reactotron plugin full  # full
```

### third
The third element in `array`.

```sh
staple reactotron plugin full  # undefined
```

### full
This is a string of everything after the namespace.  I'm unclear why I have this here.

# context.config
This is an object.  Each plugin will have it's own root level key. 

It takes the plugin's defaults, and merges the user's changes overtop.

```js
// package.json from the plugin
{
  "staplegun": {
    "namespace": "myPlugin",
    "defaults": {
      "fun": false
    }
  }
}

// package.json from the user
{
  "staplegun": {
    "config": {
      "myPlugin": {
        "fun": true
      }
    }
  }
}

context.config.myPlugin.fun // true
```


# context.print
Features for allowing you to print to the console.

### stepComplete(action, message)
Indicates to that something relevant has been done.

The `action` parameter is string up to 20 characters long.  It should be the 
passed-tense verb like "generated" or "deleted".

The `message` parameter is a string up to 80 characters long.  It can be anything
relevant to what happened.  You're welcome to to use colors here like `highlight` to emphasize your message.

### debug()
Only used for debugging your plugins.  You can pass this function a string or an object. 

### colors<commit_msg>Adds one more formatting style change to the doc.<commit_after># Inside Context

So you're making a plugin.

```js
module.exports = async function (context) {
  // great!  now what?
}
```

Here's what's available inside `context` object.

|name|provides the...
|---|---|
|**parameters**|command line arguments and options|
|**config**|configuration options from the app or plugin|
|**print**|tools to print output to the command line|
|**template**|code generation from templates|
|**prompt**|tools to acquire extra command line user input
|**filesystem**|ability to copy, move & delete files & directories|
|**system**|ability to execute & copy to the clipboard|
|**http**|ability to to the web|


# context.parameters
Information about how the command was invoked.

### options
Options are the command line flags.  Always exists however it may be empty.

```sh
staple say hello --loud -v --wave furiously
```

```js
module.exports = async function (context) {
  context.parameters.options // { loud: true, v: true, wave: 'furiously' }
}
```

### string
Everything else after the command as a string.

```sh
staple say hello there
```

```js
module.exports = async function (context) {
  context.parameters.string // 'hello there'
}
```

### array
Everything else after the command, but as an array.

```sh
staple reactotron plugin full
```

```js
module.exports = async function (context) {
  context.parameters.array // ['plugin', 'full']
}
```

### first
The first element in `array`.

```sh
staple reactotron plugin full
```

```js
module.exports = async function (context) {
  context.parameters.first // 'plugin'
}
```

### second
The second element in `array`.

```sh
staple reactotron plugin full
```

```js
module.exports = async function (context) {
  context.parameters.second // 'full'
}
```

### third
The third element in `array`.

```sh
staple reactotron plugin full
```

```js
module.exports = async function (context) {
  context.parameters.third // undefined
}
```

### full
This is a string of everything after the namespace.  I'm unclear why I have this here.

```sh
staple reactotron plugin full
```

```js
module.exports = async function (context) {
  context.parameters.full // 'reactotron plugin full'
}
```

# context.config
This is an object.  Each plugin will have it's own root level key. 

It takes the plugin's defaults, and merges the user's changes overtop.

```js
// package.json from the plugin
{
  "staplegun": {
    "namespace": "myPlugin",
    "defaults": { "fun": false, "level": 10 }
  }
}

// package.json from the user
{
  "staplegun": {
    "config": {
      "myPlugin": { "fun": true }
    }
  }
}

```

```js
module.exports = async function (context) {
  context.config.myPlugin // { fun: true, level: 10 }
}
```

# context.print
Features for allowing you to print to the console.

### stepComplete(action, message)
Indicates to that something relevant has been done.

The `action` parameter is string up to 20 characters long.  It should be the 
passed-tense verb like "generated" or "deleted".

The `message` parameter is a string up to 80 characters long.  It can be anything
relevant to what happened.  You're welcome to to use colors here like `highlight` to emphasize your message.

### debug()
Only used for debugging your plugins.  You can pass this function a string or an object. 

### colors
{'fraction_non_alphanumeric': 0.12701682114658427, 'fraction_numerical': 0.002403020940611054, 'mean_word_length': 3.791940789473684, 'pattern_counts': {'":': 17, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5358121', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1694, 'n_words': 723}