OpenCode.Generated.Project (opencode_sdk v0.1.60)

Copy Markdown View Source

Provides API endpoints related to project

Summary

Types

t()

@type t() :: %OpenCode.Generated.Project{
  commands: OpenCode.Generated.ProjectCommands.t() | nil,
  icon: OpenCode.Generated.ProjectIcon.t() | nil,
  id: String.t(),
  name: String.t() | nil,
  sandboxes: [String.t()],
  time: OpenCode.Generated.ProjectTime.t(),
  vcs: String.t() | nil,
  worktree: String.t()
}

Functions

project_current(opts \\ [])

@spec project_current(opts :: keyword()) :: {:ok, t()} | :error

Get current project

Retrieve the currently active project that OpenCode is working with.

Options

  • directory
  • workspace

project_init_git(opts \\ [])

@spec project_init_git(opts :: keyword()) :: {:ok, t()} | :error

Initialize git repository

Create a git repository for the current project and return the refreshed project info.

Options

  • directory
  • workspace

project_list(opts \\ [])

@spec project_list(opts :: keyword()) :: {:ok, [t()]} | :error

List all projects

Get a list of projects that have been opened with OpenCode.

Options

  • directory
  • workspace

project_update(projectID, body, opts \\ [])

@spec project_update(projectID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}

Update project

Update project properties such as name, icon, and commands.

Options

  • directory
  • workspace

Request Body

Content Types: application/json