OpenCode is a powerful open-source AI coding agent built for the terminal. It features a rich TUI interface, multi-session support, and works with over 75 LLM providers including Claude, OpenAI, Gemini, and local models. With built-in agents for development and planning, LSP integration, and Railway CLI access, OpenCode gives you maximum flexibility without vendor lock-in.
Install OpenCode via the quick install script
curl -fsSL https://opencode.ai/install | bashInstall Railway CLI and authenticate
npm install -g @railway/cli && railway loginLaunch OpenCode in your project directory
opencodeOpenCode creates the services, wires up environment variables, and deploys, all from your terminal
Deploy this project to Railway with a Postgres database and Redis cache“Deploy this project to Railway”
“Add a Redis cache to my project”
“Check the deployment logs and fix any errors”
“Set up environment variables for production”
“Configure health checks and automatic restarts”
“Create separate staging and production environments”
“Deploy a Next.js app with Postgres and Redis on Railway”
“Set up a Python API with Celery workers and Redis broker”
“Deploy a microservices setup with shared Postgres and private networking”
“Create a Django app with Postgres, Redis, and background workers on Railway”
Railway Skills extend OpenCode with Railway-specific commands for deploying, managing, and monitoring your projects. View all skills on GitHub →
Install Railway Skills
curl -fsSL railway.com/skills.sh | bashor
npx skills add railwayapp/railway-skillsrailway variablesrailway login if neededrailway uprailway logsrailway logs to fetch recent logsrailway uprailway variablesrailway variables setrailway upMake sure Railway CLI is installed and run railway login to authenticate. Then ask OpenCode to deploy your project with railway up. OpenCode will handle the entire flow.
Yes! OpenCode supports 75+ models including Claude, GPT-4, Gemini, and local models. You can even switch models mid-session while maintaining context.
Ask OpenCode to run railway logs to fetch deployment logs. It will analyze the errors, suggest fixes, and can apply them directly to your code.
OpenCode can't find Railway CLI
Ensure Railway CLI is installed globally with npm install -g @railway/cli and is in your PATH.
Model API key not configured
Set your preferred LLM provider's API key as an environment variable (e.g. ANTHROPIC_API_KEY or OPENAI_API_KEY).
Deploy fails with permission error
Run railway login to re-authenticate, or check that your Railway token has the correct permissions.
Get started in minutes. Railway handles the infrastructure.