Skip to content

Add trajectory recording to cua do CLI - #1110

Merged
ddupont808 merged 2 commits into
trycua:ddupont/cua-cli-improvementsfrom
sarinali:ddupont/cua-cli-improvements
Feb 25, 2026
Merged

Add trajectory recording to cua do CLI#1110
ddupont808 merged 2 commits into
trycua:ddupont/cua-cli-improvementsfrom
sarinali:ddupont/cua-cli-improvements

Conversation

@sarinali

Copy link
Copy Markdown
Contributor

Summary

  • Every cua do action is now automatically recorded to ~/.cua/trajectories/{machine}/{session}/ in a format compatible with the TrajectoryViewer at cua.ai/trajectory-viewer
  • cua trajectory view zips the session, starts a background CORS-enabled file server, and opens cua.ai/trajectory-viewer?zip=localhost:PORT/file.zip in the browser
  • Recording is on by default; opt out with cua do --no-record

New files

  • cua_cli/utils/trajectory_recorder.py — session management, turn writing, zip, clean
  • cua_cli/commands/trajectory.pycua trajectory ls/view/stop/clean commands

Modified files

  • cua_cli/commands/do.py--no-record flag, post-action screenshot recording in all 11 handlers, session reset on switch
  • cua_cli/main.py, cua_cli/commands/__init__.py — register trajectory command
  • skills/cua-do-cli/SKILL.md — document trajectory recording

Test plan

  • Run cua do switch docker test && cua do screenshot && cua do click 100 200, verify ~/.cua/trajectories/test/ has turn_001/ and turn_002/ with JSON + screenshots
  • Run cua do --no-record click 100 200, verify no new turn
  • Run cua do switch docker other, verify new session directory
  • Run cua trajectory ls, verify output
  • Run cua trajectory view, verify zip served and browser opens cua.ai/trajectory-viewer
  • Run cua trajectory stop, verify server killed
  • Run cua trajectory clean -y, verify sessions deleted

🤖 Generated with Claude Code

Every cua do action is now automatically recorded to a replayable
trajectory at ~/.cua/trajectories/{machine}/{session}/. Viewing opens
cua.ai/trajectory-viewer via a local CORS-enabled file server.

New files:
- trajectory_recorder.py: session management, turn writing, zip, clean
- trajectory.py: cua trajectory ls/view/stop/clean commands

Modified:
- do.py: --no-record flag, post-action screenshot recording in all handlers,
  session reset on switch
- main.py, __init__.py: register trajectory command
- SKILL.md: document trajectory recording

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

vercel Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

@sarinali is attempting to deploy a commit to the Cua Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • rabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sentry

sentry Bot commented Feb 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ddupont808
ddupont808 merged commit cb7852b into trycua:ddupont/cua-cli-improvements Feb 25, 2026
21 of 23 checks passed
ddupont808 added a commit that referenced this pull request Feb 25, 2026
* add agent-computer style usage to cua-cli, refactor pyautogui-like handlers from computer-server into its own SDK for reuse by our various SDKs

* address CR comments, add auto-focus when zooming to windows on the host

* Add cua-auto to pypi workflow

* Bump cua-cli requirements

* default `cua do ls` to listing all sandboxes

* Fix linting error

* fix linting

* Add trajectory recording to cua do CLI (#1110)

Every cua do action is now automatically recorded to a replayable
trajectory at ~/.cua/trajectories/{machine}/{session}/. Viewing opens
cua.ai/trajectory-viewer via a local CORS-enabled file server.

New files:
- trajectory_recorder.py: session management, turn writing, zip, clean
- trajectory.py: cua trajectory ls/view/stop/clean commands

Modified:
- do.py: --no-record flag, post-action screenshot recording in all handlers,
  session reset on switch
- main.py, __init__.py: register trajectory command
- SKILL.md: document trajectory recording

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: ddupont <3820588+ddupont808@users.noreply.github.com>

---------

Co-authored-by: Sarina Li <sarinajin.li@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
ddupont808 added a commit that referenced this pull request Feb 25, 2026
…mputer-server, computer, and the cua CLI (#1114)

* add agent-computer style usage to cua-cli, refactor pyautogui-like handlers from computer-server into its own SDK for reuse by our various SDKs

* address CR comments, add auto-focus when zooming to windows on the host

* Add cua-auto to pypi workflow

* Bump cua-cli requirements

* default `cua do ls` to listing all sandboxes

* Fix linting error

* fix linting

* Add trajectory recording to cua do CLI (#1110)

Every cua do action is now automatically recorded to a replayable
trajectory at ~/.cua/trajectories/{machine}/{session}/. Viewing opens
cua.ai/trajectory-viewer via a local CORS-enabled file server.

New files:
- trajectory_recorder.py: session management, turn writing, zip, clean
- trajectory.py: cua trajectory ls/view/stop/clean commands

Modified:
- do.py: --no-record flag, post-action screenshot recording in all handlers,
  session reset on switch
- main.py, __init__.py: register trajectory command
- SKILL.md: document trajectory recording

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: ddupont <3820588+ddupont808@users.noreply.github.com>

* add interactive terminal support

* add try/except around imports that require X display server

* address CR comments

* lint & isort

* bump cua-core dep

* add tests for windows

* fix cua do shell unknown command error

* reorder imports

* add interactive shell to docs

* update computer sdk reference

* lint windows tests

* fix external link checking lychee workflow checking internal links

* attempt to fix lychee workflow again

* fix external links

---------

Co-authored-by: Sarina Li <sarinajin.li@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants