Files
tkmind_go/CONTRIBUTING.md
T

102 lines
3.6 KiB
Markdown
Raw Normal View History

2024-08-23 16:39:04 -07:00
# Contributing
2025-01-24 13:04:43 -08:00
Goose is Open Source!
We welcome Pull Requests for general contributions! If you have a larger new feature or any questions on how to develop a fix, we recommend you open an [issue][issues] before starting.
2024-08-23 16:39:04 -07:00
## Prerequisites
2025-01-24 13:04:43 -08:00
Goose includes rust binaries alongside an electron app for the GUI. To work
on the rust backend, you will need to [install rust and cargo][rustup]. To work
on the App, you will also need to [install node and npm][nvm] - we recommend through nvm.
2024-10-02 11:05:43 -07:00
2024-08-23 16:39:04 -07:00
We provide a shortcut to standard commands using [just][just] in our `justfile`.
2025-01-24 13:04:43 -08:00
## Getting Started
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
### Rust
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
First let's compile goose and try it out
2024-09-17 17:08:38 -04:00
2024-10-02 11:05:43 -07:00
```
2025-01-24 13:04:43 -08:00
cargo build
2024-10-02 11:05:43 -07:00
```
2024-09-17 17:08:38 -04:00
2025-01-24 13:04:43 -08:00
when that is done, you should now have debug builds of the binaries like the goose cli:
2024-09-17 17:08:38 -04:00
2024-10-02 11:05:43 -07:00
```
2025-01-24 13:04:43 -08:00
./target/debug/goose --help
2024-10-02 11:05:43 -07:00
```
2024-09-17 17:08:38 -04:00
2025-01-24 13:04:43 -08:00
If you haven't used the CLI before, you can use this compiled version to do first time configuration:
2024-09-17 17:08:38 -04:00
2025-01-24 13:04:43 -08:00
```
./target/debug/goose configure
2024-08-23 16:39:04 -07:00
```
2025-01-24 13:04:43 -08:00
And then once you have a connection to an LLM provider working, you can run a session!
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
```
./target/debug/goose session
2024-08-23 16:39:04 -07:00
```
2025-01-24 13:04:43 -08:00
These same commands can be recompiled and immediately run using `cargo run -p goose-cli` for iteration.
As you make changes to the rust code, you can try it out on the CLI, or also run checks and tests:
2025-01-24 13:04:43 -08:00
```
cargo check # do your changes compile
cargo test # do the tests pass with your changes.
```
2025-01-24 13:04:43 -08:00
### Node
2025-01-24 13:04:43 -08:00
Now let's make sure you can run the app.
2025-01-24 13:04:43 -08:00
```
just run-ui
```
2025-01-24 13:04:43 -08:00
The start gui will both build a release build of rust (as if you had done `cargo build -r`) and start the electron process.
You should see the app open a window, and drop you into first time setup. When you've gone through the setup,
you can talk to goose!
2025-01-24 13:04:43 -08:00
You can now make changes in the code in ui/desktop to iterate on the GUI half of goose.
2024-09-17 17:08:38 -04:00
2025-01-24 13:04:43 -08:00
## Env Vars
2025-01-24 13:04:43 -08:00
You may want to make more frequent changes to your provider setup or similar to test things out
as a developer. You can use environment variables to change things on the fly without redoing
your configuration.
2025-01-24 13:04:43 -08:00
> [!TIP]
> At the moment, we are still updating some of the CLI configuration to make sure this is
> respected.
2025-01-24 13:04:43 -08:00
You can change the provider goose points to via the `GOOSE_PROVIDER` env var. If you already
have a credential for that provider in your keychain from previously setting up, it should
reuse it. For things like automations or to test without doing official setup, you can also
set the relevant env vars for that provider. For example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
or `DATABRICKS_HOST`. Refer to the provider details for more info on required keys.
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
## Enable traces in Goose with [locally hosted Langfuse](https://langfuse.com/docs/deployment/self-host)
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
- Run `just langfuse-server` to start your local Langfuse server. It requires Docker.
- Go to http://localhost:3000 and log in with the default email/password output by the shell script (values can also be found in the `.env.langfuse.local` file).
- Set the environment variables so that rust can connect to the langfuse server
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
```
export LANGFUSE_INIT_PROJECT_PUBLIC_KEY=publickey-local
export LANGFUSE_INIT_PROJECT_SECRET_KEY=secretkey-local
```
2024-08-23 16:39:04 -07:00
2025-01-24 13:04:43 -08:00
Then you can view your traces at http://localhost:3000
2024-08-23 16:39:04 -07:00
## Conventional Commits
This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for PR titles. Conventional Commits make it easier to understand the history of a project and facilitate automation around versioning and changelog generation.
[issues]: https://github.com/block/goose/issues
2025-01-24 13:04:43 -08:00
[rustup]: https://doc.rust-lang.org/cargo/getting-started/installation.html
[nvm]: https://github.com/nvm-sh/nvm
[just]: https://github.com/casey/just?tab=readme-ov-file#installation