CLI tool for elog management
Project description
elog-cli
Overview
elog-cli is a command-line interface for managing elog entries and authentication. It interacts with the elog management backend and supports OAuth2 authentication.
Installation
To install elog-cli, clone the repository and install the required dependencies:
git clone https://github.com/yourusername/elog-cli.git
cd elog-cli
pip install -r requirements.txt
Environment Variables
The following environment variables need to be set for the authentication manager to work:
ELOG_CLI_CODE_FLOW_SERVER_URL: The URL of the OAuth2 code flow server (e.g.,https://<hostname>/device/code).ELOG_CLI_TOKEN_URL: The URL to obtain the token (e.g.,https://<hostname>/token).ELOG_CLI_CLIENT_ID: The client ID for OAuth2 authentication.ELOG_CLI_CLIENT_SECRET: The client secret for OAuth2 authentication.ELOG_CLI_ENPOINT_URL: The base URL for the elog management backend client.
Development
This project uses a devcontainer to run a complete setup environment to permit developers to work on the CLI. The devcontainer starts the elog backend container so the developer can interact with the backend without using the official one.
-
Download the mock user authentication data:
wget http://elog:8080/v1/mock/users-auth -O user.json
-
Generate the Python client from the OpenAPI specification:
~/.local/bin/openapi-python-client generate --url http://elog:8080/api-docs --output-path elog_management_backend_client --overwrite
-
Ensure all required environment variables are set:
export ENPOINT_URL="http://elog:8080"
-
Run the application:
python main.py login --login-type token
and paste one of the tokens found in the above downloaded
user.json.
Helper Executable
A helper executable elog-cli is provided to simplify running the CLI. This script loads environment variables from a .env file and locates the main.py script to execute it. elog-cli helper try to find the .env file into the same directory of the script, to modify this behaviour the ELOG_CLI_ENV_FILE_PATH environment variable that point to the specific .env file can be used.
Usage
- Ensure the
.envfile is present in the root directory of the project. - Make the
elog-cliscript executable:chmod +x elog-cli
- Run the
elog-cliscript with the desired commands:./elog-cli login --login-type token
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elog_cli-0.1.29.tar.gz.
File metadata
- Download URL: elog_cli-0.1.29.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d55dba51d9b2368be8a123885cea54d0d57b699c8320f17bbeb9ccc6518e3eb4
|
|
| MD5 |
bbd4b81daa94ca75f9aa3bff8890e779
|
|
| BLAKE2b-256 |
03e9d1fa202aa22b520802ffbdea848834d42ccc9707e694e69ddf959ca86782
|
File details
Details for the file elog_cli-0.1.29-py3-none-any.whl.
File metadata
- Download URL: elog_cli-0.1.29-py3-none-any.whl
- Upload date:
- Size: 180.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e49eaa7c54834601ef7c3ea88da7ad19a22789e1299299cd6704c19b83c0c268
|
|
| MD5 |
4007384e9bcbfedcb79405efe131a58f
|
|
| BLAKE2b-256 |
2621686def042aa3a3cf1d022a3ddf132d687dae8a827726f1979a2358397231
|