Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ const Root = Spec.make(typeof OPENCODE_CLI_NAME === "string" ? OPENCODE_CLI_NAME
Flag.withDescription("Limit to N most recent sessions (default: 100)"),
Flag.optional,
),
search: Flag.String("search").pipe(Flag.withDescription("Filter sessions by title"), Flag.optional),
format: Flag.Literals("format", ["table", "json"]).pipe(
Flag.withDescription("Output format"),
Flag.withDefault("table"),
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/handlers/session/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const handler = Effect.fn("cli.session.list")(function* (
{
project: location.project.id,
parentID: null,
search: Option.getOrUndefined(input.search),
order: "desc",
limit: Option.getOrElse(input.maxCount, () => 100),
},
Expand Down
6 changes: 6 additions & 0 deletions services/www/src/docs/content/cli/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Limit the list and print JSON.
$ opencode session list --max-count 20 --format json
```

Filter top-level sessions in the current project by title, newest first. Combine `--search` with `--max-count` to limit matching results.

```bash
$ opencode session list --search "deployment" --max-count 20 --format json
```

Delete a session and its child sessions.

```bash
Expand Down
Loading