Setup
Yeedu CLI (Command Line Interface) is a standard CLI to run interactively with Yeedu's RESTful-API.
You need to run the commands below from the project directory to set up the Yeedu CLI in your environment.
- PyPI
pip install yeedu-cli==4.10.4
Environment Variable Setup
Create a .env file in the project directory and provide below environment variables.
# Below mentioned values are the default values of Environment Variables
YEEDU_RESTAPI_URL="http://localhost:8080"
YEEDU_CLI_LOG_DIR=~/.yeedu/cli/logs/
YEEDU_CLI_MAX_LOG_FILES=5 # Number of log files as an integer
YEEDU_CLI_MAX_LOG_FILE_SIZE=30 # Log file size in MB as an integer
YEEDU_USERNAME=USER
YEEDU_PASSWORD=PASS
YEEDU_RESTAPI_TOKEN=<YOUR_TOKEN>
YEEDU_RESTAPI_TOKEN_FILE_PATH=/home/user/yeedu_cli.config
⚠️ Security Warning: Never commit actual tokens to .env files or version control. Always use placeholder values like <YOUR_TOKEN> and set real tokens at runtime.
Alternative of .env file
- Windows
- Linux
SET YEEDU_RESTAPI_URL="http://localhost:8080"
SET YEEDU_CLI_LOG_DIR=~/.yeedu/cli/logs/
SET YEEDU_CLI_MAX_LOG_FILES=5
SET YEEDU_CLI_MAX_LOG_FILE_SIZE=30
SET YEEDU_USERNAME=USER
SET YEEDU_PASSWORD=PASS
SET YEEDU_RESTAPI_TOKEN=<YOUR_TOKEN>
SET YEEDU_RESTAPI_TOKEN_FILE_PATH=/home/user/yeedu_cli.config
export YEEDU_RESTAPI_URL="http://localhost:8080"
export YEEDU_CLI_LOG_DIR=~/.yeedu/cli/logs/
export YEEDU_CLI_MAX_LOG_FILES=5
export YEEDU_CLI_MAX_LOG_FILE_SIZE=30
export YEEDU_USERNAME=USER
export YEEDU_PASSWORD=PASS
export YEEDU_RESTAPI_TOKEN=<YOUR_TOKEN>
export YEEDU_RESTAPI_TOKEN_FILE_PATH=/home/user/yeedu_cli.config
Authentication Setup
- Below mentions ways of storing the credentials which will be used [Environment Variables will be given a priority] to generate the token.
Storing the credentials as Environment Variables
YEEDU_USERNAME=USER
YEEDU_PASSWORD=PASS
Storing the credentials inside a yeedu_credentials.config file
- The yeedu_credentials.config file needs to be created inside the directory
home/user/.yeedu/which consists of JSON as shown below:
{
"YEEDU_USERNAME": "USER",
"YEEDU_PASSWORD": "PASS"
}
Storing the Yeedu Session Token inside a file
- If you already have the Yeedu Session Token, you can save the token at any location and provide the file path in the environment variable
YEEDU_RESTAPI_TOKEN_FILE_PATH- For example
YEEDU_RESTAPI_TOKEN_FILE_PATH="/home/user/Documents/YeeduToken/{FileName}"
- For example
- Format to store the token is as shown below:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJpYXQiOjE2ODg3MjA0MjIsImV4cCI6MTY4ODg5MzIyMn0.EfxuXKPBISQB4ep-sPQbo6R7tg2irlnAC_krqnuXJ5Q"
}
Rules for Using Tokens
- Tenant-Specific Tokens
- Each token for a user must be tied to a single tenant and must not be shared or used across multiple tenants under any circumstances while scheduling jobs.
- Timeout Configuration
- Tokens should be configured with a timeout value of infinity unless explicitly specified otherwise.
- Purpose-Specific Usage
- Tokens must only be used for their designated purposes and should not be repurposed for any other functionalities or operations.