1.0.2-alpha • Published 7 months ago

actorcli v1.0.2-alpha

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

ActorCLI

A powerful CLI tool for managing GitHub Actions workflows and environment variables.


šŸ“– Table of Contents

  1. Features
  2. Configuration
  3. Quick Start
  4. Commands
  5. Development
  6. Project Structure
  7. Error Handling
  8. Contributing
  9. Support
  10. Authoer
  11. License

šŸš€ Features

  • šŸ” Environment Management

    • Load and sync .env files across environments.
    • Secure variable handling with validation.
    • Pre/post operation hooks.
  • āš™ļø Workflow Management

    • Simulate GitHub Actions workflows locally using act.
    • List available workflows and monitor execution status.
  • šŸ› ļø Developer Tools

    • Automated setup with extensible plugin support.
    • Configurable and reusable CLI hooks.

āš™ļø Configuration

You can configure ActorCLI using a config.json file:

{
  "environments": ["development", "staging", "production"],
  "defaultEnv": "development",
  "hooks": {
    "pre-sync": "./scripts/pre-sync.js",
    "post-load": "./scripts/post-load.js"
  }
}

Environment Options

  • -e, --env: Target environment (e.g., development, staging, production).
  • -f, --force: Force the operation.
  • -w, --workflow: Workflow name to use (for simulate).
  • --format: Output format for list (default: table).

⚔ Quick Start

  1. Install ActorCLI globally:

    npm install -g actorcli
  2. Initialize in your project:

    actor init
  3. Load environment variables:

    actor load -e development
  4. List workflows:

    actor list

šŸ“œ Commands

CommandDescriptionExample
loadLoad environment variables.actor load -e production
syncSync environment variables across services.actor sync -f
simulateSimulate a GitHub Actions workflow locally.actor simulate -w build
listShow available workflows.actor list -f json
helpShow help information.actor help

šŸ”§ Development

Setup

# Install dependencies
npm install

Build

npm run build

Testing

# Run all tests
npm test

# Run specific suite
npm test -- workflow

# Generate coverage report
npm run coverage

Scripts

ScriptDescription
buildBuild the project.
devStart development mode.
testRun tests.
lintLint the codebase.
formatFormat the code.

šŸ“‚ Project Structure

actorcli/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ commands/       # Command implementations
│   ā”œā”€ā”€ hooks/          # Custom hooks
│   └── utils/          # Utility functions
ā”œā”€ā”€ tests/              # Unit and integration tests
ā”œā”€ā”€ docs/               # Documentation
└── scripts/            # Helper scripts for hooks

šŸ› ļø Error Handling

Common Issues and Solutions

  • Invalid Environment:

    Error: Environment 'test' not found.
    Solution: Use one of: development, staging, production.
  • Sync Failure:

    Error: Sync failed: Permission denied.
    Solution: Check GitHub token permissions.
  • Workflow Not Found:

    Error: Workflow 'deploy' does not exist.
    Solution: Verify the workflow name in `.github/workflows`.

šŸ¤ Contributing

We welcome contributions!
Follow these steps to get started:

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes and commit them.
  4. Submit a pull request for review.

šŸ“¢ Support

If you encounter any issues or have questions, feel free to:

  • Open an issue on GitHub.
  • Start a discussion in the repository.
  • Refer to the official documentation.

What's Optimized

  • Added Table of Contents for easy navigation.
  • Improved Quick Start and command references.
  • Enhanced Error Handling and Development sections.
  • Refined overall readability and organization.

šŸ–‹ļø Author

šŸ‘‹ Susumu Fujii


šŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.