cli-mastery

stars-end 的头像作者 stars-end

**标签:** #工具 #命令行 #铁路 #GitHub #环境

📖 中文导读:**标签:** #工具 #命令行 #铁路 #GitHub #环境 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

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 becomes railway 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