simulate: list, view and export subcommands - #968
Open
u9g wants to merge 3 commits into
Open
Conversation
--view ID and --export ID each replaced the whole run action from inside a flag, and audio inherited both. A flag that takes an ID and swaps the action is a subcommand, so they become `lk agent simulate view <run-id>` and `lk agent simulate export <run-id>`, matching the noun/verb shape of the rest of lk. The exit hints print the new forms.
`lk agent simulate list` prints the API's first page (newest first) with ID, created time, status, mode and agent name, or the raw response with --json, so a run ID can be found without the dashboard.
u9g
force-pushed
the
jason/simulate-subcommands
branch
from
September 8, 2026 18:13
6b361bf to
88f2a00
Compare
theomonnom
approved these changes
Sep 10, 2026
`lk agent simulate list` fetched only the API's first page (20 runs). --limit walks next_page_token until that many runs are collected, the same loop as `lk egress list`; unset keeps the single-page default. --json now prints the collected runs wrapped in the List response so the field formatting is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested in Slack:
lk agent simulate --viewcan reopen a past run, but there was no way to list runs to find an ID.Rather than add
--listnext to--viewand--export, this makes the run operations subcommands. Each of those flags took an ID and replaced the whole run action, andaudioinherited them, solk agent simulate audio --view IDparsed and did something meaningless. A flag that swaps the action is a subcommand; this matches the noun/verb shape of the rest oflk(lk agent list,lk room list,lk egress list) and thegit stash/git stash list/git stash showprecedent of a verb whose bare form does the main thing.Commit 1 turns
--view/--exportintoview/exportwith a positional run ID and updates the exit hints to print the new forms. The old flags are removed, not aliased: the hint is reprinted after every run, so only stale scrollback breaks.Commit 2 adds
list: oneListSimulationRunscall for the project's first page (server returns newest first, 20 per page, no jobs), rendered likelk agent listwith--jsonfor the raw response.Commit 3 adds
--limittolist, the samenext_page_tokenloop aslk egress list: unset keeps the single-page default,--limit Nwalks pages until N runs are collected.--jsonprints the collected runs inside the List response so the field formatting is unchanged. No filters yet.The run flags on
simulatestay persistent, solist/view/exportstill parse--scenariosetc. and ignore them. Making them local would breaklk agent simulate --scenarios f audio: urfave/cli v3 resolves a flag by the first command in the lineage that declares it and re-runsPreParseon the child's flags, so a shared or duplicated flag loses the value parsed on the parent.Tested against my dev project:
list,list --limit 3,list --json,view <id>(CI and TUI paths),export <id>. Paging tested against a staging project with 184 runs:--limit 45returned 45 unique runs across three pages, newest first with no seam;--limit 1000drained all 184.