1.0.2-alpha ⢠Published 7 months ago
actorcli v1.0.2-alpha
ActorCLI
A powerful CLI tool for managing GitHub Actions workflows and environment variables.
š Table of Contents
- Features
- Configuration
- Quick Start
- Commands
- Development
- Project Structure
- Error Handling
- Contributing
- Support
- Authoer
- License
š Features
š Environment Management
- Load and sync
.env
files across environments. - Secure variable handling with validation.
- Pre/post operation hooks.
- Load and sync
āļø Workflow Management
- Simulate GitHub Actions workflows locally using
act
. - List available workflows and monitor execution status.
- Simulate GitHub Actions workflows locally using
š ļø 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 (forsimulate
).--format
: Output format forlist
(default:table
).
ā” Quick Start
Install ActorCLI globally:
npm install -g actorcli
Initialize in your project:
actor init
Load environment variables:
actor load -e development
List workflows:
actor list
š Commands
Command | Description | Example |
---|---|---|
load | Load environment variables. | actor load -e production |
sync | Sync environment variables across services. | actor sync -f |
simulate | Simulate a GitHub Actions workflow locally. | actor simulate -w build |
list | Show available workflows. | actor list -f json |
help | Show 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
Script | Description |
---|---|
build | Build the project. |
dev | Start development mode. |
test | Run tests. |
lint | Lint the codebase. |
format | Format 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:
- Fork the repository.
- Create a feature branch.
- Make your changes and commit them.
- 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