Build with coding agents
rails-agents CLI
The gem ships an executable for the agent lifecycle. Build locally, push with sync, smoke-test with run, then deploy. Requires RAILS_AGENTS_API_KEY and RAILS_AGENTS_PROJECT_ID from workspace connect.
sync
Push every file under app/agents/<name>/ (plus resolved Library imports from imports.yml) to Rails Agent Cloud. Prefer sync over any deprecated cloud-pull authoring flow.
$ bundle exec rails-agents sync store_assistant # Synced N files for store_assistant # (includes app/agents_library attachments when imports.yml is present)
Sync fails fast on Library path traversal, missing sources, or conflicts with agent-local files — so the Library stays canonical without duplicating shared source in Git.
run
Execute the agent against the cloud runtime and print output_text. Pass --session for conversation memory continuity.
$ bundle exec rails-agents run store_assistant \
"Where is order ORD-DEMO-1001?"
$ bundle exec rails-agents run store_assistant \
"Remind me what we discussed" --session user-42run is mapped to the underlying execute Thor task. Integrate the same result shape in product code via run response schema.
deploy
Deploy the agent bundle for production (or named) traffic. Omit the name to deploy every discovered agent under app/agents/.
$ bundle exec rails-agents deploy store_assistant $ bundle exec rails-agents deploy # all agents
Typical loop: edit → sync → run (or dashboard Test) → evals → deploy.
logs
Fetch recent run logs from the cloud as JSON. Optional agent filter and limit.
$ bundle exec rails-agents logs store_assistant $ bundle exec rails-agents logs store_assistant --limit 20 $ bundle exec rails-agents logs # workspace-wide
Related: bundle exec rails-agents traces [NAME] for tool-level traces. The Monitor UI in /agents remains the primary day-to-day surface.
evals
Fetch eval results recorded for an agent (or the workspace). Define cases locally under evals/*.yml, sync them, and run from deploy / dashboard when you want a regression gate.
$ bundle exec rails-agents evals store_assistant $ bundle exec rails-agents evals
Also useful
| Command | Purpose |
|---|---|
| login | Handshake to Cloud; print export lines for API key / project |
| packages QUERY | Search Skills.sh / APM / Smithery |
| add-package ID -a AGENT --registry … | Install a package onto an agent + Library |
| traces [NAME] | Recent traces JSON |
| pull … | Deprecated — scaffold locally and sync instead |
Next
Coding agents guide
How Cursor / Codex / Claude Code should split repo work vs dashboard OAuth, memory, budgets, and guardrails.
Coding agents →