<commit_before># Kleber CLI
This is the official command line client for Kleber. It is written in pure shell script and aims to be fully POSIX compliant. The main purpose is to provide a command line interface where the basic API features are implemented. Uploading of pure text as well as data/binary is supported from either files or STDIN.

## Installation

```
$ git clone https://github.com/kleber-io/kleber-cli.git
$ cd kleber-cli
# make install
```

### Dependencies

* [curl](http://curl.haxx.se/)

### Optional Dependencies

* [jq](https://stedolan.github.io/jq/) (history printing)
* [xclip](http://sourceforge.net/projects/xclip/) (automatically copy links to clipboard)
* [exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/) (remove metadata locally)

## Configuration
Kleber supports configuration files. The default configuration file is located at `~/.kleberrc`. Any variables of the CLI
can be overwritten with configuration files, so modifying the code in order to change it's behaviour is not necessary.

### Minimal Configuration File
A minimal configuration file includes just one line: a valid API key:

```
KLEBER_API_KEY=$INSERT_API_KEY_HERE
```

A basic configuration file could look like this:


```
KLEBER_API_URL=https://kleber.io/api
KLEBER_API_URL_TOR=http://6pvvph7kvxexq2e2.onion/api
KLEBER_API_KEY=$INSERT_API_KEY_HERE
```

## Usage

```
Kleber (kleber.io) API CLI
usage: [cat |] kleber.sh [command] [options] [file|shortcut]

Commands:
    -u | --upload <file>            Upload a file
    -d | --delete <shortcut>        Delete a paste/file
    -l | --list                     Print upload history
    -e | --remove-meta <file|dir>   Remove metadata from a regular file or directory.
                                    This requires exiftool to be installed in $PATH.

Upload Options:
    -n | --name <name>              Name/Title for a paste
    -s | --secure-url               Create with secure URL
    -t | --lifetime <lifetime>      Set upload lifetimes (in seconds)
    -g | --no-lexer                 Don't guess a lexer for text files
    -f | --print-api-url            Return API URL instead of web URL

List Options:
    -o | --offset <offset>          Pagination offset (default: 0)
    -k | --limit <limit>            Pagination limit (default: 10)
    -r | --raw-history              Print the raw history response (without jq formatting)

General Options:
    -y | --tor                      Enable TOR support
    -z | --tor-proxy <ip:port>      IP and port if TOR proxy (default: 127.0.0.1:9150)
    -a | --url                      Set alternative URL (default: https://kleber.io/)
    -c | --config                   Provide a custom config file (default: ~/.kleberrc)
    -C | --curl-config              Read curl config from stdin
    -q | --quiet                    Suppress output
    -x | --debug                    Show debug output
    -h | --help                     Show this help
```

### Uploading a File

```
$ kleber --upload /bin/pwd
```

There is another, more convenient way to accomblish the same:

```
$ cat /bin/pwd | kleber -n pwd
```

The name (-n) is optional.

### Using the Hidden Service API via TOR

The CLI also works for the hidden service API accessible via the TOR network:

```
$ kleber --list --tor
```

This will try to list the pastes via the hidden service API. It uses the default TOR proxy settings `localhost:9150`. This can be changed:

```
$ kleber --list --tor-proxy 127.0.0.1:9151
```

In case the API URL will change in the future, it can either be changed set in the `~/.kleberrc` config file, or via the `--url` paramter:
    
```
$ kleber --list --tor --url https://aiojsdioiajosjdo.onion/
```

### HTTP Proxy Support

Because the CLI is basically just a wrapper around curl, HTTP proxies can be supplied via environment variables:

```
$ export HTTP_PROXY=http://192.168.1.1:8080
$ kleber --list
```

## Contribute
Feel free to open [issues](https://github.com/kleber-io/kleber-cli/issues) or create [pull requests](https://github.com/kleber-io/kleber-cli/pulls). Contributions are highly appreciated!<commit_msg>README.md updated<commit_after># Kleber CLI
This is the official command line client for Kleber. It is written in pure shell script and aims to be fully POSIX compliant. The main purpose is to provide a command line interface where the basic API features are implemented. Uploading of pure text as well as data/binary is supported from either files or STDIN.

## Installation

```
$ git clone https://github.com/kleber-io/kleber-cli.git
$ cd kleber-cli
# make install
```

### Dependencies

* [curl](http://curl.haxx.se/)
* [jq](https://stedolan.github.io/jq/) (history printing)

### Optional Dependencies

* [xclip](http://sourceforge.net/projects/xclip/) (automatically copy links to clipboard)
* [exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/) (remove metadata locally)

## Configuration
Kleber supports configuration files. The default configuration file is located at `~/.kleberrc`. Any variables of the CLI
can be overwritten with configuration files, so modifying the code in order to change it's behaviour is not necessary.

### Minimal Configuration File
A minimal configuration file includes just one line: a valid API key:

```
KLEBER_API_KEY=$INSERT_API_KEY_HERE
```

A basic configuration file could look like this:


```
KLEBER_API_URL=https://kleber.io/api
KLEBER_API_KEY=$INSERT_API_KEY_HERE
```

## Usage

```
Kleber (kleber.io) API CLI v0.7.0
usage: [cat |] kleber [command] [options] [file|shortcut]

Commands:
    -u | --upload <file>            Upload a file
    -g | --get <file>               Get a file
    -d | --delete <shortcut>        Delete a paste/file
    -l | --list                     Print upload history
    -e | --remove-meta <file|dir>   Remove metadata from a regular file or directory.
                                    This requires exiftool to be installed in $PATH.
    -b | --upload-screenshot        Take a screenshot and upload it.

Upload Options:
    -n | --name <name>              Name/Title for a paste
    -s | --secure-url               Create with secure URL
    -t | --lifetime <lifetime>      Set upload lifetimes (in seconds)
    -f | --print-api-url            Return API URL instead of web URL
    -w | --password                 Protect upload with password

Get Options:
    -o | --output <location>        Output location (default: current directory)

List Options:
    -o | --offset <offset>          Pagination offset (default: 0)
    -k | --limit <limit>            Pagination limit (default: 10)

General Options:
    -p | --clipboard                Add document link to clipboard
    -a | --url                      Set alternative URL (default: https://kleber.io/)
    -c | --config                   Provide a custom config file (default: ~/.kleberrc)
    -C | --curl-config              Read curl config from stdin
    -q | --quiet                    Suppress output
    -x | --debug                    Show debug output
    -h | --help                     Show this help
```

### Uploading a File

```
$ kleber --upload /bin/pwd
```

There is another, more convenient way to accomblish the same:

```
$ cat /bin/pwd | kleber -n pwd
```

The name (-n) is optional.

### HTTP Proxy Support

Because the CLI is basically just a wrapper around curl, HTTP proxies can be supplied via environment variables:

```
$ export HTTP_PROXY=http://192.168.1.1:8080
$ kleber --list
```

## Contribute
Feel free to open [issues](https://github.com/kleber-io/kleber-cli/issues) or create [pull requests](https://github.com/kleber-io/kleber-cli/pulls). Contributions are highly appreciated!
{'fraction_non_alphanumeric': 0.11035830618892509, 'fraction_numerical': 0.007947882736156351, 'mean_word_length': 2.5259531465319247, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 13, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5463594', 'n_tokens_mistral': 2360, 'n_tokens_neox': 2266, 'n_words': 849}