Skip to content

feat(cli): add ao session ls/get/kill/restore (#90) - #92

Merged
harshitsinghbhandari merged 3 commits into
mainfrom
feat/issue-90-session-cli
Jun 2, 2026
Merged

harshitsinghbhandari merged 3 commits into
mainfrom
feat/issue-90-session-cli

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator

Closes #90

Summary

  • Add the new ao session parent command with ls, get, kill, and restore subcommands.
  • Add -p, --project <id> to every session subcommand; ls sends it as the list filter and get/kill/restore use it to scope the session before mutating.
  • Port useful original CLI list flags: --all, --include-terminated, and --json, including default hiding of orchestrators and terminated sessions.
  • Add CLI tests covering happy paths, missing ID usage errors, and project scoping/filtering.

Intentionally skipped from original CLI

Validation

  • cd backend && go build ./...
  • cd backend && PATH=/usr/bin:/bin:/usr/sbin:/sbin /opt/homebrew/bin/go test -race ./...
  • cd backend && go vet ./...

Per user instruction, I did not run npx @redwoodjs/agent-ci run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new ao session command group to the Go CLI, providing wrappers around existing daemon session endpoints to list, inspect, and control sessions from the terminal.

Changes:

  • Introduces ao session ls/get/kill/restore with consistent -p/--project scoping support.
  • Adds session listing filters (--all, --include-terminated) and JSON output for ls/get.
  • Extends the CLI HTTP client helper to support both GET and POST JSON calls, and adds tests for core session command flows.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
backend/internal/cli/session.go Implements the session command and its ls/get/kill/restore subcommands, output formatting, filtering, and project scoping.
backend/internal/cli/session_test.go Adds unit tests for session command behavior (filtering, scoping, and basic happy paths).
backend/internal/cli/root.go Wires the new session command into the CLI root.
backend/internal/cli/client.go Refactors daemon call helper to support both GET and POST JSON requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/internal/cli/session.go
Comment thread backend/internal/cli/session.go
Comment thread backend/internal/cli/session.go Outdated
@harshitsinghbhandari
harshitsinghbhandari force-pushed the feat/issue-90-session-cli branch from 67218d9 to 2e524b3 Compare June 2, 2026 23:18
@harshitsinghbhandari
harshitsinghbhandari merged commit 010b422 into main Jun 2, 2026
7 checks passed
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.

Port missing CLI commands from original AO (read + lifecycle surface)

2 participants