Skip to content

feat: Revamp CLI with environment variables support and improved DX#190

Merged
josead merged 1 commit intomasterfrom
feature/cli-revamp-env-vars-and-dx
Feb 4, 2026
Merged

feat: Revamp CLI with environment variables support and improved DX#190
josead merged 1 commit intomasterfrom
feature/cli-revamp-env-vars-and-dx

Conversation

@josead
Copy link
Member

@josead josead commented Feb 4, 2026

Summary

This PR introduces several improvements to the metacall-deploy CLI to enhance developer experience and fix known issues:

  • Fix Plans selection is not working. #189: Plan selection now correctly respects the user's --plan flag instead of always defaulting to the first available plan
  • Environment variables: New -E/--env and --envFile flags for flexible env var configuration
  • File filtering: New -I/--ignore flag to exclude files from deployment using glob patterns
  • Output modes: New --quiet, --verbose, and --json flags for different output needs
  • Dry-run mode: New --dryRun flag to preview deployments without executing them
  • Improved help: Reorganized documentation with examples

New CLI Flags

Flag Description
-E, --env KEY=VALUE Set environment variable (repeatable)
--envFile <path> Load env vars from file (repeatable)
-I, --ignore <pattern> Ignore files matching pattern (repeatable)
-q, --quiet Suppress non-essential output
-V, --verbose Show detailed debug output
--json Output in JSON format for scripting
--dryRun Preview deployment without deploying

Test plan

  • Unit tests pass (npm run unit)
  • Build compiles successfully (npm run build)
  • Help output displays correctly (metacall-deploy -h)
  • Version flag works with JSON output (metacall-deploy --version --json)
  • Manual testing of deployment with new env flags
  • Manual testing of ignore patterns
  • Manual testing of dry-run mode

Examples

# Deploy with environment variables
metacall-deploy -E DB_HOST=localhost -E DB_PORT=5432

# Deploy with env file
metacall-deploy --envFile .env.production

# Preview deployment
metacall-deploy --dryRun

# Deploy ignoring test files
metacall-deploy -I "*.test.js" -I "*.spec.ts"

# Get JSON output for CI/CD
metacall-deploy --json -i

This commit introduces several improvements to the metacall-deploy CLI:

## Bug Fixes
- Fix #189: Plan selection now correctly respects user's --plan flag
  instead of always defaulting to the first available plan

## New Features
- Environment variables:
  - `-E, --env KEY=VALUE` - Set env vars directly (repeatable)
  - `--envFile <path>` - Load env vars from file (repeatable)
  - Priority: CLI --env > --envFile > project .env file

- File filtering:
  - `-I, --ignore <pattern>` - Ignore files matching glob patterns

- Output modes:
  - `-q, --quiet` - Suppress non-essential output
  - `-V, --verbose` - Show detailed debug output
  - `--json` - JSON output for scripting/CI

- Dry-run mode:
  - `--dryRun` - Preview deployment without deploying

## Improvements
- Enhanced logging system with debug(), success(), jsonOutput()
- Reorganized help documentation with examples
- Better error messages and user feedback
- Non-interactive mode improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@josead josead requested a review from viferga February 4, 2026 02:14
@josead josead merged commit 1309892 into master Feb 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plans selection is not working.

1 participant