Skip to content

Commit 948e8d0

Browse files
authored
Add initial developer guide (#845)
1 parent a02c821 commit 948e8d0

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
# https://github.com/github/linguist.
44

55
docs/cli/thv*.md linguist-generated=true
6+
docs/operator/crd-api.md linguist-generated=true
7+
docs/server/docs.go linguist-generated=true
8+
docs/server/swagger.* linguist-generated=true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ setup, no security headaches, no runtime hassles.
7272
We welcome contributions and feedback from the community!
7373

7474
- 🐛 [Report issues](https://github.com/stacklok/toolhive/issues)
75+
- 💬 [Join our Discord](https://discord.gg/stacklok)
7576
- 🤝 [Contributing guide](./CONTRIBUTING.md)
77+
- 📖 [Developer guide](./docs/README.md)
7678

7779
If you have ideas, suggestions, or want to get involved, check out our
7880
contributing guide or open an issue. Join us in making ToolHive even better!

docs/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# ToolHive developer guide <!-- omit in toc -->
2+
3+
The ToolHive development documentation provides guidelines and resources for
4+
developers working on the ToolHive project. It includes information on setting
5+
up the development environment, contributing to the codebase, and understanding
6+
the architecture of the project.
7+
8+
For user-facing documentation, please refer to the
9+
[ToolHive docs website](https://docs.stacklok.com/toolhive/).
10+
11+
## Contents <!-- omit in toc -->
12+
13+
- [Getting started](#getting-started)
14+
- [Prerequisites](#prerequisites)
15+
- [Building ToolHive](#building-toolhive)
16+
- [Running tests](#running-tests)
17+
- [Other development tasks](#other-development-tasks)
18+
- [Contributing](#contributing)
19+
20+
Explore the contents of this directory to find more detailed information on
21+
specific topics related to ToolHive development including architectural details
22+
and [design proposals](./proposals).
23+
24+
For information on the ToolHive Operator, see the
25+
[ToolHive Operator README](../cmd/thv-operator/README.md) and
26+
[DESIGN doc](../cmd/thv-operator/DESIGN.md).
27+
28+
## Getting started
29+
30+
ToolHive is developed in Go. To get started with development, you need to
31+
install Go and set up your development environment.
32+
33+
### Prerequisites
34+
35+
- **Go**: ToolHive requires Go 1.24. You can download and install Go from the
36+
[official Go website](https://go.dev/doc/install).
37+
38+
- **Task** (Recommended): Install the [Task](https://taskfile.dev/) tool to run
39+
automated development tasks. You can install it using Homebrew on macOS:
40+
41+
```bash
42+
brew install go-task
43+
```
44+
45+
### Building ToolHive
46+
47+
To build the ToolHive CLI (`thv`), follow these steps:
48+
49+
1. **Clone the repository**: Clone the ToolHive repository to your local machine
50+
using Git:
51+
52+
```bash
53+
git clone https://github.com/stacklok/toolhive.git
54+
cd toolhive
55+
```
56+
57+
2. **Build the project**: Use the `task` command to build the binary:
58+
59+
```bash
60+
task build
61+
```
62+
63+
3. **Run ToolHive**: The build task creates the `thv` binary in the `./bin/`
64+
directory. You can run it directly from there:
65+
66+
```bash
67+
./bin/thv
68+
```
69+
70+
4. Optionally, install the `thv` binary in your `GOPATH/bin` directory:
71+
72+
```bash
73+
task install
74+
```
75+
76+
### Running tests
77+
78+
To run the linting and unit tests for ToolHive, run:
79+
80+
```bash
81+
task lint
82+
task test
83+
```
84+
85+
ToolHive also includes comprehensive end-to-end tests that can be run using:
86+
87+
```bash
88+
task test-e2e
89+
```
90+
91+
### Other development tasks
92+
93+
To see a list of all available development tasks, run:
94+
95+
```bash
96+
task --list
97+
```
98+
99+
## Contributing
100+
101+
We welcome contributions to ToolHive! If you want to contribute, please review
102+
the [contributing guide](./CONTRIBUTING.md).
103+
104+
Contributions to the user-facing documentation are also welcome. If you have
105+
suggestions or improvements, please open an issue or submit a pull request in
106+
the [docs-website repository](https://github.com/stacklok/docs-website).

0 commit comments

Comments
 (0)