Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Railway CLI

БесплатноБез исполняемых скриптовНе проверен

Railway CLI operations for authentication, context management, deployment, monitoring, and troubleshooting. Use when working with Railway infrastructure…

iota-uzот iota-uz★ 486 звёзд на GitHub

Об этом скилле

Railway CLI for IOTA SDK

Check Authentication

railway whoami

Context Management

Check current context:

railway status

List all projects with IDs:

railway list --json | jq '.'

Link project manually (create .railway/config.json):

mkdir -p .railway
cat > .railway/config.json << 'EOF'
{
  "projectId": "<your-project-id>"
}
EOF

Switch environment:

railway environment <environment>

Deployment

Deploy to specific environment and service:

railway up -s <service> -e <environment> --detach

Redeploy latest deployment:

railway redeploy -s <service> -e <environment> -y

Check deployment status:

railway status -s <service> -e <environment>

Monitoring

View deployment logs (real-time stream):

railway logs -s <service> -e <environment> --deployment

View build logs:

railway logs -s <service> -e <environment> --build

Get logs in JSON format (for parsing):

railway logs -s <service> -e <environment> --deployment --json

Filter logs for errors/panics:

# Text output with grep
railway logs -s iota-sdk -e staging --deployment 2>&1 | grep -i -E "(panic|error|fatal)"

# JSON output with jq (more reliable)
railway logs -s iota-sdk -e staging --deployment --json 2>&1 | \
  jq -r 'select(.message | test("panic|error|fatal"; "i")) | "\(.timestamp) \(.message)"'

Get context around errors:

# Get 30 lines after each match
railway logs -s iota-sdk -e staging --deployment 2>&1 | grep -A 30 "panic"

# Limit total output
railway logs -s iota-sdk -e staging --deployment 2>&1 | tail -100

Note: Railway enforces a rate limit of 500 logs/sec per replica. High-volume logging may result in dropped messages.

Variables

Get all variables for a service:

railway variables -s <service> -e <environment> --kv

Set a variable:

railway variables -s <service> -e <environment> --set "KEY=value"

Running Commands

Execute local command with remote environment variables:

railway run -s <service> -e <environment> -- <command>

Note: railway run executes locally, not on the remote service. Use for running local commands with staging/production environment variables.

Database Access

Connect to database shell:

railway connect db -e <environment>

Get database connection URL:

railway variables -s db -e <environment> --kv | grep DATABASE_PUBLIC_URL

SSH into service (requires active deployment):

railway ssh -s <service> -e <environment>

Common Operations for IOTA SDK

Analyzing Panics and Errors

Find recent panics with stack traces:

# Get panic with 30 lines of context (includes stack trace)
railway logs -s iota-sdk -e staging --deployment 2>&1 | grep -A 30 "panic"

# Find specific error patterns
railway logs -s iota-sdk -e staging --deployment --json 2>&1 | \
  jq -r 'select(.message | test("your-pattern"; "i")) | .message' | tail -50

Common error patterns for IOTA SDK:

  • Translation errors: "message .* not found in language"
  • Database errors: "pq:|postgres:|connection|timeout"
  • HTTP panics: "http: panic serving"
  • Multi-tenant errors: "tenant_id|organization_id|forbidden"
  • Permission errors: "permission denied|insufficient permissions"

Running Migrations on Staging

Get database credentials and run migrations locally:

# Get the public database URL
railway variables -s db -e staging --kv | grep DATABASE_PUBLIC_URL
# Example output: DATABASE_PUBLIC_URL=postgresql://postgres:PASSWORD@HOST:PORT/railway

# Extract connection details from the URL and export
export DB_HOST=<host-from-url>          # Example: shuttle.proxy.rlwy.net
export DB_PORT=<port-from-url>          # Example: 31150
export DB_NAME=<database-from-url>      # Example: railway
export DB_USER=<user-from-url>          # Example: postgres
export DB_PASSWORD=<password-from-url>

# Check migration status
make db migrate status

# Run pending migrations
make db migrate up

# Rollback if needed
make db migrate down

Deploying New Version

# 1. Verify current status
railway status -s iota-sdk -e staging

# 2. Deploy new version
railway up -s iota-sdk -e staging --detach

# 3. Monitor deployment logs
railway logs -s iota-sdk -e staging --deployment

# 4. Verify deployment success
railway status -s iota-sdk -e staging

# 5. Check for errors
railway logs -s iota-sdk -e staging --deployment 2>&1 | grep -i error | tail -20

Environment Variable Management

# List all environment variables
railway variables -s iota-sdk -e staging --kv

# Update application config
railway variables -s iota-sdk -e staging --set "LOG_LEVEL=debug"

# Update database connection (example)
railway variables -s iota-sdk -e staging --set "DB_HOST=new-host"

# Trigger restart after variable changes
railway redeploy -s iota-sdk -e staging -y

Database Backup


Полный SKILL.md на GitHub

Установить Railway CLI в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Railway CLI?

Railway CLI operations for authentication, context management, deployment, monitoring, and troubleshooting. Use when working with Railway infrastructure, deploying services, or managing environments.

Как установить скилл Railway CLI?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Railway CLI запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Railway CLI с