GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(cli): add session delete command (#13571) · schjonhaug/opencode@b0afdf6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode/agent
    • translator.md
  • packages/opencode/src/cli/cmd
    • session.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/agent/translator.md‎

Copy file name to clipboardExpand all lines: .opencode/agent/translator.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ opencode serve --hostname 0.0.0.0 --port 4096
359359
opencode serve [--port <number>] [--hostname <string>] [--cors <origin>]
360360
opencode session [command]
361361
opencode session list
362+
opencode session delete <sessionID>
362363
opencode stats
363364
opencode uninstall
364365
opencode upgrade
Collapse file

‎packages/opencode/src/cli/cmd/session.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/session.ts
+25-1Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,34 @@ function pagerCmd(): string[] {
3838
export const SessionCommand = cmd({
3939
command: "session",
4040
describe: "manage sessions",
41-
builder: (yargs: Argv) => yargs.command(SessionListCommand).demandCommand(),
41+
builder: (yargs: Argv) => yargs.command(SessionListCommand).command(SessionDeleteCommand).demandCommand(),
4242
async handler() {},
4343
})
4444

45+
export const SessionDeleteCommand = cmd({
46+
command: "delete <sessionID>",
47+
describe: "delete a session",
48+
builder: (yargs: Argv) => {
49+
return yargs.positional("sessionID", {
50+
describe: "session ID to delete",
51+
type: "string",
52+
demandOption: true,
53+
})
54+
},
55+
handler: async (args) => {
56+
await bootstrap(process.cwd(), async () => {
57+
try {
58+
await Session.get(args.sessionID)
59+
} catch {
60+
UI.error(`Session not found: ${args.sessionID}`)
61+
process.exit(1)
62+
}
63+
await Session.remove(args.sessionID)
64+
UI.println(UI.Style.TEXT_SUCCESS_BOLD + `Session ${args.sessionID} deleted` + UI.Style.TEXT_NORMAL)
65+
})
66+
},
67+
})
68+
4569
export const SessionListCommand = cmd({
4670
command: "list",
4771
describe: "list sessions",

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.