OpenCode.Generated.File (opencode_sdk v0.1.56)

Copy Markdown View Source

Provides API endpoints related to file

Summary

Types

find_text_200_json_resp()

@type find_text_200_json_resp() :: %{
  absolute_offset: integer(),
  line_number: integer(),
  lines: find_text_200_json_resp_lines(),
  path: find_text_200_json_resp_path(),
  submatches: [find_text_200_json_resp_submatches()]
}

find_text_200_json_resp_lines()

@type find_text_200_json_resp_lines() :: %{text: String.t()}

find_text_200_json_resp_path()

@type find_text_200_json_resp_path() :: %{text: String.t()}

find_text_200_json_resp_submatches()

@type find_text_200_json_resp_submatches() :: %{
  end: integer(),
  match: find_text_200_json_resp_submatches_match(),
  start: integer()
}

find_text_200_json_resp_submatches_match()

@type find_text_200_json_resp_submatches_match() :: %{text: String.t()}

t()

@type t() :: %OpenCode.Generated.File{
  added: integer(),
  path: String.t(),
  removed: integer(),
  status: String.t()
}

Functions

file_list(opts \\ [])

@spec file_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.FileNode.t()]} | :error

List files

List files and directories in a specified path.

Options

  • directory
  • workspace
  • path

file_read(opts \\ [])

@spec file_read(opts :: keyword()) ::
  {:ok, OpenCode.Generated.FileContent.t()} | :error

Read file

Read the content of a specified file.

Options

  • directory
  • workspace
  • path

file_status(opts \\ [])

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

Get file status

Get the git status of all files in the project.

Options

  • directory
  • workspace

find_files(opts \\ [])

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

Find files

Search for files or directories by name or pattern in the project directory.

Options

  • directory
  • workspace
  • query
  • dirs
  • type
  • limit

find_symbols(opts \\ [])

@spec find_symbols(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Symbol.t()]} | :error

Find symbols

Search for workspace symbols like functions, classes, and variables using LSP.

Options

  • directory
  • workspace
  • query

find_text(opts \\ [])

@spec find_text(opts :: keyword()) :: {:ok, [find_text_200_json_resp()]} | :error

Find text

Search for text patterns across files in the project using ripgrep.

Options

  • directory
  • workspace
  • pattern