Terminal & CI/CD v0.1.1 • PyPI Release

LiteLambda CLI (`litelambda`)

Deploy, schedule, test, and view logs for your serverless Python background tasks straight from your local terminal, VS Code, or GitHub Actions without opening a web browser.

Published on PyPI
Package name: litelambda-cli • Command: litelambda
View on PyPI

1. Installation

The CLI is lightweight, has zero external wheel dependencies, and runs on any platform with Python 3.8+.

pip install --upgrade litelambda-cli

Verify installation:

litelambda --help

2. Authentication

To connect your CLI to your LiteLambda account, generate an API token from your Account Settings → API Tokens.

litelambda login

You will be prompted to paste your token (starts with ll_live_...). Your credentials are automatically saved securely in ~/.litelambda/credentials.json.

Headless / CI/CD Authentication

For automated environments (like GitHub Actions or Docker), set the LITELAMBDA_TOKEN environment variable without running interactive login:

export LITELAMBDA_TOKEN="ll_live_your_api_token_here"
litelambda whoami

3. Command Reference

litelambda deploy

Deploys a local Python file to LiteLambda. If a cron job with the specified name already exists, it updates it cleanly and creates a version snapshot; otherwise, it creates a new scheduled job.

# Basic deployment
litelambda deploy scraper.py --name "Daily Scraper" --schedule "0 9 * * *"

# Deploy with dependencies from requirements.txt
litelambda deploy bot.py --name "Telegram Bot" --schedule "*/15 * * * *" --requirements requirements.txt

# Specify custom execution timeout (seconds) and memory (MB)
litelambda deploy data_sync.py --schedule "0 0 * * *" --timeout 120 --ram 512

Arguments:

  • <file>: Path to local Python script containing def handler(event, context):.
  • --schedule "<cron>": Standard 5-field cron syntax (e.g. */10 * * * *). Defaults to 0 * * * * (hourly).
  • --name "<name>": Unique job name (defaults to file basename).
  • --requirements <file>: Optional path to a requirements.txt file to install pip dependencies in the sandbox.
  • --env KEY=VAL: Inject environment variables (repeatable: --env API_KEY=abc --env DB_HOST=xyz).
  • --timeout <sec>: Max execution time before container timeout (10–300s, default 30s).
  • --ram <mb>: RAM allocation (128, 256, 512, 1024, or 2048 MB).

litelambda list

Lists all active cron jobs in your account with schedule, status, and last run stats.

litelambda list

litelambda whoami

Displays your authenticated LiteLambda account details, current plan tier, remaining credits, and active cron count.

litelambda whoami

litelambda run

Manually triggers an immediate execution of any deployed cron job in the sandboxed cloud runtime.

litelambda run "Daily Scraper"

litelambda logs

Streams the most recent execution logs, exit codes, and timestamps straight to your console.

litelambda logs "Daily Scraper"

4. Automating with GitHub Actions

Continuous deployment is straightforward with the CLI. Add your LiteLambda API token as a GitHub repository secret (LITELAMBDA_TOKEN) and add this workflow to .github/workflows/deploy.yml:

name: Deploy Cron Job

on:
  push:
    branches: [ main ]
    paths:
      - 'scripts/**'
      - 'requirements.txt'

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install LiteLambda CLI
        run: pip install litelambda-cli

      - name: Deploy to LiteLambda Cloud
        env:
          LITELAMBDA_TOKEN: $
        run: |
          litelambda deploy scripts/daily_sync.py \
            --name "Production Sync" \
            --schedule "0 4 * * *" \
            --requirements requirements.txt

5. Security & Rate Limiting

Every request made by the CLI communicates over TLS 1.3 encrypted HTTPS. All requests require valid Bearer token authentication.

  • API tokens are hashed using SHA-256. Raw tokens are never stored on disk or database.
  • Standard endpoints are rate-limited to 120 requests/minute per user, protecting your automated pipelines against runaway loops.
  • Manual run triggers are rate-limited to 10 runs/minute per user to prevent sandbox queue exhaustion.

Ready to get started?

Generate your API token and deploy your first terminal cron job in under 60 seconds.