railway functions
Manage serverless functions in your Railway project.
Usage
railway functions <COMMAND> [OPTIONS]Aliases
railway functionrailway funcrailway fnrailway funcsrailway fns
Subcommands
| Subcommand | Aliases | Description |
|---|---|---|
list | ls | List functions |
new | create, add | Add a new function |
delete | remove, rm | Delete a function |
push | up, deploy | Push changes to a function |
pull | Pull changes from a linked function | |
link | Link a function manually |
Examples
List functions
railway functions listCreate a new function
railway functions new --path ./my-function.ts --name my-functionCreate an HTTP function
railway functions new --path ./api.ts --name api --httpCreate a cron function
railway functions new --path ./job.ts --name cleanup --cron "0 * * * *"Push changes
railway functions pushPush with watch mode
railway functions push --watchPull remote changes
railway functions pullDelete a function
railway functions delete --function my-functionLink a function
railway functions link --function my-function --path ./local-function.tsOptions for
| Flag | Description |
|---|---|
-p, --path <PATH> | Path to the function file |
-n, --name <NAME> | Name of the function |
-c, --cron <SCHEDULE> | Cron schedule for the function |
--http | Generate a domain for HTTP access |
-s, --serverless | Enable serverless mode (sleeping) |
-w, --watch | Watch for changes and deploy on save |
Options for
| Flag | Description |
|---|---|
-p, --path <PATH> | Path to the function |
-w, --watch | Watch for changes and deploy on save |
Options for
| Flag | Description |
|---|---|
-f, --function <FUNCTION> | ID or name of the function to delete |
-y, --yes | Skip confirmation dialog |
Common options
| Flag | Description |
|---|---|
-e, --environment <ENV> | Environment ID or name |