cli-mastery
**Tags:** #tools #cli #railway #github #env
When & Why to Use This Skill
The CLI Mastery & Environment Protocol skill is designed to streamline developer workflows by providing a standardized interface for Railway and GitHub CLIs. It features a critical environment variable protocol that uses a smart 'run' wrapper to automatically inject secrets, preventing manual configuration errors and enhancing security during local development and deployment.
Use Cases
- Secure Secret Injection: Use the 'run' command wrapper to automatically fetch and inject Railway environment variables into your execution context, eliminating the need for local .env files.
- Cloud Infrastructure Monitoring: Efficiently check environment status, list active services, and retrieve the latest deployment logs from Railway for rapid debugging.
- GitHub Workflow Automation: Manage pull requests and repository states directly through the CLI using structured JSON data for better integration and faster code reviews.
- Standardized Development Environment: Enforce a consistent command execution protocol across teams to ensure all developers are using the correct environment secrets and CLI tools.
| name | cli-mastery |
|---|---|
| description | **Tags:** #tools #cli #railway #github #env |
CLI Mastery & Environment Protocol
Tags: #tools #cli #railway #github #env
🚨 Environment Variable Protocol (CRITICAL)
Core Rule: Do NOT look for .env files.
Automation: Use the run command wrapper.
The run Command
We have installed a smart wrapper called run. It automatically detects if you need Railway secrets and injects them.
Usage:
Always prefix your execution commands with run.
- ❌
python main.py - ✅
run python main.py(Automatically becomesrailway run python main.py) - ✅
run pytest - ✅
run make dev
Verification:
If run env | grep DATABASE_URL returns nothing, then the project is not configured correctly.
🚅 Railway CLI (railway)
1. Context
- Check Environment:
railway environment - List Services:
railway service
2. Diagnosis
Don't guess. Check the logs.
# Get the last 50 lines of logs
run railway logs -n 50
🐙 GitHub CLI (gh)
1. Reading State (JSON is King)
Always use --json to get structured data.
# List open PRs
gh pr list --json number,title,author,state
2. Actions
# Create a PR
gh pr create --fill