api
Index
- func Extract[T any, R any](res R, err error) (T, error)
- func GetRoutes(c *client.Client) []string
- type API
- func NewAPI(config ClientCfg) (*API, error)
- func (a *API) AppAgents(ctx context.Context, params client.AppAgentsParams, options ...client.RequestOption) ([]client.Agent, error)
- func (a *API) AppSkills(ctx context.Context, params client.AppSkillsParams, options ...client.RequestOption) ([]client.AppSkillsOKItem, error)
- func (a *API) CommandList(ctx context.Context, params client.CommandListParams, options ...client.RequestOption) ([]client.Command, error)
- func (a *API) ConfigProviders(ctx context.Context, params client.ConfigProvidersParams, options ...client.RequestOption) (*client.ConfigProvidersOK, error)
- func (a *API) ExperimentalCapabilitiesGet(ctx context.Context, params client.ExperimentalCapabilitiesGetParams, options ...client.RequestOption) (*client.ExperimentalCapabilities, error)
- func (a *API) ExperimentalConsoleGet(ctx context.Context, params client.ExperimentalConsoleGetParams, options ...client.RequestOption) (*client.ConsoleState, error)
- func (a *API) ExperimentalConsoleListOrgs(ctx context.Context, params client.ExperimentalConsoleListOrgsParams, options ...client.RequestOption) (*client.ExperimentalConsoleListOrgsOK, error)
- func (a *API) ExperimentalConsoleSwitchOrg(ctx context.Context, request client.OptExperimentalConsoleSwitchOrgReq, params client.ExperimentalConsoleSwitchOrgParams, options ...client.RequestOption) (bool, error)
- func (a *API) ExperimentalProjectCopyGenerateName(ctx context.Context, request client.OptExperimentalProjectCopyGenerateNameReq, params client.ExperimentalProjectCopyGenerateNameParams, options ...client.RequestOption) (*client.ExperimentalProjectCopyGenerateNameOK, error)
- func (a *API) ExperimentalResourceList(ctx context.Context, params client.ExperimentalResourceListParams, options ...client.RequestOption) (*client.ExperimentalResourceListOK, error)
- func (a *API) ExperimentalSessionList(ctx context.Context, params client.ExperimentalSessionListParams, options ...client.RequestOption) ([]client.GlobalSession, error)
- func (a *API) ExperimentalWorkspaceAdapterList(ctx context.Context, params client.ExperimentalWorkspaceAdapterListParams, options ...client.RequestOption) ([]client.ExperimentalWorkspaceAdapterListOKItem, error)
- func (a *API) ExperimentalWorkspaceStatus(ctx context.Context, params client.ExperimentalWorkspaceStatusParams, options ...client.RequestOption) ([]client.WorkspaceEventConnectionStatus, error)
- func (a *API) ExperimentalWorkspaceSyncList(ctx context.Context, params client.ExperimentalWorkspaceSyncListParams, options ...client.RequestOption) (client.ExperimentalWorkspaceSyncListRes, error)
- func (a *API) FileList(ctx context.Context, params client.FileListParams, options ...client.RequestOption) ([]client.FileNode, error)
- func (a *API) FileRead(ctx context.Context, params client.FileReadParams, options ...client.RequestOption) (*client.FileContent, error)
- func (a *API) FileStatus(ctx context.Context, params client.FileStatusParams, options ...client.RequestOption) ([]client.File, error)
- func (a *API) FindFiles(ctx context.Context, params client.FindFilesParams, options ...client.RequestOption) ([]string, error)
- func (a *API) FindSymbols(ctx context.Context, params client.FindSymbolsParams, options ...client.RequestOption) ([]client.Symbol, error)
- func (a *API) FindText(ctx context.Context, params client.FindTextParams, options ...client.RequestOption) ([]client.FindTextOKItem, error)
- func (a *API) FormatterStatus(ctx context.Context, params client.FormatterStatusParams, options ...client.RequestOption) ([]client.FormatterStatus, error)
- func (a *API) GlobalDispose(ctx context.Context, options ...client.RequestOption) (*client.GlobalDisposeOKApplicationJSON, error)
- func (a *API) GlobalHealth(ctx context.Context, options ...client.RequestOption) (*client.GlobalHealthOK, error)
- func (a *API) InstanceDispose(ctx context.Context, params client.InstanceDisposeParams, options ...client.RequestOption) (*client.InstanceDisposeOKApplicationJSON, error)
- func (a *API) LspStatus(ctx context.Context, params client.LspStatusParams, options ...client.RequestOption) ([]client.LSPStatus, error)
- func (a *API) McpAuthRemove(ctx context.Context, params client.McpAuthRemoveParams, options ...client.RequestOption) (*client.McpAuthRemoveOK, error)
- func (a *API) McpConnect(ctx context.Context, params client.McpConnectParams, options ...client.RequestOption) (*client.McpConnectOKApplicationJSON, error)
- func (a *API) McpDisconnect(ctx context.Context, params client.McpDisconnectParams, options ...client.RequestOption) (*client.McpDisconnectOKApplicationJSON, error)
- func (a *API) PathGet(ctx context.Context, params client.PathGetParams, options ...client.RequestOption) (*client.Path, error)
- func (a *API) PermissionList(ctx context.Context, params client.PermissionListParams, options ...client.RequestOption) ([]client.PermissionRequest, error)
- func (a *API) ProjectCurrent(ctx context.Context, params client.ProjectCurrentParams, options ...client.RequestOption) (*client.Project, error)
- func (a *API) ProjectDirectories(ctx context.Context, params client.ProjectDirectoriesParams, options ...client.RequestOption) ([]client.ProjectDirectoriesItem, error)
- func (a *API) ProjectInitGit(ctx context.Context, params client.ProjectInitGitParams, options ...client.RequestOption) (*client.Project, error)
- func (a *API) ProjectList(ctx context.Context, params client.ProjectListParams, options ...client.RequestOption) ([]client.Project, error)
- func (a *API) ProviderList(ctx context.Context, params client.ProviderListParams, options ...client.RequestOption) (*client.ProviderListOK, error)
- func (a *API) PtyConnect(ctx context.Context, params client.PtyConnectParams, options ...client.RequestOption) (*client.PtyConnectOKApplicationJSON, error)
- func (a *API) PtyConnectToken(ctx context.Context, params client.PtyConnectTokenParams, options ...client.RequestOption) (*client.PtyTicketConnectToken, error)
- func (a *API) PtyGet(ctx context.Context, params client.PtyGetParams, options ...client.RequestOption) (*client.Pty, error)
- func (a *API) PtyList(ctx context.Context, params client.PtyListParams, options ...client.RequestOption) ([]client.Pty, error)
- func (a *API) PtyRemove(ctx context.Context, params client.PtyRemoveParams, options ...client.RequestOption) (*client.PtyRemoveOKApplicationJSON, error)
- func (a *API) PtyShells(ctx context.Context, params client.PtyShellsParams, options ...client.RequestOption) ([]client.PtyShellsOKItem, error)
- func (a *API) QuestionList(ctx context.Context, params client.QuestionListParams, options ...client.RequestOption) ([]client.QuestionRequest, error)
- func (a *API) SessionDiff(ctx context.Context, params client.SessionDiffParams, options ...client.RequestOption) ([]client.SnapshotFileDiff, error)
- func (a *API) SessionList(ctx context.Context, params client.SessionListParams, options ...client.RequestOption) ([]client.Session, error)
- func (a *API) SessionShare(ctx context.Context, params client.SessionShareParams, options ...client.RequestOption) (*client.Session, error)
- func (a *API) SessionUnshare(ctx context.Context, params client.SessionUnshareParams, options ...client.RequestOption) (*client.Session, error)
- func (a *API) SyncStart(ctx context.Context, params client.SyncStartParams, options ...client.RequestOption) (*client.SyncStartOKApplicationJSON, error)
- func (a *API) TuiClearPrompt(ctx context.Context, params client.TuiClearPromptParams, options ...client.RequestOption) (*client.TuiClearPromptOKApplicationJSON, error)
- func (a *API) TuiControlNext(ctx context.Context, params client.TuiControlNextParams, options ...client.RequestOption) (*client.TuiControlNextOK, error)
- func (a *API) TuiControlResponse(ctx context.Context, request jx.Raw, params client.TuiControlResponseParams, options ...client.RequestOption) (*client.TuiControlResponseOKApplicationJSON, error)
- func (a *API) TuiOpenHelp(ctx context.Context, params client.TuiOpenHelpParams, options ...client.RequestOption) (*client.TuiOpenHelpOKApplicationJSON, error)
- func (a *API) TuiOpenModels(ctx context.Context, params client.TuiOpenModelsParams, options ...client.RequestOption) (*client.TuiOpenModelsOKApplicationJSON, error)
- func (a *API) TuiOpenSessions(ctx context.Context, params client.TuiOpenSessionsParams, options ...client.RequestOption) (*client.TuiOpenSessionsOKApplicationJSON, error)
- func (a *API) TuiOpenThemes(ctx context.Context, params client.TuiOpenThemesParams, options ...client.RequestOption) (*client.TuiOpenThemesOKApplicationJSON, error)
- func (a *API) TuiShowToast(ctx context.Context, request client.OptTuiShowToastReq, params client.TuiShowToastParams, options ...client.RequestOption) (*client.TuiShowToastOKApplicationJSON, error)
- func (a *API) TuiSubmitPrompt(ctx context.Context, params client.TuiSubmitPromptParams, options ...client.RequestOption) (*client.TuiSubmitPromptOKApplicationJSON, error)
- func (a *API) V2CommandList(ctx context.Context, params client.V2CommandListParams, options ...client.RequestOption) (*client.V2CommandListOK, error)
- func (a *API) V2CredentialRemove(ctx context.Context, params client.V2CredentialRemoveParams, options ...client.RequestOption) (client.V2CredentialRemoveRes, error)
- func (a *API) V2CredentialUpdate(ctx context.Context, request *client.V2CredentialUpdateReq, params client.V2CredentialUpdateParams, options ...client.RequestOption) (client.V2CredentialUpdateRes, error)
- func (a *API) V2FsFind(ctx context.Context, params client.V2FsFindParams, options ...client.RequestOption) (*client.V2FsFindOK, error)
- func (a *API) V2FsList(ctx context.Context, params client.V2FsListParams, options ...client.RequestOption) (*client.V2FsListOK, error)
- func (a *API) V2FsRead(ctx context.Context, params client.V2FsReadParams, options ...client.RequestOption) (client.V2FsReadRes, error)
- func (a *API) V2HealthGet(ctx context.Context, options ...client.RequestOption) (*client.V2HealthGetOK, error)
- func (a *API) V2IntegrationAttemptCancel(ctx context.Context, params client.V2IntegrationAttemptCancelParams, options ...client.RequestOption) (client.V2IntegrationAttemptCancelRes, error)
- func (a *API) V2LocationGet(ctx context.Context, params client.V2LocationGetParams, options ...client.RequestOption) (*client.LocationInfo, error)
- func (a *API) V2PermissionRequestList(ctx context.Context, params client.V2PermissionRequestListParams, options ...client.RequestOption) (*client.V2PermissionRequestListOK, error)
- func (a *API) V2PermissionSavedList(ctx context.Context, params client.V2PermissionSavedListParams, options ...client.RequestOption) (*client.V2PermissionSavedListOK, error)
- func (a *API) V2PermissionSavedRemove(ctx context.Context, params client.V2PermissionSavedRemoveParams, options ...client.RequestOption) (client.V2PermissionSavedRemoveRes, error)
- func (a *API) V2PtyConnect(ctx context.Context, params client.V2PtyConnectParams, options ...client.RequestOption) (*client.V2PtyConnectOKApplicationJSON, error)
- func (a *API) V2PtyConnectToken(ctx context.Context, params client.V2PtyConnectTokenParams, options ...client.RequestOption) (*client.V2PtyConnectTokenOK, error)
- func (a *API) V2PtyCreate(ctx context.Context, request *client.V2PtyCreateReq, params client.V2PtyCreateParams, options ...client.RequestOption) (*client.V2PtyCreateOK, error)
- func (a *API) V2PtyGet(ctx context.Context, params client.V2PtyGetParams, options ...client.RequestOption) (*client.V2PtyGetOK, error)
- func (a *API) V2PtyList(ctx context.Context, params client.V2PtyListParams, options ...client.RequestOption) (*client.V2PtyListOK, error)
- func (a *API) V2PtyRemove(ctx context.Context, params client.V2PtyRemoveParams, options ...client.RequestOption) (client.V2PtyRemoveRes, error)
- func (a *API) V2PtyUpdate(ctx context.Context, request *client.V2PtyUpdateReq, params client.V2PtyUpdateParams, options ...client.RequestOption) (*client.V2PtyUpdateOK, error)
- func (a *API) V2QuestionRequestList(ctx context.Context, params client.V2QuestionRequestListParams, options ...client.RequestOption) (*client.V2QuestionRequestListOK, error)
- func (a *API) V2SessionActive(ctx context.Context, options ...client.RequestOption) (*client.V2SessionActiveOK, error)
- func (a *API) V2SessionCreate(ctx context.Context, request *client.V2SessionCreateReq, options ...client.RequestOption) (*client.V2SessionCreateOK, error)
- func (a *API) V2SkillList(ctx context.Context, params client.V2SkillListParams, options ...client.RequestOption) (*client.V2SkillListOK, error)
- func (a *API) VcsDiff(ctx context.Context, params client.VcsDiffParams, options ...client.RequestOption) ([]client.VcsFileDiff, error)
- func (a *API) VcsDiffRaw(ctx context.Context, params client.VcsDiffRawParams, options ...client.RequestOption) (client.VcsDiffRawRes, error)
- func (a *API) VcsGet(ctx context.Context, params client.VcsGetParams, options ...client.RequestOption) (*client.VcsInfo, error)
- func (a *API) VcsStatus(ctx context.Context, params client.VcsStatusParams, options ...client.RequestOption) ([]client.VcsFileStatus, error)
- type ClientCfg
- func NewClientCFG(url, username, password string) (ClientCfg, error)
func Extract
Extract asserts that the result of an API call was successful and converts it to the expected concrete type T. If the API call failed, it returns an error.
func GetRoutes
type API
func NewAPI
func (*API) AppAgents
func (a *API) AppAgents(ctx context.Context, params client.AppAgentsParams, options ...client.RequestOption) ([]client.Agent, error)
AppAgents invokes app.agents operation.
Get a list of all available AI agents in the OpenCode system.
GET /agent
func (*API) AppSkills
func (a *API) AppSkills(ctx context.Context, params client.AppSkillsParams, options ...client.RequestOption) ([]client.AppSkillsOKItem, error)
AppSkills invokes app.skills operation.
Get a list of all available skills in the OpenCode system.
GET /skill
func (*API) CommandList
func (a *API) CommandList(ctx context.Context, params client.CommandListParams, options ...client.RequestOption) ([]client.Command, error)
CommandList invokes command.list operation.
Get a list of all available commands in the OpenCode system.
GET /command
func (*API) ConfigProviders
func (a *API) ConfigProviders(ctx context.Context, params client.ConfigProvidersParams, options ...client.RequestOption) (*client.ConfigProvidersOK, error)
ConfigProviders invokes config.providers operation.
Get a list of all configured AI providers and their default models.
GET /config/providers
func (*API) ExperimentalCapabilitiesGet
func (a *API) ExperimentalCapabilitiesGet(ctx context.Context, params client.ExperimentalCapabilitiesGetParams, options ...client.RequestOption) (*client.ExperimentalCapabilities, error)
ExperimentalCapabilitiesGet invokes experimental.capabilities.get operation.
Get experimental features enabled on the OpenCode server.
GET /experimental/capabilities
func (*API) ExperimentalConsoleGet
func (a *API) ExperimentalConsoleGet(ctx context.Context, params client.ExperimentalConsoleGetParams, options ...client.RequestOption) (*client.ConsoleState, error)
ExperimentalConsoleGet invokes experimental.console.get operation.
Get the active Console org name and the set of provider IDs managed by that Console org.
GET /experimental/console
func (*API) ExperimentalConsoleListOrgs
func (a *API) ExperimentalConsoleListOrgs(ctx context.Context, params client.ExperimentalConsoleListOrgsParams, options ...client.RequestOption) (*client.ExperimentalConsoleListOrgsOK, error)
ExperimentalConsoleListOrgs invokes experimental.console.listOrgs operation.
Get the available Console orgs across logged-in accounts, including the current active org.
GET /experimental/console/orgs
func (*API) ExperimentalConsoleSwitchOrg
func (a *API) ExperimentalConsoleSwitchOrg(ctx context.Context, request client.OptExperimentalConsoleSwitchOrgReq, params client.ExperimentalConsoleSwitchOrgParams, options ...client.RequestOption) (bool, error)
ExperimentalConsoleSwitchOrg invokes experimental.console.switchOrg operation.
Persist a new active Console account/org selection for the current local OpenCode state.
POST /experimental/console/switch
func (*API) ExperimentalProjectCopyGenerateName
func (a *API) ExperimentalProjectCopyGenerateName(ctx context.Context, request client.OptExperimentalProjectCopyGenerateNameReq, params client.ExperimentalProjectCopyGenerateNameParams, options ...client.RequestOption) (*client.ExperimentalProjectCopyGenerateNameOK, error)
ExperimentalProjectCopyGenerateName invokes experimental.projectCopy.generateName operation.
Generate a short name for a project copy from task context.
POST /experimental/project/{projectID}/copy/generate-name
func (*API) ExperimentalResourceList
func (a *API) ExperimentalResourceList(ctx context.Context, params client.ExperimentalResourceListParams, options ...client.RequestOption) (*client.ExperimentalResourceListOK, error)
ExperimentalResourceList invokes experimental.resource.list operation.
Get all available MCP resources from connected servers. Optionally filter by name.
GET /experimental/resource
func (*API) ExperimentalSessionList
func (a *API) ExperimentalSessionList(ctx context.Context, params client.ExperimentalSessionListParams, options ...client.RequestOption) ([]client.GlobalSession, error)
ExperimentalSessionList invokes experimental.session.list operation.
Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
GET /experimental/session
func (*API) ExperimentalWorkspaceAdapterList
func (a *API) ExperimentalWorkspaceAdapterList(ctx context.Context, params client.ExperimentalWorkspaceAdapterListParams, options ...client.RequestOption) ([]client.ExperimentalWorkspaceAdapterListOKItem, error)
ExperimentalWorkspaceAdapterList invokes experimental.workspace.adapter.list operation.
List all available workspace adapters for the current project.
GET /experimental/workspace/adapter
func (*API) ExperimentalWorkspaceStatus
func (a *API) ExperimentalWorkspaceStatus(ctx context.Context, params client.ExperimentalWorkspaceStatusParams, options ...client.RequestOption) ([]client.WorkspaceEventConnectionStatus, error)
ExperimentalWorkspaceStatus invokes experimental.workspace.status operation.
Get connection status for workspaces in the current project.
GET /experimental/workspace/status
func (*API) ExperimentalWorkspaceSyncList
func (a *API) ExperimentalWorkspaceSyncList(ctx context.Context, params client.ExperimentalWorkspaceSyncListParams, options ...client.RequestOption) (client.ExperimentalWorkspaceSyncListRes, error)
ExperimentalWorkspaceSyncList invokes experimental.workspace.syncList operation.
Register missing workspaces returned by workspace adapters.
POST /experimental/workspace/sync-list
func (*API) FileList
func (a *API) FileList(ctx context.Context, params client.FileListParams, options ...client.RequestOption) ([]client.FileNode, error)
FileList invokes file.list operation.
List files and directories in a specified path.
GET /file
func (*API) FileRead
func (a *API) FileRead(ctx context.Context, params client.FileReadParams, options ...client.RequestOption) (*client.FileContent, error)
FileRead invokes file.read operation.
Read the content of a specified file.
GET /file/content
func (*API) FileStatus
func (a *API) FileStatus(ctx context.Context, params client.FileStatusParams, options ...client.RequestOption) ([]client.File, error)
FileStatus invokes file.status operation.
Get the git status of all files in the project.
GET /file/status
func (*API) FindFiles
func (a *API) FindFiles(ctx context.Context, params client.FindFilesParams, options ...client.RequestOption) ([]string, error)
FindFiles invokes find.files operation.
Search for files or directories by name or pattern in the project directory.
GET /find/file
func (*API) FindSymbols
func (a *API) FindSymbols(ctx context.Context, params client.FindSymbolsParams, options ...client.RequestOption) ([]client.Symbol, error)
FindSymbols invokes find.symbols operation.
Search for workspace symbols like functions, classes, and variables using LSP.
GET /find/symbol
func (*API) FindText
func (a *API) FindText(ctx context.Context, params client.FindTextParams, options ...client.RequestOption) ([]client.FindTextOKItem, error)
FindText invokes find.text operation.
Search for text patterns across files in the project using ripgrep.
GET /find
func (*API) FormatterStatus
func (a *API) FormatterStatus(ctx context.Context, params client.FormatterStatusParams, options ...client.RequestOption) ([]client.FormatterStatus, error)
FormatterStatus invokes formatter.status operation.
Get formatter status.
GET /formatter
func (*API) GlobalDispose
func (a *API) GlobalDispose(ctx context.Context, options ...client.RequestOption) (*client.GlobalDisposeOKApplicationJSON, error)
GlobalDispose invokes global.dispose operation.
Clean up and dispose all OpenCode instances, releasing all resources.
POST /global/dispose
func (*API) GlobalHealth
func (a *API) GlobalHealth(ctx context.Context, options ...client.RequestOption) (*client.GlobalHealthOK, error)
GlobalHealth invokes global.health operation.
Get health information about the OpenCode server.
GET /global/health
func (*API) InstanceDispose
func (a *API) InstanceDispose(ctx context.Context, params client.InstanceDisposeParams, options ...client.RequestOption) (*client.InstanceDisposeOKApplicationJSON, error)
InstanceDispose invokes instance.dispose operation.
Clean up and dispose the current OpenCode instance, releasing all resources.
POST /instance/dispose
func (*API) LspStatus
func (a *API) LspStatus(ctx context.Context, params client.LspStatusParams, options ...client.RequestOption) ([]client.LSPStatus, error)
LspStatus invokes lsp.status operation.
Get LSP server status.
GET /lsp
func (*API) McpAuthRemove
func (a *API) McpAuthRemove(ctx context.Context, params client.McpAuthRemoveParams, options ...client.RequestOption) (*client.McpAuthRemoveOK, error)
McpAuthRemove invokes mcp.auth.remove operation.
Remove OAuth credentials for an MCP server.
DELETE /mcp/{name}/auth
func (*API) McpConnect
func (a *API) McpConnect(ctx context.Context, params client.McpConnectParams, options ...client.RequestOption) (*client.McpConnectOKApplicationJSON, error)
McpConnect invokes mcp.connect operation.
Connect an MCP server.
POST /mcp/{name}/connect
func (*API) McpDisconnect
func (a *API) McpDisconnect(ctx context.Context, params client.McpDisconnectParams, options ...client.RequestOption) (*client.McpDisconnectOKApplicationJSON, error)
McpDisconnect invokes mcp.disconnect operation.
Disconnect an MCP server.
POST /mcp/{name}/disconnect
func (*API) PathGet
func (a *API) PathGet(ctx context.Context, params client.PathGetParams, options ...client.RequestOption) (*client.Path, error)
PathGet invokes path.get operation.
Retrieve the current working directory and related path information for the OpenCode instance.
GET /path
func (*API) PermissionList
func (a *API) PermissionList(ctx context.Context, params client.PermissionListParams, options ...client.RequestOption) ([]client.PermissionRequest, error)
PermissionList invokes permission.list operation.
Get all pending permission requests across all sessions.
GET /permission
func (*API) ProjectCurrent
func (a *API) ProjectCurrent(ctx context.Context, params client.ProjectCurrentParams, options ...client.RequestOption) (*client.Project, error)
ProjectCurrent invokes project.current operation.
Retrieve the currently active project that OpenCode is working with.
GET /project/current
func (*API) ProjectDirectories
func (a *API) ProjectDirectories(ctx context.Context, params client.ProjectDirectoriesParams, options ...client.RequestOption) ([]client.ProjectDirectoriesItem, error)
ProjectDirectories invokes project.directories operation.
List known local absolute directories for a project.
GET /project/{projectID}/directories
func (*API) ProjectInitGit
func (a *API) ProjectInitGit(ctx context.Context, params client.ProjectInitGitParams, options ...client.RequestOption) (*client.Project, error)
ProjectInitGit invokes project.initGit operation.
Create a git repository for the current project and return the refreshed project info.
POST /project/git/init
func (*API) ProjectList
func (a *API) ProjectList(ctx context.Context, params client.ProjectListParams, options ...client.RequestOption) ([]client.Project, error)
ProjectList invokes project.list operation.
Get a list of projects that have been opened with OpenCode.
GET /project
func (*API) ProviderList
func (a *API) ProviderList(ctx context.Context, params client.ProviderListParams, options ...client.RequestOption) (*client.ProviderListOK, error)
ProviderList invokes provider.list operation.
Get a list of all available AI providers, including both available and connected ones.
GET /provider
func (*API) PtyConnect
func (a *API) PtyConnect(ctx context.Context, params client.PtyConnectParams, options ...client.RequestOption) (*client.PtyConnectOKApplicationJSON, error)
PtyConnect invokes pty.connect operation.
Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
GET /pty/{ptyID}/connect
func (*API) PtyConnectToken
func (a *API) PtyConnectToken(ctx context.Context, params client.PtyConnectTokenParams, options ...client.RequestOption) (*client.PtyTicketConnectToken, error)
PtyConnectToken invokes pty.connectToken operation.
Create a short-lived ticket for opening a PTY WebSocket connection.
POST /pty/{ptyID}/connect-token
func (*API) PtyGet
func (a *API) PtyGet(ctx context.Context, params client.PtyGetParams, options ...client.RequestOption) (*client.Pty, error)
PtyGet invokes pty.get operation.
Retrieve detailed information about a specific pseudo-terminal (PTY) session.
GET /pty/{ptyID}
func (*API) PtyList
func (a *API) PtyList(ctx context.Context, params client.PtyListParams, options ...client.RequestOption) ([]client.Pty, error)
PtyList invokes pty.list operation.
Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
GET /pty
func (*API) PtyRemove
func (a *API) PtyRemove(ctx context.Context, params client.PtyRemoveParams, options ...client.RequestOption) (*client.PtyRemoveOKApplicationJSON, error)
PtyRemove invokes pty.remove operation.
Remove and terminate a specific pseudo-terminal (PTY) session.
DELETE /pty/{ptyID}
func (*API) PtyShells
func (a *API) PtyShells(ctx context.Context, params client.PtyShellsParams, options ...client.RequestOption) ([]client.PtyShellsOKItem, error)
PtyShells invokes pty.shells operation.
Get a list of available shells on the system.
GET /pty/shells
func (*API) QuestionList
func (a *API) QuestionList(ctx context.Context, params client.QuestionListParams, options ...client.RequestOption) ([]client.QuestionRequest, error)
QuestionList invokes question.list operation.
Get all pending question requests across all sessions.
GET /question
func (*API) SessionDiff
func (a *API) SessionDiff(ctx context.Context, params client.SessionDiffParams, options ...client.RequestOption) ([]client.SnapshotFileDiff, error)
SessionDiff invokes session.diff operation.
Get the file changes (diff) that resulted from a specific user message in the session.
GET /session/{sessionID}/diff
func (*API) SessionList
func (a *API) SessionList(ctx context.Context, params client.SessionListParams, options ...client.RequestOption) ([]client.Session, error)
SessionList invokes session.list operation.
Get a list of all OpenCode sessions, sorted by most recently updated.
GET /session
func (*API) SessionShare
func (a *API) SessionShare(ctx context.Context, params client.SessionShareParams, options ...client.RequestOption) (*client.Session, error)
SessionShare invokes session.share operation.
Create a shareable link for a session, allowing others to view the conversation.
POST /session/{sessionID}/share
func (*API) SessionUnshare
func (a *API) SessionUnshare(ctx context.Context, params client.SessionUnshareParams, options ...client.RequestOption) (*client.Session, error)
SessionUnshare invokes session.unshare operation.
Remove the shareable link for a session, making it private again.
DELETE /session/{sessionID}/share
func (*API) SyncStart
func (a *API) SyncStart(ctx context.Context, params client.SyncStartParams, options ...client.RequestOption) (*client.SyncStartOKApplicationJSON, error)
SyncStart invokes sync.start operation.
Start sync loops for workspaces in the current project that have active sessions.
POST /sync/start
func (*API) TuiClearPrompt
func (a *API) TuiClearPrompt(ctx context.Context, params client.TuiClearPromptParams, options ...client.RequestOption) (*client.TuiClearPromptOKApplicationJSON, error)
TuiClearPrompt invokes tui.clearPrompt operation.
Clear the prompt.
POST /tui/clear-prompt
func (*API) TuiControlNext
func (a *API) TuiControlNext(ctx context.Context, params client.TuiControlNextParams, options ...client.RequestOption) (*client.TuiControlNextOK, error)
TuiControlNext invokes tui.control.next operation.
Retrieve the next TUI request from the queue for processing.
GET /tui/control/next
func (*API) TuiControlResponse
func (a *API) TuiControlResponse(ctx context.Context, request jx.Raw, params client.TuiControlResponseParams, options ...client.RequestOption) (*client.TuiControlResponseOKApplicationJSON, error)
TuiControlResponse invokes tui.control.response operation.
Submit a response to the TUI request queue to complete a pending request.
POST /tui/control/response
func (*API) TuiOpenHelp
func (a *API) TuiOpenHelp(ctx context.Context, params client.TuiOpenHelpParams, options ...client.RequestOption) (*client.TuiOpenHelpOKApplicationJSON, error)
TuiOpenHelp invokes tui.openHelp operation.
Open the help dialog in the TUI to display user assistance information.
POST /tui/open-help
func (*API) TuiOpenModels
func (a *API) TuiOpenModels(ctx context.Context, params client.TuiOpenModelsParams, options ...client.RequestOption) (*client.TuiOpenModelsOKApplicationJSON, error)
TuiOpenModels invokes tui.openModels operation.
Open the model dialog.
POST /tui/open-models
func (*API) TuiOpenSessions
func (a *API) TuiOpenSessions(ctx context.Context, params client.TuiOpenSessionsParams, options ...client.RequestOption) (*client.TuiOpenSessionsOKApplicationJSON, error)
TuiOpenSessions invokes tui.openSessions operation.
Open the session dialog.
POST /tui/open-sessions
func (*API) TuiOpenThemes
func (a *API) TuiOpenThemes(ctx context.Context, params client.TuiOpenThemesParams, options ...client.RequestOption) (*client.TuiOpenThemesOKApplicationJSON, error)
TuiOpenThemes invokes tui.openThemes operation.
Open the theme dialog.
POST /tui/open-themes
func (*API) TuiShowToast
func (a *API) TuiShowToast(ctx context.Context, request client.OptTuiShowToastReq, params client.TuiShowToastParams, options ...client.RequestOption) (*client.TuiShowToastOKApplicationJSON, error)
TuiShowToast invokes tui.showToast operation.
Show a toast notification in the TUI.
POST /tui/show-toast
func (*API) TuiSubmitPrompt
func (a *API) TuiSubmitPrompt(ctx context.Context, params client.TuiSubmitPromptParams, options ...client.RequestOption) (*client.TuiSubmitPromptOKApplicationJSON, error)
TuiSubmitPrompt invokes tui.submitPrompt operation.
Submit the prompt.
POST /tui/submit-prompt
func (*API) V2CommandList
func (a *API) V2CommandList(ctx context.Context, params client.V2CommandListParams, options ...client.RequestOption) (*client.V2CommandListOK, error)
V2CommandList invokes v2.command.list operation.
Retrieve currently registered commands.
GET /api/command
func (*API) V2CredentialRemove
func (a *API) V2CredentialRemove(ctx context.Context, params client.V2CredentialRemoveParams, options ...client.RequestOption) (client.V2CredentialRemoveRes, error)
V2CredentialRemove invokes v2.credential.remove operation.
Remove a stored integration credential.
DELETE /api/credential/{credentialID}
func (*API) V2CredentialUpdate
func (a *API) V2CredentialUpdate(ctx context.Context, request *client.V2CredentialUpdateReq, params client.V2CredentialUpdateParams, options ...client.RequestOption) (client.V2CredentialUpdateRes, error)
V2CredentialUpdate invokes v2.credential.update operation.
Update a stored credential label.
PATCH /api/credential/{credentialID}
func (*API) V2FsFind
func (a *API) V2FsFind(ctx context.Context, params client.V2FsFindParams, options ...client.RequestOption) (*client.V2FsFindOK, error)
V2FsFind invokes v2.fs.find operation.
Find recursively ranked filesystem entries relative to the requested location.
GET /api/fs/find
func (*API) V2FsList
func (a *API) V2FsList(ctx context.Context, params client.V2FsListParams, options ...client.RequestOption) (*client.V2FsListOK, error)
V2FsList invokes v2.fs.list operation.
List direct children of one directory relative to the requested location.
GET /api/fs/list
func (*API) V2FsRead
func (a *API) V2FsRead(ctx context.Context, params client.V2FsReadParams, options ...client.RequestOption) (client.V2FsReadRes, error)
V2FsRead invokes v2.fs.read operation.
Serve one file relative to the requested location.
GET /api/fs/read/*
func (*API) V2HealthGet
func (a *API) V2HealthGet(ctx context.Context, options ...client.RequestOption) (*client.V2HealthGetOK, error)
V2HealthGet invokes v2.health.get operation.
Check whether the API server is ready to accept requests.
GET /api/health
func (*API) V2IntegrationAttemptCancel
func (a *API) V2IntegrationAttemptCancel(ctx context.Context, params client.V2IntegrationAttemptCancelParams, options ...client.RequestOption) (client.V2IntegrationAttemptCancelRes, error)
V2IntegrationAttemptCancel invokes v2.integration.attempt.cancel operation.
Cancel an OAuth attempt and release its resources.
DELETE /api/integration/attempt/{attemptID}
func (*API) V2LocationGet
func (a *API) V2LocationGet(ctx context.Context, params client.V2LocationGetParams, options ...client.RequestOption) (*client.LocationInfo, error)
V2LocationGet invokes v2.location.get operation.
Resolve the requested location or the server default location.
GET /api/location
func (*API) V2PermissionRequestList
func (a *API) V2PermissionRequestList(ctx context.Context, params client.V2PermissionRequestListParams, options ...client.RequestOption) (*client.V2PermissionRequestListOK, error)
V2PermissionRequestList invokes v2.permission.request.list operation.
Retrieve pending permission requests for a location.
GET /api/permission/request
func (*API) V2PermissionSavedList
func (a *API) V2PermissionSavedList(ctx context.Context, params client.V2PermissionSavedListParams, options ...client.RequestOption) (*client.V2PermissionSavedListOK, error)
V2PermissionSavedList invokes v2.permission.saved.list operation.
Retrieve saved permissions, optionally filtered by project.
GET /api/permission/saved
func (*API) V2PermissionSavedRemove
func (a *API) V2PermissionSavedRemove(ctx context.Context, params client.V2PermissionSavedRemoveParams, options ...client.RequestOption) (client.V2PermissionSavedRemoveRes, error)
V2PermissionSavedRemove invokes v2.permission.saved.remove operation.
Remove a saved permission by ID.
DELETE /api/permission/saved/{id}
func (*API) V2PtyConnect
func (a *API) V2PtyConnect(ctx context.Context, params client.V2PtyConnectParams, options ...client.RequestOption) (*client.V2PtyConnectOKApplicationJSON, error)
V2PtyConnect invokes v2.pty.connect operation.
Establish a WebSocket connection streaming PTY output and accepting terminal input.
GET /api/pty/{ptyID}/connect
func (*API) V2PtyConnectToken
func (a *API) V2PtyConnectToken(ctx context.Context, params client.V2PtyConnectTokenParams, options ...client.RequestOption) (*client.V2PtyConnectTokenOK, error)
V2PtyConnectToken invokes v2.pty.connectToken operation.
Create a short-lived single-use ticket for opening a PTY WebSocket connection.
POST /api/pty/{ptyID}/connect-token
func (*API) V2PtyCreate
func (a *API) V2PtyCreate(ctx context.Context, request *client.V2PtyCreateReq, params client.V2PtyCreateParams, options ...client.RequestOption) (*client.V2PtyCreateOK, error)
V2PtyCreate invokes v2.pty.create operation.
Create a pseudo-terminal session for a location.
POST /api/pty
func (*API) V2PtyGet
func (a *API) V2PtyGet(ctx context.Context, params client.V2PtyGetParams, options ...client.RequestOption) (*client.V2PtyGetOK, error)
V2PtyGet invokes v2.pty.get operation.
Get one PTY session, including its exit code once exited.
GET /api/pty/{ptyID}
func (*API) V2PtyList
func (a *API) V2PtyList(ctx context.Context, params client.V2PtyListParams, options ...client.RequestOption) (*client.V2PtyListOK, error)
V2PtyList invokes v2.pty.list operation.
List PTY sessions for a location, including exited sessions retained until removal.
GET /api/pty
func (*API) V2PtyRemove
func (a *API) V2PtyRemove(ctx context.Context, params client.V2PtyRemoveParams, options ...client.RequestOption) (client.V2PtyRemoveRes, error)
V2PtyRemove invokes v2.pty.remove operation.
Terminate and remove one PTY session.
DELETE /api/pty/{ptyID}
func (*API) V2PtyUpdate
func (a *API) V2PtyUpdate(ctx context.Context, request *client.V2PtyUpdateReq, params client.V2PtyUpdateParams, options ...client.RequestOption) (*client.V2PtyUpdateOK, error)
V2PtyUpdate invokes v2.pty.update operation.
Update the title or viewport size of one PTY session.
PUT /api/pty/{ptyID}
func (*API) V2QuestionRequestList
func (a *API) V2QuestionRequestList(ctx context.Context, params client.V2QuestionRequestListParams, options ...client.RequestOption) (*client.V2QuestionRequestListOK, error)
V2QuestionRequestList invokes v2.question.request.list operation.
Retrieve pending question requests for a location.
GET /api/question/request
func (*API) V2SessionActive
func (a *API) V2SessionActive(ctx context.Context, options ...client.RequestOption) (*client.V2SessionActiveOK, error)
V2SessionActive invokes v2.session.active operation.
Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
GET /api/session/active
func (*API) V2SessionCreate
func (a *API) V2SessionCreate(ctx context.Context, request *client.V2SessionCreateReq, options ...client.RequestOption) (*client.V2SessionCreateOK, error)
V2SessionCreate invokes v2.session.create operation.
Create a session at the requested location.
POST /api/session
func (*API) V2SkillList
func (a *API) V2SkillList(ctx context.Context, params client.V2SkillListParams, options ...client.RequestOption) (*client.V2SkillListOK, error)
V2SkillList invokes v2.skill.list operation.
Retrieve currently registered skills.
GET /api/skill
func (*API) VcsDiff
func (a *API) VcsDiff(ctx context.Context, params client.VcsDiffParams, options ...client.RequestOption) ([]client.VcsFileDiff, error)
VcsDiff invokes vcs.diff operation.
Retrieve the current git diff for the working tree or against the default branch.
GET /vcs/diff
func (*API) VcsDiffRaw
func (a *API) VcsDiffRaw(ctx context.Context, params client.VcsDiffRawParams, options ...client.RequestOption) (client.VcsDiffRawRes, error)
VcsDiffRaw invokes vcs.diff.raw operation.
Retrieve a raw patch for current uncommitted changes.
GET /vcs/diff/raw
func (*API) VcsGet
func (a *API) VcsGet(ctx context.Context, params client.VcsGetParams, options ...client.RequestOption) (*client.VcsInfo, error)
VcsGet invokes vcs.get operation.
Retrieve version control system (VCS) information for the current project, such as git branch.
GET /vcs
func (*API) VcsStatus
func (a *API) VcsStatus(ctx context.Context, params client.VcsStatusParams, options ...client.RequestOption) ([]client.VcsFileStatus, error)
VcsStatus invokes vcs.status operation.
Retrieve changed files in the current working tree without patches.
GET /vcs/status
type ClientCfg
func NewClientCFG
use env vars
Generated by gomarkdoc