Skip to content

feat(web): deep-link CLI flags for project, session, and latest #17

@lroolle

Description

@lroolle

Problem

ccx web always opens http://localhost:8080/ — the index page. When you already know what you want to look at, you have to click through the UI to get there. Common cases:

  1. Open a specific project: you're in a project directory and want its session list
  2. Open a specific session: you have a session ID (from ccx sessions output or --continue picker)
  3. Open the latest session: the most common "check what just happened" flow

Proposal

New flags on ccx web

# Open browser directly to the current workspace's project page
ccx web --project
# or explicit path
ccx web --project /path/to/repo

# Open browser directly to a specific session
ccx web --session <uuid-or-short-id>

# Open browser to the most recent session (current workspace)
ccx web --latest

Behavior

  • If web server is already running on the expected port: just open the browser to the deep-link URL, don't start a second server. Detect via a quick http://localhost:{port}/api/stats health check.
  • If not running: start the server, then open to the deep-link URL.

URL mapping

Flag URL
--project (inferred) /project/{workspace-slug}
--project /path /project/{slug-for-path}
--session abc123 /session/{project-slug}/{full-uuid} (resolve short ID to full)
--latest /session/{project-slug}/{latest-session-id}
(no flag, default) / (current behavior)

Short ID resolution

ccx sessions already shows truncated UUIDs. The --session flag should accept either:

  • Full UUID: a1c0e89d-a680-4cac-9b0d-76da733b1020
  • Short prefix: a1c0e89d (resolve by prefix match within workspace, error on ambiguity)

Implementation sketch

  1. Add --project, --session, --latest flags to web.go
  2. Add a resolveDeepLink() helper that computes the target URL path
  3. Before starting the server, probe http://{host}:{port}/api/stats — if it responds, skip web.Serve() and just openBrowser(url + path)
  4. Short ID resolution: scan session filenames in the project dir for prefix match

Naming note

Considered --continue (mirrors claude --continue) but that's a Go keyword and could confuse. --latest is clearer — it means "most recent session in this workspace."

Non-goals

  • No --all mode (opening all projects) — the index page handles that
  • No attaching to a remote ccx server — localhost only for now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions