Skip to main content

TokkoCLI

Komm her, bleib hier, Wir sind gut zu dir

TOC

Como instalar la TokkoCLI?

La herramienta TokkoCLI debe ser instalada a nivel global usando cualquiera de las opciones de instalación que a continuación se presentan:

Mediante PIP:

sudo -H pip3 install tools/tokko-cli

O mediante el instalador:

sudo -H python3 tools/tokko-cli/setup.py install

Primeros pasos

Finalizada la instalación del paquete tokko-cli (Pip|Setup.py), tendras una nueva herramienta de consola llamada tokky. Lo primero que debemos hacer antes de comenzar a utilizar nuestra CLI es inicializarla, para ello vamos a ejecutar el siguiente comando:

# No require permisos de super usuario.
# Y no, no es buena idea ...
tokky user init [--user]

Este comando mostrara una salida similar a esta:

---
Welcome {YOUR-USER}!
Your CLI is ready to use!!

More Info:
+ Sources: /home/{your-user}/tokko/sources/services-tokkobroker
+ Github RefreshToken: r1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ Token Expiration: 2021-01-20T03:15:00.00000-03:00

Una vez inicializada la tokko-cli vamos a proceder a instalar el daemon la misma con el siguiente comando:

# Requiere permisos de super usuario.
sudo -H tokky daemon install

Y si todo salio bien, deberias tener una salida similar a esta:

Installing TokkoCLI daemon ...
TokkoCLI daemon was successfully installed

Ahora si! Ya esta todo listo para que empieces a utilizar tu tokko-cli,

Para continuar, no olvides revisar nuestra seccion de tutoriales

Secciones:

La tokkoCLI se encuentra dividida en cinco secciones, Auth, Daemon, Project, RPC y User.

Auth

Integracion con el TokkoAuthSDK. Este feature aun no se encuentra disponible en las versiones estables.

Daemon:

Proceso en background utilizado por la CLI para procesar las solucitudes del usario.

Install

Install tokkoCLI daemon as SystemD service.

$ sudo tokky daemon install

Desinstalar el Daemon

Desistala el proceso de la tokkoCLI.

$ tokky daemon uninstall

Correr deamon en Foregound

El daemon de la tokkoCLI tambien puede ser ejecutado en modo "attached".

$ tokky daemon run [--port {custom-port}]

Estado del Daemon

Obtener el estado actual del deaemon. Esta información tambien puede consultarse mediante SystemCtl.

$ tokky daemon status

La tokkoCLI y SystemCtl

El daemon de la tokkoCLI es un servicio SystemD, por tanto es fatible utilizar ``SystemCtl`

Chequear el estado del servicio
systemctl status tokko-cli-daemon.service
Activar el servicio TokkoCLI.daemon
systemctl Enable tokko-cli-daemon.service
Iniciar el servicio TokkoCLI.daemon
systemctl start tokko-cli-daemon.service

User

Manejo de la cuenta de usuario dentro de la tokkoCLI

Inicializar usuario de la TokkoCLI

tokky user init

RPC

Integracion TokkoRPC. LLamados a procedimientos remotos dentro del cloud de servicios.

Invocando funciones RPC

tokky rpc call {function} [--service {my-serice: String}] [--data {data: String}]

Ejemplo: Invocando a la funcion Echo:

$ tokky rpc call echo --data "Hola Mundo!"
>>> "Hola Mundo!"

Project

Herramientas para la gestion de projectos dentro del stack de servicios de TokkoBroker

Listar los servicios

tokky project ls [--details|-d]

Crear un nuevo Servicio:

Crear un nuevo Project(Servicio) utilizando los templates de Tokko. Por omision este comando creara proyectos basados en el template django, pero en caso de que quieras utilizar el template flask solo debes anexar el flag --flask

# No requiere permisos de super usuario
tokky project new {nombre-del-projecto} [--flask]

Exportar Servicio

Para agregar un nuevo servicio al Stack general de servicios de TokkoBroker utilizaremos en comando export de la tokkoCLI. Este comando generara una carpeta llamada .meta dentro del raiz del proyecto. La carpeta .meta contendra el descriptor del servicio(AKA *.tbs file).

# No requiere permisos de super usuario
tokky project export {nombre-del-projecto}

Un TBS tendra un aspecto similar al siguiente, dependiendo el servicio que se haya exportado

[nombre-del-servicio]
RequirePostgreDB = yes
DatabaseName = nombre_del_servicio_srv_db
RequireRabbitMQ = no
Volumes = .:/app
ContainerPort = 8000
Command = python manage.py runserver 0.0.0.0:8000
ShouldPatchCommand = yes

[nombre-del-servicio-rpc-service]
RequirePostgreDB = yes
DatabaseName = nombre_del_servicio_srv_db
RequireRabbitMQ = no
Volumes = .:/app
ContainerPort = 9142
Command = python manage.py run_rpc_server
ShouldPatchCommand = no

Sicronizar stack de sevicios

# No requiere permisos de super usuario
tokky project sync

Metadata

Release files for tokko-cli 0.0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tokko-cli 0.0.2.8
File Size Uploaded Provenance Actions
tokko_cli-0.0.2.8.tar.gz 21.7 kB Without provenance Details for tokko_cli-0.0.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tokko-cli 0.0.2.8
File Interpreter ABI Platform Actions
tokko_cli-0.0.2.8-py3-none-any.whl Python 3 none any Details for tokko_cli-0.0.2.8-py3-none-any.whl

Total release size: 43.3 kB

Release files / tokko_cli-0.0.2.8.tar.gz

Download URL tokko_cli-0.0.2.8.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9bd88829ebbfc66d6fca88ca4614a422b543479211a1d678f4d3710fbda1f074
BLAKE2b-256 checksum
How to use checksums
bc5b2da4c99a932a4d02dcb82a309e9ed59c6e215c6aae44a9f342985c67c0b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

Release files / tokko_cli-0.0.2.8-py3-none-any.whl

Download URL tokko_cli-0.0.2.8-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
558e01a274fafc1c1c67dcf29c4eac9a02e0bb9c4789558f48bce83473d71932
BLAKE2b-256 checksum
How to use checksums
8a11682485a103dc35237a7402c27b785470a4b35c722d87e6578f99ff804d61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

Security for tokko-cli 0.0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page