diff options
| author | adamdottv <[email protected]> | 2025-07-03 11:49:15 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-07-03 11:49:15 -0500 |
| commit | 5a0910ea79b3f219c64f922fc775636b2bfdf07c (patch) | |
| tree | 6f3288101eb3aa99fdc31cfaf5e07e4990cc8954 /packages/tui/sdk/CONTRIBUTING.md | |
| parent | 1dffabcfdaeefd3bc08a51b625047185bade3a4d (diff) | |
| download | opencode-5a0910ea79b3f219c64f922fc775636b2bfdf07c.tar.gz opencode-5a0910ea79b3f219c64f922fc775636b2bfdf07c.zip | |
chore: better local dev with stainless script
Diffstat (limited to 'packages/tui/sdk/CONTRIBUTING.md')
| -rw-r--r-- | packages/tui/sdk/CONTRIBUTING.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/packages/tui/sdk/CONTRIBUTING.md b/packages/tui/sdk/CONTRIBUTING.md new file mode 100644 index 000000000..34620a3c1 --- /dev/null +++ b/packages/tui/sdk/CONTRIBUTING.md @@ -0,0 +1,66 @@ +## Setting up the environment + +To set up the repository, run: + +```sh +$ ./scripts/bootstrap +$ ./scripts/build +``` + +This will install all the required dependencies and build the SDK. + +You can also [install go 1.18+ manually](https://go.dev/doc/install). + +## Modifying/Adding code + +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `lib/` and `examples/` directories. + +## Adding and running examples + +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. + +```go +# add an example to examples/<your-example>/main.go + +package main + +func main() { + // ... +} +``` + +```sh +$ go run ./examples/<your-example> +``` + +## Using the repository from source + +To use a local version of this library from source in another project, edit the `go.mod` with a replace +directive. This can be done through the CLI with the following: + +```sh +$ go mod edit -replace github.com/sst/opencode-sdk-go=/path/to/opencode-sdk-go +``` + +## Running tests + +Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. + +```sh +# you will need npm installed +$ npx prism mock path/to/your/openapi.yml +``` + +```sh +$ ./scripts/test +``` + +## Formatting + +This library uses the standard gofmt code formatter: + +```sh +$ ./scripts/format +``` |
