Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

feat: add CLI arguments for non-interactive automation#10

Open
johnwarden wants to merge 1 commit into
skyware-js:mainfrom
johnwarden:cli-args-feature
Open

feat: add CLI arguments for non-interactive automation#10
johnwarden wants to merge 1 commit into
skyware-js:mainfrom
johnwarden:cli-args-feature

Conversation

@johnwarden
Copy link
Copy Markdown

@johnwarden johnwarden commented Aug 6, 2025

Summary

This PR adds CLI argument support to the setup, clear, and recreate commands, enabling non-interactive automation while maintaining security for sensitive operations.

Changes

Added CLI Arguments

  • setup: --did, --password, --pds, --endpoint, --signing-key, --labels-config
  • clear: --did, --password, --pds
  • recreate: --did, --password, --pds

Key Features

  • 🔧 Non-interactive automation: Commands can run without user prompts when CLI args provided
  • 🛡️ Security maintained: PLC token remains interactive (email confirmation required)
  • 🔄 Backward compatible: Falls back to interactive prompts when CLI args not provided
  • 📦 Robust parsing: Uses yargs for professional CLI argument handling

Use Cases

This enables:

  • CI/CD automation: Automated labeler setup in deployment pipelines
  • Development workflows: Quick recreation of labeler declarations
  • Scripted operations: Batch operations and infrastructure as code

Example Usage

# Non-interactive setup (PLC token still prompted for security)
npx @skyware/labeler setup --did=$DID --password=$PASSWORD --endpoint=https://labeler.example.com

# Fully non-interactive recreate
npx @skyware/labeler recreate --did=$DID --password=$PASSWORD

# Clear with minimal interaction (PLC token prompted)
npx @skyware/labeler clear --did=$DID --password=$PASSWORD

…e commands

- Add yargs for robust CLI argument parsing
- Support --did, --password, --pds options for setup, clear, and recreate
- Keep PLC token interactive for security (email confirmation required)
- Maintain backward compatibility with existing interactive prompts
@ThisIsMissEm
Copy link
Copy Markdown
Contributor

I might suggest instead of yargs to use optique — it does a bunch of typesafety on the values, validating them before you use them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants