Implement file-related session subcommands in v2 CLI (download, upload, ls)
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
### Background
The v2 CLI `session` command group exposes enqueue/get/terminate/service/logs/update, but has no file-transfer subcommands. The v2 SDK client (client/v2/domains/session.py) already provides download_files, download_single, upload_files, and list_files, yet no v2 CLI command calls them. Users must fall back to the legacy v1 CLI for session file operations.
### Goal
Add file-related subcommands to the v2 CLI `session` group that call the existing v2 SDK file methods, following the established v2 CLI command and output-handler patterns.
### Scope
- `download` -> session.download_files (multipart tar response extracted to a destination directory)
- `download-single` -> session.download_single (single raw file)
- `upload` -> session.upload_files (multipart form upload from a base directory)
- `ls` (list-files) -> session.list_files (typed ListFilesResponse rendered via an output handler)
### Out of scope
- `scp` / `ssh`: client-side conveniences built on the app proxy plus SSH key download, not pure file-API operations.
- Native REST v2 file endpoints: these operations currently ride the legacy /session/ REST endpoints; promoting them to /v2/sessions/ is a separate effort.
### Acceptance criteria
- Each new subcommand works end-to-end against a live session, verified via the ./bai v2 CLI.
- Output handlers follow existing v2 CLI conventions; no new manager or SDK API is required.
JIRA Issue: BA-6680
Contributor guide
Research direction
Start with client/v2/domains/session.py to confirm the existing file methods and their inputs and outputs. Then inspect the established v2 CLI session commands and output-handler patterns before wiring download, download-single, upload, and ls. Run ./bai v2 against a live session; done means all four commands work end-to-end, including extraction and typed ls output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100