@cleocode/cleo 2026.3.4 → 2026.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +2277 -609
- package/dist/cli/index.js.map +4 -4
- package/dist/mcp/index.js +1838 -443
- package/dist/mcp/index.js.map +4 -4
- package/package.json +1 -1
- package/packages/ct-skills/index.js +1 -1
- package/packages/ct-skills/package.json +0 -2
- package/packages/ct-skills/profiles/core.json +1 -1
- package/packages/ct-skills/profiles/full.json +4 -5
- package/packages/ct-skills/profiles/minimal.json +3 -3
- package/packages/ct-skills/profiles/recommended.json +2 -2
- package/packages/ct-skills/provider-skills-map.json +97 -0
- package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
- package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
- package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
- package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
- package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
- package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
- package/packages/ct-skills/skills/manifest.json +217 -947
- package/packages/ct-skills/skills.json +244 -3
- package/server.json +4 -4
- package/templates/CLEO-INJECTION.md +24 -0
- package/packages/ct-skills/protocols/agent-protocol.md +0 -260
- package/packages/ct-skills/protocols/artifact-publish.md +0 -587
- package/packages/ct-skills/protocols/consensus.md +0 -309
- package/packages/ct-skills/protocols/contribution.md +0 -375
- package/packages/ct-skills/protocols/decomposition.md +0 -352
- package/packages/ct-skills/protocols/implementation.md +0 -344
- package/packages/ct-skills/protocols/provenance.md +0 -600
- package/packages/ct-skills/protocols/release.md +0 -635
- package/packages/ct-skills/protocols/research.md +0 -248
- package/packages/ct-skills/protocols/specification.md +0 -287
- package/packages/ct-skills/protocols/testing.md +0 -346
- package/packages/ct-skills/protocols/validation.md +0 -229
- package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
- package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
- package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
- package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
- package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
- package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
- package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
- package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
- package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
- package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
- package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
- package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
- package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
- package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
- package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
- package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
- package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
- package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
- package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
- package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
- package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
- package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
- package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
- package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
- package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
- package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
- package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
- package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
- package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Shared Railway CLI utilities
|
|
3
|
-
# Source this file for common preflight checks and helper functions
|
|
4
|
-
# Usage: source _shared/scripts/railway-common.sh
|
|
5
|
-
|
|
6
|
-
set -euo pipefail
|
|
7
|
-
|
|
8
|
-
# Minimum required CLI version
|
|
9
|
-
readonly MIN_RAILWAY_VERSION="4.27.3"
|
|
10
|
-
|
|
11
|
-
# Check if Railway CLI is installed
|
|
12
|
-
check_railway_cli() {
|
|
13
|
-
if command -v railway &>/dev/null; then
|
|
14
|
-
local path
|
|
15
|
-
path=$(which railway)
|
|
16
|
-
echo '{"installed": true, "path": "'"$path"'"}'
|
|
17
|
-
return 0
|
|
18
|
-
else
|
|
19
|
-
echo '{"installed": false, "error": "cli_missing", "message": "Railway CLI not installed. Install with: npm install -g @railway/cli or brew install railway"}'
|
|
20
|
-
return 1
|
|
21
|
-
fi
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# Check if user is authenticated
|
|
25
|
-
check_railway_auth() {
|
|
26
|
-
local output
|
|
27
|
-
local exit_code
|
|
28
|
-
|
|
29
|
-
output=$(railway whoami --json 2>&1) || exit_code=$?
|
|
30
|
-
|
|
31
|
-
if [[ ${exit_code:-0} -eq 0 ]]; then
|
|
32
|
-
echo "$output"
|
|
33
|
-
return 0
|
|
34
|
-
else
|
|
35
|
-
echo '{"authenticated": false, "error": "not_authenticated", "message": "Not logged in to Railway. Run: railway login"}'
|
|
36
|
-
return 1
|
|
37
|
-
fi
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# Get workspace info
|
|
41
|
-
get_workspaces() {
|
|
42
|
-
local whoami
|
|
43
|
-
whoami=$(check_railway_auth) || return 1
|
|
44
|
-
echo "$whoami" | jq '.workspaces // []'
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# Check if project is linked
|
|
48
|
-
check_railway_linked() {
|
|
49
|
-
local output
|
|
50
|
-
local exit_code
|
|
51
|
-
|
|
52
|
-
output=$(railway status --json 2>&1) || exit_code=$?
|
|
53
|
-
|
|
54
|
-
if [[ ${exit_code:-0} -eq 0 ]] && [[ "$output" != *"No linked project"* ]] && [[ "$output" != *"error"* ]]; then
|
|
55
|
-
echo "$output"
|
|
56
|
-
return 0
|
|
57
|
-
else
|
|
58
|
-
echo '{"linked": false, "error": "not_linked", "message": "No Railway project linked. Run: railway link or railway init"}'
|
|
59
|
-
return 1
|
|
60
|
-
fi
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
# Check if parent directory is linked
|
|
64
|
-
check_parent_linked() {
|
|
65
|
-
local current_dir
|
|
66
|
-
current_dir=$(pwd)
|
|
67
|
-
|
|
68
|
-
cd .. || return 1
|
|
69
|
-
|
|
70
|
-
local output
|
|
71
|
-
local exit_code
|
|
72
|
-
|
|
73
|
-
output=$(railway status --json 2>&1) || exit_code=$?
|
|
74
|
-
|
|
75
|
-
cd "$current_dir" || return 1
|
|
76
|
-
|
|
77
|
-
if [[ ${exit_code:-0} -eq 0 ]] && [[ "$output" != *"No linked project"* ]]; then
|
|
78
|
-
echo '{"parent_linked": true, "context": '"$output"'}'
|
|
79
|
-
return 0
|
|
80
|
-
else
|
|
81
|
-
echo '{"parent_linked": false}'
|
|
82
|
-
return 1
|
|
83
|
-
fi
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
# Check CLI version
|
|
87
|
-
check_railway_version() {
|
|
88
|
-
local required="${1:-$MIN_RAILWAY_VERSION}"
|
|
89
|
-
local version
|
|
90
|
-
|
|
91
|
-
if ! command -v railway &>/dev/null; then
|
|
92
|
-
echo '{"ok": false, "error": "cli_missing", "message": "Railway CLI not installed"}'
|
|
93
|
-
return 1
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
version=$(railway --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
|
|
97
|
-
|
|
98
|
-
if [[ -z "$version" ]]; then
|
|
99
|
-
echo '{"ok": false, "error": "version_unknown", "message": "Could not determine Railway CLI version"}'
|
|
100
|
-
return 1
|
|
101
|
-
fi
|
|
102
|
-
|
|
103
|
-
# Compare versions
|
|
104
|
-
local lowest
|
|
105
|
-
lowest=$(printf '%s\n%s' "$required" "$version" | sort -V | head -n1)
|
|
106
|
-
|
|
107
|
-
if [[ "$lowest" == "$required" ]]; then
|
|
108
|
-
echo "{\"ok\": true, \"version\": \"$version\", \"required\": \"$required\"}"
|
|
109
|
-
return 0
|
|
110
|
-
else
|
|
111
|
-
echo "{\"ok\": false, \"version\": \"$version\", \"required\": \"$required\", \"error\": \"version_outdated\", \"message\": \"Railway CLI $version is below required $required. Run: railway upgrade\"}"
|
|
112
|
-
return 1
|
|
113
|
-
fi
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
# Full preflight check
|
|
117
|
-
railway_preflight() {
|
|
118
|
-
local check_version="${1:-true}"
|
|
119
|
-
|
|
120
|
-
# Check CLI installed
|
|
121
|
-
if ! command -v railway &>/dev/null; then
|
|
122
|
-
echo '{"ready": false, "error": "cli_missing", "step": "cli", "message": "Railway CLI not installed. Install with: npm install -g @railway/cli or brew install railway"}'
|
|
123
|
-
return 1
|
|
124
|
-
fi
|
|
125
|
-
|
|
126
|
-
# Check version if requested
|
|
127
|
-
if [[ "$check_version" == "true" ]]; then
|
|
128
|
-
local version_check
|
|
129
|
-
version_check=$(check_railway_version) || {
|
|
130
|
-
echo "$version_check"
|
|
131
|
-
return 1
|
|
132
|
-
}
|
|
133
|
-
fi
|
|
134
|
-
|
|
135
|
-
# Check authenticated
|
|
136
|
-
local auth_check
|
|
137
|
-
auth_check=$(railway whoami --json 2>&1) || {
|
|
138
|
-
echo '{"ready": false, "error": "not_authenticated", "step": "auth", "message": "Not logged in to Railway. Run: railway login"}'
|
|
139
|
-
return 1
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
echo '{"ready": true, "cli": true, "authenticated": true}'
|
|
143
|
-
return 0
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
# List projects with essential fields only
|
|
147
|
-
list_projects_essential() {
|
|
148
|
-
if ! railway_preflight >/dev/null; then
|
|
149
|
-
return 1
|
|
150
|
-
fi
|
|
151
|
-
|
|
152
|
-
railway list --json 2>/dev/null | jq '[.[] | {
|
|
153
|
-
id: .id,
|
|
154
|
-
name: .name,
|
|
155
|
-
workspace: (.workspace // .workspaceId // "personal"),
|
|
156
|
-
services: [.services[].name // empty]
|
|
157
|
-
}]' 2>/dev/null || echo '[]'
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
# Get project context (safely)
|
|
161
|
-
get_project_context() {
|
|
162
|
-
local context
|
|
163
|
-
context=$(check_railway_linked) || return 1
|
|
164
|
-
|
|
165
|
-
# Extract essential fields
|
|
166
|
-
echo "$context" | jq '{
|
|
167
|
-
project: {
|
|
168
|
-
id: .project.id,
|
|
169
|
-
name: .project.name
|
|
170
|
-
},
|
|
171
|
-
environment: {
|
|
172
|
-
id: .environment.id,
|
|
173
|
-
name: .environment.name
|
|
174
|
-
},
|
|
175
|
-
service: {
|
|
176
|
-
id: .service.id,
|
|
177
|
-
name: .service.name
|
|
178
|
-
},
|
|
179
|
-
services: [.services[].node // .services[] | {id: .id, name: .name}]
|
|
180
|
-
}'
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
# Detect project type from files
|
|
184
|
-
detect_project_type() {
|
|
185
|
-
local dir="${1:-.}"
|
|
186
|
-
|
|
187
|
-
# Check for various project types
|
|
188
|
-
if [[ -f "$dir/package.json" ]]; then
|
|
189
|
-
if [[ -f "$dir/next.config.js" ]] || [[ -f "$dir/next.config.ts" ]] || [[ -f "$dir/next.config.mjs" ]]; then
|
|
190
|
-
echo '{"type": "nextjs", "language": "javascript", "framework": "next"}'
|
|
191
|
-
elif [[ -f "$dir/nuxt.config.ts" ]] || [[ -f "$dir/nuxt.config.js" ]]; then
|
|
192
|
-
echo '{"type": "nuxt", "language": "javascript", "framework": "nuxt"}'
|
|
193
|
-
elif grep -q '"express"' "$dir/package.json" 2>/dev/null; then
|
|
194
|
-
echo '{"type": "express", "language": "javascript", "framework": "express"}'
|
|
195
|
-
elif [[ -f "$dir/vite.config.ts" ]] || [[ -f "$dir/vite.config.js" ]]; then
|
|
196
|
-
echo '{"type": "vite", "language": "javascript", "framework": "vite"}'
|
|
197
|
-
else
|
|
198
|
-
echo '{"type": "nodejs", "language": "javascript", "framework": null}'
|
|
199
|
-
fi
|
|
200
|
-
elif [[ -f "$dir/requirements.txt" ]] || [[ -f "$dir/pyproject.toml" ]]; then
|
|
201
|
-
if [[ -f "$dir/main.py" ]] && grep -q 'fastapi\|FastAPI' "$dir/main.py" 2>/dev/null; then
|
|
202
|
-
echo '{"type": "fastapi", "language": "python", "framework": "fastapi"}'
|
|
203
|
-
elif [[ -f "$dir/manage.py" ]]; then
|
|
204
|
-
echo '{"type": "django", "language": "python", "framework": "django"}'
|
|
205
|
-
else
|
|
206
|
-
echo '{"type": "python", "language": "python", "framework": null}'
|
|
207
|
-
fi
|
|
208
|
-
elif [[ -f "$dir/go.mod" ]]; then
|
|
209
|
-
echo '{"type": "go", "language": "go", "framework": null}'
|
|
210
|
-
elif [[ -f "$dir/Cargo.toml" ]]; then
|
|
211
|
-
echo '{"type": "rust", "language": "rust", "framework": null}'
|
|
212
|
-
elif [[ -f "$dir/Dockerfile" ]]; then
|
|
213
|
-
echo '{"type": "docker", "language": null, "framework": "docker"}'
|
|
214
|
-
elif [[ -f "$dir/index.html" ]]; then
|
|
215
|
-
echo '{"type": "static", "language": "html", "framework": null}'
|
|
216
|
-
else
|
|
217
|
-
echo '{"type": "unknown", "language": null, "framework": null}'
|
|
218
|
-
fi
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
# Detect monorepo type
|
|
222
|
-
detect_monorepo_type() {
|
|
223
|
-
local dir="${1:-.}"
|
|
224
|
-
|
|
225
|
-
if [[ -f "$dir/pnpm-workspace.yaml" ]]; then
|
|
226
|
-
echo '{"type": "pnpm-workspace", "shared": true}'
|
|
227
|
-
elif [[ -f "$dir/turbo.json" ]]; then
|
|
228
|
-
echo '{"type": "turborepo", "shared": true}'
|
|
229
|
-
elif [[ -f "$dir/nx.json" ]]; then
|
|
230
|
-
echo '{"type": "nx", "shared": true}'
|
|
231
|
-
elif [[ -f "$dir/package.json" ]] && grep -q '"workspaces"' "$dir/package.json"; then
|
|
232
|
-
echo '{"type": "npm-workspace", "shared": true}'
|
|
233
|
-
elif [[ -d "$dir/packages" ]] || [[ -d "$dir/apps" ]]; then
|
|
234
|
-
# Check if apps share code
|
|
235
|
-
local has_shared=false
|
|
236
|
-
if [[ -d "$dir/packages/shared" ]] || [[ -d "$dir/libs" ]]; then
|
|
237
|
-
has_shared=true
|
|
238
|
-
fi
|
|
239
|
-
if [[ "$has_shared" == "true" ]]; then
|
|
240
|
-
echo '{"type": "monorepo", "shared": true}'
|
|
241
|
-
else
|
|
242
|
-
echo '{"type": "monorepo", "shared": false}'
|
|
243
|
-
fi
|
|
244
|
-
else
|
|
245
|
-
echo '{"type": "single", "shared": false}'
|
|
246
|
-
fi
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
# Helper: Print error message to stderr
|
|
250
|
-
railway_error() {
|
|
251
|
-
echo "Error: $1" >&2
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
# Helper: Print warning message
|
|
255
|
-
railway_warn() {
|
|
256
|
-
echo "Warning: $1"
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
# Helper: Print success message
|
|
260
|
-
railway_success() {
|
|
261
|
-
echo "✓ $1"
|
|
262
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Getting Started
|
|
2
|
-
|
|
3
|
-
Install Railway CLI and authenticate for first-time setup.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
### macOS
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
brew install railway
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Linux / Windows (WSL)
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g @railway/cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Verify Installation
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
railway --version
|
|
23
|
-
# Should be 4.27.0 or higher
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Authentication
|
|
27
|
-
|
|
28
|
-
### Interactive Login
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
railway login
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Opens browser for authentication.
|
|
35
|
-
|
|
36
|
-
### Browserless Login (SSH/CI)
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
railway login --browserless
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Follow the URL provided and paste the code.
|
|
43
|
-
|
|
44
|
-
### Token-Based Authentication
|
|
45
|
-
|
|
46
|
-
For CI/CD pipelines:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
# Project-level token
|
|
50
|
-
RAILWAY_TOKEN=xxx railway up
|
|
51
|
-
|
|
52
|
-
# Account-level token
|
|
53
|
-
RAILWAY_API_TOKEN=xxx railway list
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Get tokens from Railway dashboard:
|
|
57
|
-
1. Project Settings → Tokens
|
|
58
|
-
2. Account Settings → API Tokens
|
|
59
|
-
|
|
60
|
-
## Project Linking
|
|
61
|
-
|
|
62
|
-
### Create New Project
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
railway init -n my-project
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Options:
|
|
69
|
-
- `-n, --name` - Project name
|
|
70
|
-
- `-w, --workspace` - Workspace (if multiple)
|
|
71
|
-
|
|
72
|
-
### Link to Existing Project
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
railway link -p project-name
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Options:
|
|
79
|
-
- `-p, --project` - Project name or ID
|
|
80
|
-
- `-e, --environment` - Environment (default: production)
|
|
81
|
-
- `-s, --service` - Service to link
|
|
82
|
-
|
|
83
|
-
### Check Current Status
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
railway status --json
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Returns:
|
|
90
|
-
```json
|
|
91
|
-
{
|
|
92
|
-
"project": {
|
|
93
|
-
"id": "...",
|
|
94
|
-
"name": "my-project"
|
|
95
|
-
},
|
|
96
|
-
"environment": {
|
|
97
|
-
"id": "...",
|
|
98
|
-
"name": "production"
|
|
99
|
-
},
|
|
100
|
-
"service": {
|
|
101
|
-
"id": "...",
|
|
102
|
-
"name": "web"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Quick Verification
|
|
108
|
-
|
|
109
|
-
### Full Check
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
# Check CLI
|
|
113
|
-
command -v railway
|
|
114
|
-
|
|
115
|
-
# Check auth
|
|
116
|
-
railway whoami
|
|
117
|
-
|
|
118
|
-
# Check linked project
|
|
119
|
-
railway status
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Troubleshooting
|
|
123
|
-
|
|
124
|
-
**"command not found"**
|
|
125
|
-
```bash
|
|
126
|
-
# Reinstall
|
|
127
|
-
npm install -g @railway/cli
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
**"not authenticated"**
|
|
131
|
-
```bash
|
|
132
|
-
railway login
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**"no linked project"**
|
|
136
|
-
```bash
|
|
137
|
-
# Link existing
|
|
138
|
-
railway link -p project-name
|
|
139
|
-
|
|
140
|
-
# Or create new
|
|
141
|
-
railway init -n new-project
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Next Steps
|
|
145
|
-
|
|
146
|
-
Once installed and authenticated:
|
|
147
|
-
- [02-projects.md](02-projects.md) - Manage projects
|
|
148
|
-
- [03-services.md](03-services.md) - Create services
|
|
149
|
-
- [04-deployments.md](04-deployments.md) - Deploy code
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Project Management
|
|
2
|
-
|
|
3
|
-
Manage Railway projects, workspaces, and settings.
|
|
4
|
-
|
|
5
|
-
## List Projects
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
railway list --json
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Returns all projects across workspaces with essential fields.
|
|
12
|
-
|
|
13
|
-
## Switch Projects
|
|
14
|
-
|
|
15
|
-
### Link to Different Project
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
railway link -p project-name
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Unlink Current Directory
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
railway unlink
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Project Settings
|
|
28
|
-
|
|
29
|
-
### Update via API
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
source _shared/scripts/railway-api.sh
|
|
33
|
-
|
|
34
|
-
PROJECT_ID=$(get_project_id)
|
|
35
|
-
|
|
36
|
-
railway_api '
|
|
37
|
-
mutation updateProject($id: String!, $input: ProjectUpdateInput!) {
|
|
38
|
-
projectUpdate(id: $id, input: $input) {
|
|
39
|
-
name
|
|
40
|
-
prDeploys
|
|
41
|
-
isPublic
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
' "{\"id\": \"$PROJECT_ID\", \"input\": {\"prDeploys\": true}}"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Available Settings
|
|
48
|
-
|
|
49
|
-
| Setting | Type | Description |
|
|
50
|
-
|---------|------|-------------|
|
|
51
|
-
| `name` | String | Project name |
|
|
52
|
-
| `description` | String | Project description |
|
|
53
|
-
| `isPublic` | Boolean | Public visibility |
|
|
54
|
-
| `prDeploys` | Boolean | Deploy PRs to preview environments |
|
|
55
|
-
| `botPrEnvironments` | Boolean | Deploy Dependabot/Renovate PRs |
|
|
56
|
-
|
|
57
|
-
## Workspaces
|
|
58
|
-
|
|
59
|
-
### List Workspaces
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
railway whoami --json | jq '.workspaces'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Create Project in Specific Workspace
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
railway init -n my-project --workspace workspace-id
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Environments
|
|
72
|
-
|
|
73
|
-
### Create Environment
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
railway environment new staging
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Duplicate Environment
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
railway environment new staging --duplicate production
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Switch Environment
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
railway environment staging
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## PR Deploys
|
|
92
|
-
|
|
93
|
-
Enable automatic deployment of pull requests:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Via API (see above)
|
|
97
|
-
# Set prDeploys: true
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Each PR creates a preview environment with:
|
|
101
|
-
- Isolated database (if using templates)
|
|
102
|
-
- Unique URL
|
|
103
|
-
- Shared variables inherited
|
|
104
|
-
|
|
105
|
-
## Project Deletion
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
railway delete
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
⚠️ Permanent - cannot be undone.
|
|
112
|
-
|
|
113
|
-
## Next Steps
|
|
114
|
-
|
|
115
|
-
- [03-services.md](03-services.md) - Create services
|
|
116
|
-
- [06-environments.md](06-environments.md) - Environment configuration
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# Service Operations
|
|
2
|
-
|
|
3
|
-
Create, configure, and manage Railway services.
|
|
4
|
-
|
|
5
|
-
## Create Service
|
|
6
|
-
|
|
7
|
-
### Empty Service
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
railway add --service my-service
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### From GitHub Repo
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# Create empty service first
|
|
17
|
-
railway add --service my-api
|
|
18
|
-
|
|
19
|
-
# Then configure source (see 06-environments.md)
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### From Docker Image
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
source _shared/scripts/railway-api.sh
|
|
26
|
-
|
|
27
|
-
PROJECT_ID=$(get_project_id)
|
|
28
|
-
ENV_ID=$(get_environment_id)
|
|
29
|
-
|
|
30
|
-
railway_api '
|
|
31
|
-
mutation serviceCreate($input: ServiceCreateInput!) {
|
|
32
|
-
serviceCreate(input: $input) {
|
|
33
|
-
id
|
|
34
|
-
name
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
' "{\"input\": {\"projectId\": \"$PROJECT_ID\", \"name\": \"nginx\", \"source\": {\"image\": \"nginx:latest\"}}}"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Service Status
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
railway service status --json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Shows:
|
|
47
|
-
- Service name and ID
|
|
48
|
-
- Current deployment status
|
|
49
|
-
- Latest deployment info
|
|
50
|
-
|
|
51
|
-
## Update Service
|
|
52
|
-
|
|
53
|
-
### Rename Service
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
source _shared/scripts/railway-api.sh
|
|
57
|
-
|
|
58
|
-
SERVICE_ID=$(get_service_id)
|
|
59
|
-
|
|
60
|
-
railway_api '
|
|
61
|
-
mutation updateService($id: String!, $input: ServiceUpdateInput!) {
|
|
62
|
-
serviceUpdate(id: $id, input: $input) {
|
|
63
|
-
id
|
|
64
|
-
name
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
' "{\"id\": \"$SERVICE_ID\", \"input\": {\"name\": \"new-name\"}}"
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Change Icon
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
railway_api '
|
|
74
|
-
mutation updateService($id: String!, $input: ServiceUpdateInput!) {
|
|
75
|
-
serviceUpdate(id: $id, input: $input) {
|
|
76
|
-
id
|
|
77
|
-
icon
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
' "{\"id\": \"$SERVICE_ID\", \"input\": {\"icon\": \"https://devicons.railway.app/nodejs\"}}"
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Icon sources:
|
|
84
|
-
- Devicons: `https://devicons.railway.app/{name}`
|
|
85
|
-
- Custom URL: Any image URL
|
|
86
|
-
- Emoji: Direct emoji string
|
|
87
|
-
|
|
88
|
-
## Link Service
|
|
89
|
-
|
|
90
|
-
Switch linked service for current directory:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
railway service link
|
|
94
|
-
# Interactive selection
|
|
95
|
-
|
|
96
|
-
# Or specify directly
|
|
97
|
-
railway service link my-service
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Delete Service
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
source _shared/scripts/railway-api.sh
|
|
104
|
-
|
|
105
|
-
ENV_ID=$(get_environment_id)
|
|
106
|
-
SERVICE_ID=$(get_service_id)
|
|
107
|
-
|
|
108
|
-
# Stage deletion
|
|
109
|
-
railway_api '
|
|
110
|
-
mutation stageChanges($environmentId: String!, $input: EnvironmentConfig!) {
|
|
111
|
-
environmentStageChanges(environmentId: $environmentId, input: $input, merge: true) {
|
|
112
|
-
id
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
' "{\"environmentId\": \"$ENV_ID\", \"input\": {\"services\": {\"$SERVICE_ID\": {\"isDeleted\": true}}}}"
|
|
116
|
-
|
|
117
|
-
# Apply changes (see 06-environments.md)
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Service Types
|
|
121
|
-
|
|
122
|
-
### Web Service
|
|
123
|
-
|
|
124
|
-
Default service type:
|
|
125
|
-
- Exposes HTTP port
|
|
126
|
-
- Public domain assigned
|
|
127
|
-
- Health checks enabled
|
|
128
|
-
|
|
129
|
-
### Worker
|
|
130
|
-
|
|
131
|
-
Background service:
|
|
132
|
-
- No public domain
|
|
133
|
-
- Runs continuously
|
|
134
|
-
- Good for queue processors
|
|
135
|
-
|
|
136
|
-
### Cron Job
|
|
137
|
-
|
|
138
|
-
Scheduled execution:
|
|
139
|
-
- Runs on schedule
|
|
140
|
-
- Exits after completion
|
|
141
|
-
- See [10-cron.md](10-cron.md)
|
|
142
|
-
|
|
143
|
-
## Next Steps
|
|
144
|
-
|
|
145
|
-
- [04-deployments.md](04-deployments.md) - Deploy services
|
|
146
|
-
- [06-environments.md](06-environments.md) - Configure services
|
|
147
|
-
- [05-databases.md](05-databases.md) - Database services
|