1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-27 02:43:54 +02:00
OpenIntegrations/docs/en/md/Start/CLI_version.md

43 lines
2.8 KiB
Markdown
Raw Normal View History

---
sidebar_position: 2
---
# Working with CLI app
2024-06-05 15:26:55 +02:00
OInt CLI - a command-line application that allows you to use methods of the Open Integration Package independently of 1C and OneScript. It requires .Net Framework 4.8 or a compatible Mono Runtime (automatically installed when using deb and rpm packages)
2024-06-05 15:26:55 +02:00
## First start
2024-06-05 15:26:55 +02:00
To get started, you need to call the command `oint` from the command prompt/terminal. If app was installed from packages (Linux) or installer (Windows, after reboot), you can do this from any place without additional actions. When using the portable version (exe executable file), `oint` needs to be run with the full path to the file. In Linux distributions, you may also need to execute `chmod +x <path to file>/oint beforehand`
2024-06-05 15:26:55 +02:00
To run the portable version in RHEL/Fedora/CentOS (distributions using rpm packages), use the command <br/>`mono <path to oint>/oint "$@"`
![demo](./img/1.gif)
## Help
2024-06-05 15:26:55 +02:00
After the launching of application, you'll see the initial page with a list of available libraries. To view the list of available methods for a specific library, simply type `oint` followed by its name. For example, `oint telegram`. Similarly, you can get details about a specific method by using the command `oint <library> <method>`, for example, `oint telegram SendMessage`
2024-06-05 15:26:55 +02:00
>**Important:** Library names are case-sensitive and should be written in lowercase. Method names are not case-sensitive
![demo](./img/3.gif)
2024-06-05 15:26:55 +02:00
## Using methods
Like most other programs intended for use in bat/sh scripts, each separate action of Oint CLI is called by a full command line of the following form:
```powershell
2024-06-05 15:26:55 +02:00
oint <library> <method> --option1 "Value" --option2 "Value"...
```
2024-06-05 15:26:55 +02:00
When it comes to parameters, most often the data passed there are strings. This can be text, file paths, URLs, etc. However, in OInt, there are methods that accept other, less obvious types of data. These can be:
2024-06-05 15:26:55 +02:00
+ Dates are passed as strings in ISO 8601 format
+ Arrays are passed as strings in the form`"['Val1','Val2','Val3']"`
+ JSON is passed as a path to a .json file
2024-06-05 15:26:55 +02:00
After executing the requested action, the program outputs the result and exits. By default, the output is displayed in the console, but you can redirect it to a file using either the standard method `>` or by using the common parameter `--out`. The difference between these two methods lies in the encoding of the saved file: when using `>`, it will be the encoding of the shell, whereas when using `--out`, it will be UTF-8 (used internally by OInt). Additionally, using `--out` is mandatory for methods returning binary data in the response (such as downloading a file from Google Drive, for example)
![demo](./img/2.gif)
2024-06-05 15:26:55 +02:00
You can find all further information you might need for work in other sections of this documentation, as well as in the built-in help of OInt CLI