# Available commands

## Help&#x20;

Run any one of the below commands.

`bito --help`

or

`bito config –help`

## Check Bito CLI Version&#x20;

Run any one of the below commands to print the version number of Bito CLI installed currently.

`bito -v`

or

`bito --version`

## Bito CLI MyPrompt (Automation using Bito CLI)&#x20;

The below commands can help you automate repetitive tasks like software documentation, test case generation, writing pull request description, pull request review, release notes generation, writing commit message, and much more.

{% hint style="info" %}
Explore some [**intelligent AI automations**](https://github.com/gitbito/AI-Automation) we've created using [**Bito CLI**](https://docs.bito.ai/other-bito-ai-tools/bito-cli), which you can implement in your projects right now. These automations showcase the powerful capabilities of Bito CLI.
{% endhint %}

### 1- Non-Interactive Mode with File Input&#x20;

Run the below command for non-interactive mode in Bito (where `writedocprompt.txt` will contain your prompt text such as `Explain the code below in brief` and `mycode.js` will contain the actual code on which the action is to be performed).&#x20;

```
bito –p writedocprompt.txt -f mycode.js
```

### 2- Standard Input Mode&#x20;

Run the below command to read the content at standard input in Bito (where `writedocprompt.txt` will contain your prompt text such as `Explain the code below in brief` and input provided will have the actual content on which the action is to be performed).&#x20;

```
bito –p writedocprompt.txt
```

### 3- Direct File Input&#x20;

Run the below command to directly concatenate a file and pipe it to `bito` and get instant result for your query.&#x20;

#### On Mac/Linux&#x20;

```
cat file.txt | bito
```

#### On Windows&#x20;

```
type file.txt | bito
```

### 4- Redirect Output to a File&#x20;

#### On Mac/Linux&#x20;

Run the below command to redirect your output directly to a file (where `-p` can be used along with `cat` to perform prompt related action on the given content).&#x20;

```
cat inventory.sql | bito -p testdataprompt.txt > testdata.sql
```

#### On Windows&#x20;

Run the below command to redirect your output directly to a file (where `-p` can be used along with `type` to perform prompt related action on the given content).&#x20;

```
type inventory.sql | bito -p testdataprompt.txt > testdata.sql
```

### 5- Store Context/Conversation History&#x20;

Run the below command to store context/conversation history in non-interactive mode in file `runcontext.txt` to use for next set of commands in case prior context is needed. If `runcontext.txt` is not present it will be created. Please provide a new file or an existing context file created by `bito` using `-c` option. With `-c` option now context is supported in non-interactive mode

#### On Mac/Linux&#x20;

```
cat inventory.sql | bito -c runcontext.txt -p testdataprompt.txt > testdata.sql
```

#### On Windows&#x20;

```
type inventory.sql | bito -c runcontext.txt -p testdataprompt.txt > testdata.sql
```

### 6- Instant Response for Queries&#x20;

Run the below command to instantly get response for your queries using Bito CLI.&#x20;

```
echo "give me code for bubble sort in python" | bito
```

## Using Comments&#x20;

Anything after `#` symbol in your prompt file will be considered as a comment by Bito CLI and won't be part of your prompt.&#x20;

You can use `\#` as an escape sequence to make `#` as a part of your prompt and to not use it for commenting anymore.&#x20;

### Few examples for above:&#x20;

* Give me an example of bubble sort in python # everything written here will be considered as a comment now.&#x20;
* Explain what this part of the code do: \\#include\<stdio.h>
  * In the example above `\#` can be used as an escape sequence to include # as a part of your prompt.&#x20;
* \#This will be considered as a comment as it contains # at the start of the line itself.&#x20;

## Using Macro&#x20;

Use `{{%input%}}` macro in the prompt file to refer to the contents of the file provided via `-f` option.

**Example:** To check if a file contains JS code or not, you can create a prompt file `checkifjscode.txt` with following prompt:&#x20;

```
Context is provided below within contextstart and contextend
contextstart
{{%input%}}
contextend
Check if content provided in context is JS code.
```
