{
  "manifest_version": "1.0.0",
  "template": {
    "id": "5cf55aa8-81ce-40cd-b6ff-7d2f87bff977",
    "slug": "deploy-opencode-ai-coding-agent",
    "name": "OpenCode",
    "description": "Open-source AI coding agent in your browser, persistent workspace",
    "url": "https://railway.com/deploy/deploy-opencode-ai-coding-agent",
    "upstream": {
      "image": "ghcr.io/onepush-dev/opencode:1.19.3@sha256:9a248429018cfcec9e51416ae5e85c78c45bb6c4b9e61141d7f18e435bedd6a3"
    }
  },
  "services": [
    {
      "name": "opencode",
      "source": {
        "image": "ghcr.io/onepush-dev/opencode:1.19.3@sha256:9a248429018cfcec9e51416ae5e85c78c45bb6c4b9e61141d7f18e435bedd6a3"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "HOME",
      "service": "opencode",
      "description": "Home directory on the volume; holds config, provider logins, sessions and git/ssh setup.",
      "secret": false,
      "strategy": "default",
      "default": "/data/home"
    },
    {
      "key": "PORT",
      "service": "opencode",
      "description": "Port OpenCode listens on and Railway routes the public domain to (4096).",
      "secret": false,
      "strategy": "default",
      "default": "4096"
    },
    {
      "key": "OPENCODE_HOSTNAME",
      "service": "opencode",
      "description": "Interface to bind; 0.0.0.0 so Railway's proxy can reach it.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "OPENCODE_WORKSPACE",
      "service": "opencode",
      "description": "Project folder on the volume where OpenCode starts; clone repos here.",
      "secret": false,
      "strategy": "default",
      "default": "/data/workspace"
    },
    {
      "key": "OPENCODE_SERVER_PASSWORD",
      "service": "opencode",
      "description": "Generated password for the web UI and API. Copy it from here to sign in.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "OPENCODE_SERVER_USERNAME",
      "service": "opencode",
      "description": "Username for the browser login (HTTP basic auth).",
      "secret": false,
      "strategy": "default",
      "default": "opencode"
    },
    {
      "key": "OPENCODE_DISABLE_AUTOUPDATE",
      "service": "opencode",
      "description": "Keep the pinned OpenCode version; upgrade by changing the image.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "opencode",
      "description": "Seconds OpenCode gets to finish work before a redeploy stops it.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-opencode-ai-coding-agent"
      }
    },
    "cli": "railway deploy --template deploy-opencode-ai-coding-agent",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "5cf55aa8-81ce-40cd-b6ff-7d2f87bff977",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "32075666-abd6-4c88-83b0-a12904dbe082": {
                  "icon": null,
                  "name": "opencode",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/site.webmanifest",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/onepush-dev/opencode:1.19.3@sha256:9a248429018cfcec9e51416ae5e85c78c45bb6c4b9e61141d7f18e435bedd6a3"
                  },
                  "variables": {
                    "HOME": {
                      "isOptional": false,
                      "description": "Home directory on the volume; holds config, provider logins, sessions and git/ssh setup.",
                      "defaultValue": "/data/home"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Port OpenCode listens on and Railway routes the public domain to (4096).",
                      "defaultValue": "4096"
                    },
                    "GEMINI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional Google Gemini key for Gemini models.",
                      "defaultValue": ""
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional OpenAI key for GPT models.",
                      "defaultValue": ""
                    },
                    "ANTHROPIC_API_KEY": {
                      "isOptional": true,
                      "description": "Optional Anthropic key for Claude models. Free models work without it.",
                      "defaultValue": ""
                    },
                    "OPENCODE_HOSTNAME": {
                      "isOptional": false,
                      "description": "Interface to bind; 0.0.0.0 so Railway's proxy can reach it.",
                      "defaultValue": "0.0.0.0"
                    },
                    "OPENCODE_WORKSPACE": {
                      "isOptional": false,
                      "description": "Project folder on the volume where OpenCode starts; clone repos here.",
                      "defaultValue": "/data/workspace"
                    },
                    "OPENROUTER_API_KEY": {
                      "isOptional": true,
                      "description": "Optional OpenRouter key for many models behind one key.",
                      "defaultValue": ""
                    },
                    "OPENCODE_SERVER_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the web UI and API. Copy it from here to sign in.",
                      "defaultValue": "{{OPENCODE_SERVER_PASSWORD}}"
                    },
                    "OPENCODE_SERVER_USERNAME": {
                      "isOptional": false,
                      "description": "Username for the browser login (HTTP basic auth).",
                      "defaultValue": "opencode"
                    },
                    "OPENCODE_DISABLE_AUTOUPDATE": {
                      "isOptional": false,
                      "description": "Keep the pinned OpenCode version; upgrade by changing the image.",
                      "defaultValue": "true"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Seconds OpenCode gets to finish work before a redeploy stops it.",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4096": {
                        "port": 4096
                      }
                    }
                  },
                  "volumeMounts": {
                    "32075666-abd6-4c88-83b0-a12904dbe082": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "opencode",
      "method": "GET",
      "path": "/site.webmanifest",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-10-17T16:14:42.276Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-17T12:06:32.953Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_b8c0c668b81c4acea0d0",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 58,
    "typical_build_seconds": 0,
    "typical_start_seconds": 41,
    "slowest_service": "opencode"
  }
}
