Railway
All agents

Pi + Railway

Pi is Earendil's minimal coding agent harness — an open-source (MIT) CLI that reads files, writes and edits code, and runs shell commands directly in your project. It ships four core tools (read, write, edit, bash) and stays deliberately small: sub-agents, plan mode, and sandboxing are opt-in extensions rather than baked in. Pi authenticates against 15+ LLM providers (Anthropic, OpenAI, Google, and more) with mid-session model switching, and runs in interactive, print/JSON, RPC, or SDK modes. Paired with Railway, Pi deploys, sets variables, and reads logs from the terminal.

Quick start

1

Install Pi

Install the Pi CLI and authenticate a provider with an API key or OAuth

npm install -g @earendil-works/pi-coding-agent
2

Install Railway CLI

Install Railway CLI and authenticate

npm install -g @railway/cli && railway login
3

Open your project

Run `pi` in your repo. Add an AGENTS.md so Pi picks up project-level instructions

4

Deploy a Go API with Redis

Pi runs the Railway CLI and deploys railway.com/template/gin with a Redis service attached

Deploy this to Railway with a Redis cache for rate limiting

Example prompts

Deploy this Go API to Railway

Add Redis for caching API responses

Check the failing health check and fix it

Set up environment variables from my .env.example file

Configure the service to scale to zero when idle

Add a cron service that sends daily email digests

Deploy Plausible Analytics with Postgres and Clickhouse

Set up a Langchain app with Postgres (pgvector) for RAG

Deploy Grafana connected to my Railway metrics

Create a complete auth system with Keycloak and Postgres

Railway Skills

Railway Skills extend Pi 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 | bash

or

npx skills add railwayapp/railway-skills

Common workflows

1Deploy from the terminal

  1. Ask Pi to deploy the current directory to Railway
  2. Pi runs railway up and streams the build
  3. Pi reports the deployment URL and status
  4. Iterate in the same session with follow-up prompts

2Provision a Postgres database

  1. Ask Pi to add Postgres to your project
  2. Pi runs railway add for the database
  3. Pi wires DATABASE_URL into your service variables
  4. Pi redeploys and confirms the connection

3Switch models mid-task

  1. Start a task on a fast model to scaffold
  2. Switch to a stronger model for the tricky logic
  3. Pi keeps the full session history across the switch
  4. Deploy the result to Railway when it passes

4Automate with an extension

  1. Add a Pi extension for your deploy workflow
  2. Expose Railway steps as reusable skills
  3. Run Pi in print/JSON mode from a script
  4. Pipe the output into your CI pipeline

Tips for success

  • Add project instructions in AGENTS.md so Pi has context
  • Keep Pi minimal — add plan mode or sub-agents only if you need them
  • Use print/JSON mode to script Railway deploys

Frequently asked questions

How do I deploy to Railway with Pi?

Ask Pi to deploy to Railway. It runs the Railway CLI (railway up) with its bash tool, streams the build, and reports the deployment URL — all in the same terminal session.

Which models can I use with Pi?

Pi supports 15+ providers (Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, and more) via API key or OAuth, with mid-session model switching.

Is Pi open source?

Yes. Pi is MIT-licensed and available on GitHub. It's a minimal harness you extend with your own skills, extensions, and themes.

Troubleshooting

Issue:

Railway CLI not found in the Pi session

Solution:

Install the Railway CLI globally with npm install -g @railway/cli and restart your shell so railway is on PATH.

Issue:

Pi can't authenticate a model provider

Solution:

Set the provider's API key (e.g. ANTHROPIC_API_KEY or OPENAI_API_KEY) or complete OAuth, then retry.

Issue:

Railway commands fail with permission denied

Solution:

Run railway login to re-authenticate, then retry the deploy.

Community resources

Ready to deploy with Pi?

Get started in minutes. Railway handles the infrastructure.