The iA.Téléservices CLI is a command-line interface designed to manage Teleservices instances efficiently. This tool allows users to list, filter, and connect to various Teleservices instances.
- List all Teleservices instances.
- List Teleservices instances filtered by name or package.
- SSH into a Teleservices instance via provided arguments.
- Display the URL of Teleservices instances.
- Python 3.x
- Click library
- Requests library
$ python3 cli.py list
$ python3 cli.py list --name saint
$ python3 cli.py list --package imio_ts_aes
$ python3 cli.py ssh etalle
$ python3 cli.py ssh saint
$ python3 cli.py list --url-only
$ python3 cli.py list --package imio_townstreet --url-only
$ python3 cli.py list --host ts021
$ python3 cli.py list --host ts021 --url-only
--verbose
: Enables verbose mode for detailed logging.
--name, -n
: Filter instances by name. Part of the name is sufficient.--package, -p
: Filter instances by package.--url-only
: Display only the URL of the Teleservices.--host, -h
: Filter instances by host.
-
List all instances:
$ python3 cli.py list
-
List instances containing "saint" in the name:
$ python3 cli.py list --name saint
-
List instances with the package "imio_ts_aes":
$ python3 cli.py list --package imio_ts_aes
-
SSH into an instance named "etalle":
$ python3 cli.py ssh etalle
-
Display only URLs of instances:
$ python3 cli.py list --url-only
The CLI script is implemented using the Click
library for command-line parsing and Requests
for HTTP requests to the infrastructure API. The configuration settings and user details are managed through a Config
class, with support for verbose logging to provide detailed feedback during execution.
For more detailed information about each function and its usage, please refer to the inline documentation within the script.
To make the cli.py
script accessible from anywhere, you can add an alias to your ~/.bashrc
(for Bash users) or ~/.zshrc
(for Zsh users) file.
-
Open your
~/.bashrc
or~/.zshrc
file in a text editor.vi ~/.bashrc # or vi ~/.zshrc
-
Add the following line to create an alias for the script:
alias ts_cli='python3 /path/to/your/repository/cli.py'
Replace
/path/to/your/repository
with the actual path to your cloned repository. -
Save the file and exit the editor.
-
Reload your shell configuration to apply the changes:
source ~/.bashrc # or source ~/.zshrc
-
Now you can use
ts_cli
from anywhere:ts_cli list ts_cli ssh etalle