Skip to content

Commit 457d440

Browse files
committed
Merge remote-tracking branch 'origin/main' into lalvoeiro/conventional-commit-title-pr
* origin/main: feat: show available toolkits (#37) adding in ability to provide per repo hints (#32) Apply ruff and add to CI (#40) added some regex based checks for dangerous commands (#38) chore: Update publish github workflow to check package versions before publishing (#19) chore: upgrade ai-exchange dependency (#36) fix: resuming sessions (#35) feat: upgrade `ai-exchange` to version `0.8.3` and fix tests (#34) fix: export metadata.plugins export should have valid module (#30) fix (#24) link to vs code extension (#20) Enable cli options for plugin (#22) Modified the readme to be more friendly to new users (#16) chore: gitignore generated lockfile (#15) add prompts (#11) conditionally publish only when config changes (#9)
2 parents afda8f7 + c91b11b commit 457d440

18 files changed

+420
-141
lines changed

.github/workflows/ci.yaml

+13-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1313

14-
- name: Install UV
15-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
14+
- name: Install UV
15+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
1616

17-
- name: Source Cargo Environment
18-
run: source $HOME/.cargo/env
17+
- name: Source Cargo Environment
18+
run: source $HOME/.cargo/env
1919

20-
- name: Run tests
21-
run: |
22-
uv run pytest tests -m 'not integration'
20+
- name: Ruff
21+
run: |
22+
uvx ruff check
23+
uvx ruff format --check
24+
25+
- name: Run tests
26+
run: |
27+
uv run pytest tests -m 'not integration'

.github/workflows/pypi_release.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: PYPI Release
22

33
on:
44
push:
5-
branches:
6-
- main
75
tags:
86
- 'v*'
97

@@ -23,8 +21,26 @@ jobs:
2321
- name: Build with UV
2422
run: uvx --from build pyproject-build --installer uv
2523

24+
- name: Check version
25+
id: check_version
26+
run: |
27+
PACKAGE_NAME=$(grep '^name =' pyproject.toml | sed -E 's/name = "(.*)"/\1/')
28+
TAG_VERSION=$(echo "$GITHUB_REF" | sed -E 's/refs\/tags\/v(.+)/\1/')
29+
CURRENT_VERSION=$(curl -s https://pypi.org/pypi/$PACKAGE_NAME/json | jq -r .info.version)
30+
PROJECT_VERSION=$(grep '^version =' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
31+
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
32+
echo "Tag version does not match version in pyproject.toml"
33+
exit 1
34+
fi
35+
if python -c "from packaging.version import parse as parse_version; exit(0 if parse_version('$TAG_VERSION') > parse_version('$CURRENT_VERSION') else 1)"; then
36+
echo "new_version=true" >> $GITHUB_OUTPUT
37+
else
38+
exit 1
39+
fi
40+
2641
- name: Publish
2742
uses: pypa/[email protected]
43+
if: steps.check_version.outputs.new_version == 'true'
2844
with:
2945
user: __token__
3046
password: ${{ secrets.PYPI_TOKEN_TEMP }}

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,7 @@ dmypy.json
137137
docs/docs/reference
138138

139139
## goose session files
140-
.goose
140+
.goose
141+
142+
# ignore lockfile
143+
uv.lock

README.md

+136-84
Original file line numberDiff line numberDiff line change
@@ -10,127 +10,128 @@ goose
1010

1111
<p align="center">
1212
<a href="#usage">Usage</a> •
13-
<a href="#installation">Installation</a> •
14-
<a href="#tips">Tips</a>
13+
<a href="#configuration">Configuration</a> •
14+
<a href="#tips">Tips</a> •
15+
<a href="#faq">FAQ</a> •
16+
<a href="#open-source">Open Source</a>
1517
</p>
1618

1719
`goose` assists in solving a wide range of programming and operational tasks. It is a live virtual developer you can interact with, guide, and learn from.
1820

19-
To solve problems, goose breaks down instructions into sequences of tasks and carries them out using tools. Its ability to connect its changes with real outcomes (e.g. errors) and course correct is its most powerful and exciting feature. goose is free open source software and is built to be extensible and customizable.
21+
To solve problems, `goose` breaks down instructions into sequences of tasks and carries them out using tools. Its ability to connect its changes with real outcomes (e.g. errors) and course correct is its most powerful and exciting feature. `goose` is free open source software and is built to be extensible and customizable.
2022

21-
## Usage
23+
![goose_demo](https://github.com/user-attachments/assets/0794eaba-97ab-40ef-af64-6fc7f68eb8e2)
2224

23-
You interact with goose in conversational sessions - something like a natural language driven code interpreter.
24-
The default toolkit lets it take actions through shell commands and file edits.
25-
You can interrupt Goose at any time to help redirect its efforts.
2625

27-
From your terminal, navigate to the directory you'd like to start from and run:
28-
```sh
29-
goose session start
30-
```
3126

32-
You will see a prompt `G❯`:
33-
34-
```
35-
G❯ type your instructions here exactly as you would tell a developer.
36-
```
27+
## Usage
28+
### Installation
3729

38-
From here you can talk directly with goose - send along your instructions. If you are looking to exit, use `CTRL+D`,
39-
although goose should help you figure that out if you forget.
30+
To install `goose`, we recommend `pipx`
4031

41-
When you exit a session, it will save the history and you can resume it later on:
32+
First make sure you've [installed pipx][pipx] - for example
4233

4334
``` sh
44-
goose session resume
35+
brew install pipx
36+
pipx ensurepath
4537
```
4638

47-
## Tips
39+
Then you can install `goose` with
4840

49-
Here are some collected tips we have for working efficiently with Goose
50-
51-
- **goose can and will edit files**. Use a git strategy to avoid losing anything - such as staging your
52-
personal edits and leaving goose edits unstaged until reviewed. Or consider using indivdual commits which can be reverted.
53-
- **goose can and will run commands**. You can ask it to check with you first if you are concerned. It will check commands for safety as well.
54-
- You can interrupt goose with `CTRL+C` to correct it or give it more info.
55-
- goose works best when solving concrete problems - experiment with how far you need to break that problem
56-
down to get goose to solve it. Be specific! E.g. it will likely fail to `"create a banking app"`,
57-
but probably does a good job if prompted with `"create a Fastapi app with an endpoint for deposit and withdrawal
58-
and with account balances stored in mysql keyed by id"`
59-
- If goose doesn't have enough context to start with, it might go down the wrong direction. Tell it
60-
to read files that you are refering to or search for objects in code. Even better, ask it to summarize
61-
them for you, which will help it set up its own next steps.
62-
- Refer to any objects in files with something that is easy to search for, such as `"the MyExample class"
63-
- goose *loves* to know how to run tests to get a feedback loop going, just like you do. If you tell it how you test things locally and quickly, it can make use of that when working on your project
64-
- You can use goose for tasks that would require scripting at times, even looking at your screen and correcting designs/helping you fix bugs, try asking it to help you in a way you would ask a person.
65-
- goose will make mistakes, and go in the wrong direction from times, feel free to correct it, or start again.
66-
- You can tell goose to run things for you continuously (and it will iterate, try, retry) but you can also tell it to check with you before doing things (and then later on tell it to go off on its own and do its best to solve).
67-
- Goose can run anywhere, doesn't have to be in a repo, just ask it!
68-
69-
## Installation
41+
```sh
42+
pipx install goose-ai
43+
```
44+
#### IDEs
45+
There is an early version of a VS Code extension with goose support you can try here: https://github.com/square/goose-vscode - more to come soon.
7046

71-
To install goose, we recommend `pipx`
47+
### LLM provider access setup
48+
`goose` works on top of LLMs (you need to bring your own LLM). By default, `goose` uses `openai` as LLM provider. You need to set OPENAI_API_KEY as an environment variable if you would like to use `openai`.
49+
```sh
50+
export OPENAI_API_KEY=your_open_api_key
51+
```
7252

73-
First make sure you've [installed pipx][pipx] - for example
53+
Otherwise, please refer <a href="#configuration">Configuration</a> to customise `goose`
7454

75-
``` sh
76-
brew install pipx
77-
pipx ensurepath
55+
### Start `goose` session
56+
From your terminal, navigate to the directory you'd like to start from and run:
57+
```sh
58+
goose session start
7859
```
7960

80-
Then you can install goose with
61+
You will see a prompt `G❯`:
8162

82-
``` sh
83-
pipx install goose-ai
8463
```
64+
G❯ type your instructions here exactly as you would tell a developer.
65+
```
66+
Now you are interact with `goose` in conversational sessions - something like a natural language driven code interpreter.
67+
The default toolkit lets it take actions through shell commands and file edits.
68+
You can interrupt `goose` at any time to help redirect its efforts.
8569

86-
### Config
70+
### Exit `goose` session
71+
If you are looking to exit, use `CTRL+D`, although `goose` should help you figure that out if you forget. See below for some examples.
8772

88-
Goose will try to detect what LLM it can work with and place a config in `~/.config/goose/profiles.yaml` automatically.
8973

90-
#### Toolkits
74+
### Resume `goose` session
75+
When you exit a session, it will save the history in `~/.config/goose/sessions` directory and you can resume it later on:
9176

92-
Goose can be extended with toolkits, and out of the box there are some available:
77+
``` sh
78+
goose session resume
79+
```
9380

94-
* `screen`: for letting goose take a look at your screen to help debug or work on designs (gives goose eyes)
95-
* `github`: for awareness and suggestions on how to use github
96-
* `repo_context`: for summarizing and understanding a repository you are working in.
81+
## Configuration
82+
83+
`goose` can detect what LLM and toolkits it can work with from the configuration file `~/.config/goose/profiles.yaml` automatically.
9784

98-
To configure for example the screen toolkit, edit `~/.config/goose/profiles.yaml`:
85+
### Configuration options
86+
Example:
9987

10088
```yaml
89+
default:
10190
provider: openai
10291
processor: gpt-4o
10392
accelerator: gpt-4o-mini
104-
moderator: passive
93+
moderator: truncate
10594
toolkits:
10695
- name: developer
10796
requires: {}
10897
- name: screen
10998
requires: {}
11099
```
111-
112100
101+
You can edit this configuration file to use different LLMs and toolkits in `goose`. `goose can also be extended to support any LLM or combination of LLMs
113102

114-
#### Advanced LLM config
103+
#### provider
104+
Provider of LLM. LLM providers that currently are supported by `goose`:
115105

116-
goose works on top of LLMs (you bring your own LLM). If you need to customize goose, one way is via editing: `~/.config/goose/profiles.yaml`.
106+
| Provider | Required environment variable(s) to access provider |
107+
| :----- | :------------------------------ |
108+
| openai | `OPENAI_API_KEY` |
109+
| anthropic | `ANTHROPIC_API_KEY` |
110+
| databricks | `DATABRICKS_HOST` and `DATABRICKS_TOKEN` |
117111

118-
It will look by default something like:
119112

120-
```yaml
121-
default:
122-
provider: openai
123-
processor: gpt-4o
124-
accelerator: gpt-4o-mini
125-
moderator: truncate
126-
toolkits:
127-
- name: developer
128-
requires: {}
129-
```
113+
#### processor
114+
Model for complex, multi-step tasks such as writing code and executing commands. Example: `gpt-4o`. You should choose the model based the provider you configured.
115+
116+
#### accelerator
117+
Small model for fast, lightweight tasks. Example: `gpt-4o-mini`. You should choose the model based the provider you configured.
118+
119+
#### moderator
120+
Rules designed to control or manage the output of the model. Moderators that currently are supported by `goose`:
121+
122+
- `passive`: does not actively intervene in every response
123+
- `truncate`: truncates the first contexts when the contexts exceed the max token size
130124

131-
*Note: This requires the environment variable `OPENAI_API_KEY` to be set to your OpenAI API key. goose uses at least 2 LLMs: one for acceleration for fast operating, and processing for writing code and executing commands.*
125+
#### toolkits
132126

133-
You can tell it to use another provider for example for Anthropic:
127+
`goose` can be extended with toolkits, and out of the box there are some available:
128+
129+
* `screen`: for letting goose take a look at your screen to help debug or work on designs (gives goose eyes)
130+
* `github`: for awareness and suggestions on how to use github
131+
* `repo_context`: for summarizing and understanding a repository you are working in.
132+
133+
### Examples
134+
#### provider as `anthropic`
134135

135136
```yaml
136137
default:
@@ -139,11 +140,7 @@ default:
139140
accelerator: claude-3-5-sonnet-20240620
140141
...
141142
```
142-
143-
*Note: This will then use the claude-sonnet model, you will need to set the `ANTHROPIC_API_KEY` environment variable to your anthropic API key.*
144-
145-
For Databricks hosted models:
146-
143+
#### provider as `databricks`
147144
```yaml
148145
default:
149146
provider: databricks
@@ -155,16 +152,71 @@ default:
155152
requires: {}
156153
```
157154

158-
This requires `DATABRICKS_HOST` and `DATABRICKS_TOKEN` to be set accordingly
155+
## Tips
156+
157+
Here are some collected tips we have for working efficiently with `goose`
158+
159+
- **`goose` can and will edit files**. Use a git strategy to avoid losing anything - such as staging your
160+
personal edits and leaving `goose` edits unstaged until reviewed. Or consider using individual commits which can be reverted.
161+
- **`goose` can and will run commands**. You can ask it to check with you first if you are concerned. It will check commands for safety as well.
162+
- You can interrupt `goose` with `CTRL+C` to correct it or give it more info.
163+
- `goose` works best when solving concrete problems - experiment with how far you need to break that problem
164+
down to get `goose` to solve it. Be specific! E.g. it will likely fail to `"create a banking app"`,
165+
but probably does a good job if prompted with `"create a Fastapi app with an endpoint for deposit and withdrawal
166+
and with account balances stored in mysql keyed by id"`
167+
- If `goose` doesn't have enough context to start with, it might go down the wrong direction. Tell it
168+
to read files that you are referring to or search for objects in code. Even better, ask it to summarize
169+
them for you, which will help it set up its own next steps.
170+
- Refer to any objects in files with something that is easy to search for, such as `"the MyExample class"
171+
- `goose` *loves* to know how to run tests to get a feedback loop going, just like you do. If you tell it how you test things locally and quickly, it can make use of that when working on your project
172+
- You can use `goose` for tasks that would require scripting at times, even looking at your screen and correcting designs/helping you fix bugs, try asking it to help you in a way you would ask a person.
173+
- `goose` will make mistakes, and go in the wrong direction from times, feel free to correct it, or start again.
174+
- You can tell `goose` to run things for you continuously (and it will iterate, try, retry) but you can also tell it to check with you before doing things (and then later on tell it to go off on its own and do its best to solve).
175+
- `goose` can run anywhere, doesn't have to be in a repo, just ask it!
176+
177+
178+
### Examples
179+
180+
Here are some examples that have been used:
181+
182+
```
183+
G❯ Looking at the in progress changes in this repo, help me finish off the feature. CONTRIBUTING.md shows how to run the tests.
184+
```
185+
186+
```
187+
G❯ In this golang project, I want you to add open telemetry to help me get started with it. Look in the moneymovements module, run the `just test` command to check things work.
188+
```
189+
190+
```
191+
G❯ This project uses an old version of jooq. Upgrade to the latest version, and ensure there are no incompatibilities by running all tests. Dependency versions are in gradle/libs.versions.toml and to run gradle, use the binary located in bin/gradle
192+
```
193+
194+
```
195+
G❯ This is a fresh checkout of a golang project. I do not have my golang environment set up. Set it up and run tests for this project, and ensure they pass. Use the zookeeper jar included in this repository rather than installing zookeeper via brew.
196+
```
197+
198+
```
199+
G❯ In this repo, I want you to look at how to add a new provider for azure.
200+
Some hints are in this github issue: https://github.com/square/exchange/issues
201+
/4 (you can use gh cli to access it).
202+
```
203+
204+
```
205+
G❯ I want you to help me increase the test coverage in src/java... use mvn test to run the unit tests to check it works.
206+
```
207+
208+
## FAQ
209+
210+
**Q:** Why did I get error message of "The model `gpt-4o` does not exist or you do not have access to it.` when I talked goose?
159211
160-
(goose can be extended to support any LLM or combination of LLMs).
212+
**A:** You can find out the LLM provider and models in the configuration file `~/.config/goose/profiles.yaml` here to check whether your LLM provider account has access to the models. For example, after you have made a successful payment of $5 or more (usage tier 1), you'll be able to access the GPT-4, GPT-4 Turbo, GPT-4o models via the OpenAI API. [How can I access GPT-4, GPT-4 Turbo, GPT-4o, and GPT-4o mini?](https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4-gpt-4-turbo-gpt-4o-and-gpt-4o-mini).
161213
162214
## Open Source
163215
164-
Yes, goose is open source and always will be. goose is released under the ASL2.0 license meaning you can use it however you like.
216+
Yes, `goose` is open source and always will be. `goose` is released under the ASL2.0 license meaning you can use it however you like.
165217
See LICENSE.md for more details.
166218
167-
To run goose from source, please see `CONTRIBUTING.md` for instructions on how to set up your environment and you can then run `uv run goose session start`.
219+
To run `goose` from source, please see `CONTRIBUTING.md` for instructions on how to set up your environment and you can then run `uv run `goose` session start`.
168220
169221
170222
[pipx]: https://github.com/pypa/pipx?tab=readme-ov-file#install-pipx

0 commit comments

Comments
 (0)