Commit graph

808 commits

Author SHA1 Message Date
Brody Over
e330dcb0ea
support more config, and volumes (#795) 2026-02-13 09:08:40 -05:00
github-actions[bot]
eaafe342bb chore: Release railwayapp version 4.30.1 2026-02-12 20:47:54 +00:00
Brody Over
aa07d90503
Update environment.rs (#794) 2026-02-12 15:40:07 -05:00
Cadel
2c0f42eff5
Allow configFile in environment service patches (#792)
Add config_file to the service config model so dot-path updates can set configFile, and cover the new path/value in patch parser tests.
2026-02-12 15:39:47 -05:00
github-actions[bot]
51b896ffc5 chore: Release railwayapp version 4.30.0 2026-02-12 17:11:01 +00:00
Faraz Patankar
330ac9ed67
Add per-command CLI telemetry (#791)
* Add per-command telemetry via cliEventTrack mutation

Sends command name, subcommand, duration, success/error, OS, arch,
CLI version, and CI flag to the Railway API after each invocation.
Silently skipped when unauthenticated, on network failure, or when
the user opts out via DO_NOT_TRACK=1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Migrate telemetry to typed graphql_client mutation

Pull updated schema with cliEventTrack mutation and replace the raw
JSON POST with typed codegen via graphql_client, matching the rest
of the codebase. Also adds DNS_RECORD_TYPE_TXT from the schema update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add one-time telemetry notice on first run

Shows a notice to stderr informing users about CLI usage data
collection, with DO_NOT_TRACK=1 opt-out. Persisted to
~/.railway/notices.json so it only displays once. Suppressed
in CI/non-TTY and when telemetry is already disabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Support RAILWAY_NO_TELEMETRY env var for opting out of telemetry

Adds RAILWAY_NO_TELEMETRY=1 as a Railway-specific alternative to
DO_NOT_TRACK=1 for disabling CLI telemetry. Updates the notice
text to mention both variables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix telemetry docs link to /cli/telemetry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix cargo fmt --all formatting in telemetry notice

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 12:03:59 -05:00
Milo
85f6e0061b
Fix double deploys when using env new & changing configuration (#784)
* fix double deploy

* Revert "fix double deploy"

This reverts commit ef3b4b464f.

* small nits and improvements
2026-02-06 08:20:51 -05:00
github-actions[bot]
7f86594b1b chore: Release railwayapp version 4.29.0 2026-02-04 03:58:47 +00:00
Angelo
2a74000135
fix: show error level indicators in build logs (#782)
Build logs were using simple output mode which only displayed the raw
message without any formatting. This meant error-level logs from the
build process (like Docker build failures) didn't show the [ERRO]
indicator that helps users quickly identify problems.

Changes:
- Add LogFormat enum with Simple, LevelOnly, and Full modes
- Build logs now use LevelOnly mode to show level indicators without
  the noisy buildkit metadata (digest, source, inputs, etc.)
- Deploy logs continue to use Full mode with all attributes

This brings CLI build log output closer to what the dashboard shows.

Co-authored-by: Warp <agent@warp.dev>
2026-02-03 22:53:25 -05:00
github-actions[bot]
986d6fa22d chore: Release railwayapp version 4.28.0 2026-02-03 18:51:17 +00:00
Naman Kumar
31812239bc
Skip 2FA prompt for token-based auth (#781)
Token-based auth (RAILWAY_TOKEN, RAILWAY_API_TOKEN) is non-interactive
and bypasses 2FA on the backend anyway. Only prompt for 2FA when using
session-based auth from `railway login`.

https://discord.com/channels/713503345364697088/1467957064595800156
2026-02-04 00:15:17 +05:30
github-actions[bot]
a8a683c593 chore: Release railwayapp version 4.27.6 2026-02-03 05:20:20 +00:00
Jake Runzer
7b05e19f80
Use environmentPatchCommit in environment edit (#780)
* Use environmentPatchCommit in environment edit

* Fix formatting
2026-02-03 00:14:40 -05:00
github-actions[bot]
500b29d6db chore: Release railwayapp version 4.27.5 2026-01-30 01:07:44 +00:00
Brody Over
151d366ef6
Deployment messages for railway up (#779)
* Support CLI messages

* fmt
2026-01-29 20:02:13 -05:00
github-actions[bot]
a8163605f6 chore: Release railwayapp version 4.27.4 2026-01-28 02:57:40 +00:00
Brody Over
faf28d2fc7
Fix the scale command and move the 2FA error from bail into a single error (#777)
* fix scale and move the bail error to an actual error

* fmt
2026-01-27 21:51:41 -05:00
github-actions[bot]
af8f0a8630 chore: Release railwayapp version 4.27.3 2026-01-27 06:24:20 +00:00
Jake Runzer
ce30aa0aec
Environment config improvements (#771)
* Add `environment config` subcommand

Shows environment configuration with service/volume/variable summary.
Supports --json for machine-readable output and -e to specify environment.

* fmt

* Show service names instead of IDs in human output

* Improve service display with multi-line format

* Show more service config: root, builder, regions, domains

* Remove duplicate environment display

* Remove unused environment_name

* Allow null variables for deletion

Change BTreeMap<String, Variable> to BTreeMap<String, Option<Variable>>
for shared_variables and variables fields, matching existing pattern
for domains/tcp_proxies.
2026-01-27 01:18:47 -05:00
github-actions[bot]
d71699deb0 chore: Release railwayapp version 4.27.2 2026-01-26 04:24:14 +00:00
github-actions[bot]
82a187fb31 chore: Release railwayapp version 4.27.1 2026-01-26 04:17:39 +00:00
Jake Cooper
c5ca444960
Add --2fa-code flag for non-interactive 2FA verification (#773)
* Add --2fa-code flag for non-interactive 2FA verification

When 2FA is enabled, destructive operations (project delete, environment
delete, volume delete) now support a --2fa-code flag to provide the
verification code non-interactively.

Commands updated:
- `railway delete --2fa-code <CODE>`
- `railway environment delete --2fa-code <CODE>`
- `railway volume delete --2fa-code <CODE>`

This enables fully automated workflows even when 2FA is enabled on the account.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix rustfmt formatting

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:15:13 -08:00
Jake Cooper
5be00e09dd
Improve error messages when running commands non-interactively (#772)
* Improve error messages when running commands non-interactively

When running CLI commands without a TTY (e.g., from scripts or AI assistants),
commands that require interactive prompts now fail with helpful error messages
that explain which flags to use instead.

Changes:
- `railway service`: Now tells users to run `railway service <name>`
- `railway link`: Now tells users which flags (--workspace, --project,
  --environment) are required when multiple options exist
- `railway add`: Now lists all available flags (--database, --service,
  --repo, --image) instead of failing cryptically
- `railway connect`: Improved error message with usage example

This makes the CLI much more usable for automation and AI-assisted workflows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix rustfmt formatting

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:12:11 -08:00
github-actions[bot]
d18b2bce11 chore: Release railwayapp version 4.27.0 2026-01-23 18:32:29 +00:00
Jake Runzer
8cf2aece01
Add environment config subcommand (#770)
* Add `environment config` subcommand

Shows environment configuration with service/volume/variable summary.
Supports --json for machine-readable output and -e to specify environment.

* fmt

* Show service names instead of IDs in human output

* Improve service display with multi-line format

* Show more service config: root, builder, regions, domains

* Remove duplicate environment display

* Remove unused environment_name
2026-01-23 13:24:44 -05:00
Jake Runzer
c0cfd5e252
Fix auto-release to checkout master instead of PR ref (#769) 2026-01-19 19:32:51 -05:00
github-actions[bot]
a5b50ff82b chore: Release railwayapp version 4.26.0 2026-01-19 22:29:03 +00:00
Milo
59a65311b7
Allow changing service config in railway environment new (#702)
* it works

* remove useless comment

* fix conflicts, make it work again

* update schema

* cli side work is becoming a lot closer

* organise environment command

* more cleanup

* todos

* filter out old regions from scale non-interactively

* add non-interactive options for everything

* make trait variable handling more consistent for things that require custom value parsers

* begin work on porting to other way non-interactively

* it works

* add all interactive options and fix issue with --service flag in scale command

* add build command and start command and fix some parsing errors in non-interactive

* add placeholders for env being duplicated

* add edit command

* simplify and ux

* address comments

* remove interactive auto update
2026-01-19 17:25:17 -05:00
github-actions[bot]
663ad05451 chore: Release railwayapp version 4.25.3 2026-01-18 16:43:44 +00:00
Brody Over
3907ed0d58
Add better unauthenticated error messages (#768)
* add better error messages for unauth
2026-01-18 11:37:49 -05:00
github-actions[bot]
7a812e5249 chore: Release railwayapp version 4.25.2 2026-01-16 16:18:26 +00:00
Brody Over
346c80d4fe
update readme (#767) 2026-01-16 10:21:39 -05:00
Jake Runzer
724ccf15c8
feat: Add mouse-based text selection in TUI logs (#765)
* feat: Add mouse-based text selection in TUI logs

Implement custom text selection with mouse drag support in the `railway dev` TUI:
- Click and drag to select log text with visual highlighting
- Auto-copy selected text to clipboard on mouse release
- Auto-follow when scrolling back to bottom while paused
- Prevent screen flicker when scrolling down in follow mode
- Restore log buffering for better selection and scroll support

* fix: address code review issues in TUI text selection

- Consolidate LogRef enum to log_store.rs (was duplicated)
- Add clipboard failure feedback to user
- Fix prefix color logic when selection spans across prefix
- Make convert_color private
- Add comment explaining .take(2) limit in info pane

* refactor: optimize TUI log rendering and simplify selection

- Add LogRef::parts() to reduce duplication in log extraction
- Only collect visible logs instead of all logs (skip/take)
- Simplify selection rendering with explicit span regions
- Fix magic number defaults for log area bounds
- Remove unused Selection::contains method
2026-01-15 12:32:00 -05:00
github-actions[bot]
63b8b0374a chore: Release railwayapp version 4.25.1 2026-01-14 21:55:03 +00:00
Jake Runzer
1ee2e669a2
fix: dev --no-tui now stops services on quit like tui mode (#764)
Absorb additional Ctrl+C presses during shutdown to prevent abrupt termination
before child processes can be properly stopped. Add spinners to show shutdown
progress for both code and image services.
2026-01-14 16:49:42 -05:00
github-actions[bot]
911294f33d chore: Release railwayapp version 4.25.0 2026-01-14 20:16:08 +00:00
Jake Runzer
c54342ae84
feat: wait for workflow completion when adding templates/databases (#763)
* feat: wait for workflow completion when adding templates/databases

- Poll workflowStatus after TemplateDeploy to wait for completion
- Auto-link service when adding a single database
- Show workflow errors with context instead of failing silently
- Improve JSON output to include serviceId/serviceName

* refactor: cleanup workflow waiting code

- remove unnecessary clone in wait_for_workflow
- improve timeout error message
- remove unused detach flag

* refactor: make wait_for_workflow generic with WorkflowError enum

Callers now map WorkflowError variants to their own messages

* fmt
2026-01-14 15:12:13 -05:00
github-actions[bot]
a5354048d9 chore: Release railwayapp version 4.24.0 2026-01-14 18:37:02 +00:00
Jake Runzer
7983dabbb5
feat: restructure CLI to object-action pattern (#761)
* feat: restructure CLI to object-action pattern

- Add service subcommands: logs, restart, scale (delegates to existing commands)
- Add project object with list, link, delete subcommands
- Add environment link subcommand
- Restructure variable command with list, set, delete subcommands
- Add VariableDelete GraphQL mutation
- All existing commands continue to work via aliases for backwards compat

* test: add CLI parsing tests for backwards compat and new commands

* refactor: DRY up variable.rs, fix scale arg detection, fix env output order

- Add ServiceContext helper to dedupe project/env/service resolution
- delete_variable now requires service (consistent w/ list/set)
- scale.rs: position-based arg check prevents false triggers
- environment link: output after successful write()

* fix: remove dead code, add service redeploy, fix variable stdin

- service.rs: remove dead code in link_command (duplicate args.service check)
- service.rs: add redeploy subcommand routing
- variable.rs: accept string for set cmd to support --stdin with key-only
- main.rs: add more CLI parsing tests

* fix: service link case-insensitive, multi-var set, spinner cleanup

- service link: restore case-insensitive name/id matching
- variable set: support multiple KEY=val args
- use create_spinner_if helper for json mode
- add tests for multi-var set

* refactor: simplify service link flow

* fix: resolve clippy too_many_arguments warnings

Introduce FetchLogsParams struct to reduce argument count
2026-01-14 13:31:04 -05:00
Jake Runzer
ac1c6d14c8
fix: remove duplicate crates.io publish from create-release workflow (#762) 2026-01-13 17:58:25 -05:00
github-actions[bot]
012bd72f5c chore: Release railwayapp version 4.23.3 2026-01-13 22:37:34 +00:00
Jake Runzer
e3d7772158
feat: add --json flag and non-interactive mode support to commands (#760)
* feat: add --json flag and non-interactive mode support to commands

- Add --json flag to: add, init, delete, environment, redeploy, restart, scale, unlink, up, volume
- Add --yes flag to volume attach/detach/delete for confirmation bypass
- Add terminal checks for interactive prompts in connect and volume commands
- Add 2FA bail in non-interactive mode for delete, environment delete, volume delete
- Suppress spinners/progress bars in JSON mode
- up --json outputs JSON logs like logs --json and implies CI mode behavior

* refactor: extract spinner helper, fix --json/--yes semantics

- Add create_spinner_if helper to reduce duplicated spinner code
- Add TWO_FACTOR_REQUIRES_INTERACTIVE constant for consistent 2FA errors
- Fix --json no longer implying --yes in unlink/volume commands
- Add JSON output for template deploy
- Add volume ID to volume create JSON output
- Remove unwrap in restart.rs by restructuring flow
- Pass region_data by reference in scale.rs to avoid clone

* fix: add terminal checks before confirmation prompts

Add is_terminal checks to redeploy, restart, and environment delete
commands to bail with helpful error in non-interactive mode without --yes

* fix(add): remove redundant db json output, fix typo
2026-01-13 17:33:43 -05:00
github-actions[bot]
1f1a130051 chore: Release railwayapp version 4.23.2 2026-01-13 03:53:16 +00:00
Naman Kumar
a2e106b5bc
feat: Handle 2FA enforcement error gracefully (#759)
When a workspace has 2FA enforcement enabled and the user hasn't set up
2FA, display a user-friendly error message with the workspace name and
a direct link to the account security page.
2026-01-13 09:17:12 +05:30
github-actions[bot]
2925ccc490 chore: Release railwayapp version 4.23.1 2026-01-12 20:53:23 +00:00
Jake Runzer
63fd52107e
fix: Reorder TUI tabs to show code services before Image aggregate (#758)
When there's a single code service and multiple image services, tabs now display as:
code | Image | img1 | img2 (instead of Images | code | img1 | img2)

The tab order is now: Local (if shown) → code services → Image (if shown) → image services
2026-01-12 15:47:50 -05:00
ari
4c6c7b9b92
Update documentation link in README.md (#757) 2026-01-10 17:56:55 -05:00
github-actions[bot]
f9db690c6d chore: Release railwayapp version 4.23.0 2026-01-08 22:02:09 +00:00
Jake Runzer
0776449329
refactor: remove --restart flag from redeploy command (#756)
The restart functionality is now available via the standalone `railway restart` command.
2026-01-08 16:56:35 -05:00
github-actions[bot]
170cebc5e2 chore: Release railwayapp version 4.22.0 2026-01-08 21:42:59 +00:00