cli/src/commands
Cody De Arkland 49941e3841
feat(agent): markdown rendering, spacing fixes, and API endpoint update (#849)
* fix: remove extra blank lines in `railway agent` REPL output

The thinking spinner and the Chunk/ToolCallReady handlers were each
unconditionally emitting a `println!()`, stacking multiple blank lines
between user input and the agent's response. Drop the unconditional
newline before the initial spinner, and only emit a leading newline in
the Chunk/ToolCallReady handlers when a spinner wasn't just cleared
(since `finish_and_clear` already leaves the cursor on a blank line).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(agent): markdown rendering, spacing fixes, and API endpoint update

- Stream raw text during agent responses, then re-render each block with
  termimad on ToolCallReady / WorkflowCompleted for GitHub-style markdown
- Track block start position via crossterm cursor::position so the re-render
  only erases the current block, not prior tool output
- Render a "✓ Done" / "✗ Tool failed" badge after each tool call so the
  indicator stays visible once the spinner finishes
- Insert a blank line between consecutive agent responses within a turn;
  keep the tool spinner directly attached to the preceding text
- Update chat endpoint from /api/v1/chat to /api/v1/agent
- Refactor: bundle streaming state into HumanRenderer, extract
  stream_human / stream_json / tool_badge helpers to drop ~60 lines of
  duplication between run_single_shot and run_repl

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* style: wrap tool-status label across lines for rustfmt

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 09:09:41 -07:00
..
environment feat: add environment list subcommand (#828) 2026-03-31 23:18:08 +02:00
functions fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
mcp Fixing issue #830 (#837) 2026-04-15 21:40:07 -04:00
ssh fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
add.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
agent.rs feat(agent): markdown rendering, spacing fixes, and API endpoint update (#849) 2026-04-17 09:09:41 -07:00
autoupdate.rs feat: add auto-update mechanism for CLI (#825) 2026-04-06 10:21:50 +09:00
bucket.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
check_updates.rs fix: update check no longer relies on config (#654) 2025-08-04 21:39:39 -04:00
completion.rs improve error message for invalid token (#698) 2025-11-20 14:39:04 -08:00
connect.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
delete.rs feat(delete): use projectScheduleDelete mutation for soft deletion (#827) 2026-03-30 23:53:31 -04:00
deploy.rs Fixing issue #830 (#837) 2026-04-15 21:40:07 -04:00
deployment.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
dev.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
docs.rs fix: make railway docs work in non-interactive mode (#843) 2026-04-15 09:14:33 +09:00
domain.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
down.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
init.rs feat: add --json flag and non-interactive mode support to commands (#760) 2026-01-13 17:33:43 -05:00
link.rs Improve error messages when running commands non-interactively (#772) 2026-01-25 20:12:11 -08:00
list.rs Add workspace info to list --json output (#721) 2026-01-07 12:07:36 -05:00
login.rs feat(auth): replace custom login flow with OAuth 2.0 (PKCE + device flow) (#822) 2026-03-25 20:38:18 +02:00
logout.rs remove global json flag (#631) 2025-05-14 22:44:37 +04:00
logs.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
mod.rs feat: add railway skills command for installing agent skills (#847) 2026-04-17 16:34:55 +09:00
open.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
project.rs feat: restructure CLI to object-action pattern (#761) 2026-01-14 13:31:04 -05:00
redeploy.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
restart.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
run.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
scale.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
service.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
shell.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
skills.rs feat: add railway skills command for installing agent skills (#847) 2026-04-17 16:34:55 +09:00
starship.rs remove global json flag (#631) 2025-05-14 22:44:37 +04:00
status.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
telemetry_cmd.rs feat: add auto-update mechanism for CLI (#825) 2026-04-06 10:21:50 +09:00
unlink.rs feat: add --json flag and non-interactive mode support to commands (#760) 2026-01-13 17:33:43 -05:00
up.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
upgrade.rs feat: add auto-update mechanism for CLI (#825) 2026-04-06 10:21:50 +09:00
variable.rs feat: restructure CLI to object-action pattern (#761) 2026-01-14 13:31:04 -05:00
volume.rs fix(config): make RAILWAY_ENVIRONMENT_ID optional for project-level commands (#826) 2026-03-30 11:05:18 +02:00
whoami.rs Fix CLI commands for non-interactive mode (#717) 2026-01-06 21:38:24 -05:00