Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# AGENTS.md

For coding agents and other automated tools, and for the people who run them.
The same rules apply to changes written by hand.

## What this project is

`librespeed-cli` is the command line client for LibreSpeed servers. Scripts
and other programs read its output, and
[librespeed/speedtest-cli-rust](https://github.com/librespeed/speedtest-cli-rust)
is a port that follows it.

- Options, exit codes, messages and the JSON and CSV formats are a contract. A
pull request that changes them says so in its description, with what a user
sees before and after.
- A change that needs something new from the backend, such as a new field in an
answer, is agreed and merged in
[librespeed/speedtest](https://github.com/librespeed/speedtest) first.
- Text from a server or a server list is untrusted. New code passes it
through `output.Sanitize` before it prints it.

## Before you open or update a pull request

```sh
gofmt -l .
go vet ./...
go test ./...
```

`gofmt -l .` prints nothing when the code is formatted. A fix comes with a
test that fails without it.

## Pull requests and comments

- A person reads and approves every push and every comment before it goes out,
and can explain every line of the change.
- A pull request does one thing. Its description says what changes for a user,
such as a new CSV column, JSON key or message.
- Push when the change is ready, not after each finding. Do not ask an
automated reviewer for a new review after every push, and do not change code
only because one asked. A person decides first whether the finding is right.
- Comment to answer a maintainer or to explain a decision. Post no status
updates, no repeated summaries of test runs and no mentions of yourself. The
description and the commits are the record.
- Do not open the same change in several repositories at once. Start where it
has to land first and wait for it to merge.

Maintainers may close or lock a pull request or an issue that does not follow
this.
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing

Bug reports and pull requests are welcome.

- The output of this client is read by scripts and followed by the Rust port.
Say in the pull request what changes for a user.
- A change that needs something new from the backend is agreed in
[librespeed/speedtest](https://github.com/librespeed/speedtest) first.
- Run `gofmt -l .`, `go vet ./...` and `go test ./...` before you push.
- You may use an AI tool to write code or text. You are still the author: read
and approve everything before it is pushed or posted, and be ready to
explain it.
- Keep the discussion short. Comment when there is something to say, and post
no status updates.

[AGENTS.md](AGENTS.md) has the full rules, for tools and for the people who
run them.