Skip to main content

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.

  1. Download the mock user authentication data:

    wget http://elog:8080/v1/mock/users-auth -O user.json
    
  2. 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
    
  3. Ensure all required environment variables are set:

    export ENPOINT_URL="http://elog:8080"
    
  4. 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

  1. Ensure the .env file is present in the root directory of the project.
  2. Make the elog-cli script executable:
    chmod +x elog-cli
    
  3. Run the elog-cli script 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elog_cli-0.1.17.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elog_cli-0.1.17-py3-none-any.whl (171.2 kB view details)

Uploaded Python 3

File details

Details for the file elog_cli-0.1.17.tar.gz.

File metadata

  • Download URL: elog_cli-0.1.17.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for elog_cli-0.1.17.tar.gz
Algorithm Hash digest
SHA256 ec0dd9793e9967d2c273e26e13a28fe6e4ec277b6b6de5b53dae2395f64a5f35
MD5 7c3fda4e39bb2af523f8899bf4e1d452
BLAKE2b-256 ff021c092c4e13d9f679e05858e955508bc7a14cca8cef9f1e9c45a2ee981cd1

See more details on using hashes here.

File details

Details for the file elog_cli-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: elog_cli-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 171.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for elog_cli-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 b894c9f578f79ac7ed347c7467865b027fd07446b766e8ae6e02d8173d35366d
MD5 0a26774b5b9be546d9bd5a2a00cbfa0d
BLAKE2b-256 0845abb5cd3ae32ca433cd40a9f8f7d0a53a9a745eb6befbed2a44f7cb35a9e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page