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
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,27 @@ jobs:
- name: go test
run: go test -race -count=1 ./...

- name: Extract release notes from CHANGELOG.md
run: |
version="${GITHUB_REF_NAME#v}"
awk -v ver="$version" '
# Stop at the next version heading or the link-reference footer.
found && (/^## \[/ || /^\[[^]]+\]: /) { exit }
/^## \[/ && index($0, "[" ver "]") { found=1; next }
found { print }
' CHANGELOG.md > release_notes.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid dirtying git before GoReleaser

In the tag workflow, this redirection creates an untracked release_notes.md in the checkout immediately before goreleaser release; I checked the repo .gitignore and this file is not ignored. GoReleaser's release help documents --clean as only removing dist, and its dirty-state docs show untracked files (?? created.txt) fail validation, so every release with a matching changelog section will abort before publishing unless the notes file is ignored or written outside the worktree.

Useful? React with 👍 / 👎.

if [ ! -s release_notes.md ]; then
echo "::error::No CHANGELOG.md section found for version $version"
exit 1
fi
echo "----- release notes for $version -----"
cat release_notes.md

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "2.15.4"
args: release --clean
args: release --clean --release-notes=release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ checksum:
snapshot:
version_template: "{{ incpatch .Version }}-next"

# The release body is supplied from CHANGELOG.md via `--release-notes` in the
# release workflow, so this generated changelog is used only as a fallback if
# that flag is ever dropped.
changelog:
sort: asc
use: github
Expand Down
126 changes: 126 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Changelog

All notable changes to chatwoot-cli are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

### Changed

### Fixed

## [0.6.0] - 2026-06-03

### Added

- Help center commands for managing portals and articles ([#15](https://github.com/chatwoot/cli/pull/15)).

### Changed

- Reworked the authentication flow ([#19](https://github.com/chatwoot/cli/pull/19)).
- Updated bundled usage examples.
- Bumped `github.com/getkin/kin-openapi` from 0.138.0 to 0.139.0 ([#18](https://github.com/chatwoot/cli/pull/18)).
- Bumped `actions/upload-artifact` from 4 to 7 ([#17](https://github.com/chatwoot/cli/pull/17)).

### Fixed

- Hardened the install script and credential cleanup ([#14](https://github.com/chatwoot/cli/pull/14)).

## [0.5.0] - 2026-05-13

Adds a raw API escape hatch for cases where the CLI does not yet have a first-class command. There are no breaking changes.

### Added

- **`chatwoot api` raw API command** — make authenticated Chatwoot API requests directly from the CLI ([#13](https://github.com/chatwoot/cli/pull/13)). Account-relative paths such as `/conversations/123` are expanded automatically under `/api/v1/accounts/<account_id>`; use `--exact` to target absolute paths like `/api/v1/profile`. Supports custom methods (`-X`), JSON request bodies, file/stdin bodies (`--data`), and additional headers. JSON responses are pretty-printed; non-JSON responses are passed through as-is.

```bash
chatwoot api /conversations/123
chatwoot api -X PATCH /conversations/123 --data '{"status":"open"}'
chatwoot api --exact /api/v1/profile
```

### Changed

- Updated the bundled agent skill with stronger raw API guidance: prefer first-class commands, consult the Chatwoot Swagger before raw calls, and treat all writes (including non-GET raw API calls) as privileged actions requiring explicit user confirmation.
- Simplified the README to focus on core setup and usage, delegating full command details to the docs site.

## [0.4.0] - 2026-05-11

### Added

- **`chatwoot conv contact` command** — fetch the contact attached to a conversation directly from the conversation id, without a separate contacts lookup ([#10](https://github.com/chatwoot/cli/pull/10)).
- **Version check** — the CLI now checks for newer releases so users know when an update is available.
- **Smarter install script** — detects an existing install, skips the completion prompt on rerun, and uses the `install` command when available ([#11](https://github.com/chatwoot/cli/pull/11)).

### Changed

- Improved CI and tooling: added `govulncheck`, a `go mod tidy` diff check, a coverage task with a sticky PR coverage comment (gated to same-repo PRs), and dependency review for PRs. Bumped GitHub Actions versions and updated the Go toolchain ([#9](https://github.com/chatwoot/cli/pull/9)).
- Removed the bundled `.claude` directory.
- Bumped `github.com/alecthomas/kong` from 1.14.0 to 1.15.0 ([#4](https://github.com/chatwoot/cli/pull/4)).
- Bumped `github.com/getkin/kin-openapi` from 0.133.0 to 0.138.0 ([#8](https://github.com/chatwoot/cli/pull/8)).
- Bumped `golang.org/x/term` from 0.31.0 to 0.43.0 ([#6](https://github.com/chatwoot/cli/pull/6)).

## [0.3.0] - 2026-05-11

### Added

- **Agent skills** — bundled skill definitions for driving the CLI from agent workflows.
- Pinned GoReleaser for reproducible release builds.

### Fixed

- Avoid caching the user id when authenticating from an environment token.
- Prevent account override from persisting across invocations.
- Redact tokens in verbose logs.
- Sanitize untrusted output fields.
- Validate `smoke.sh` base URL against URL userinfo bypass.
- Pin the zsh completion source to the install path.
- Null-delimit the find loop in the mise agents task.
- Drop the project `bin/` from the mise `PATH`.
- Fixed the docs link, spellcheck errors, the Go version, and skill label usage.

## [0.2.0] - 2026-05-08

### Added

- **`version` command** to report the installed CLI version.
- **`whoami` command**, unified with `me` / `auth status`.
- Better shell completions.
- Better install script.
- CI for tests.

### Fixed

- Clean exit when changing directory.
- Handle output writer errors to satisfy `errcheck`.

## [0.1.0] - 2026-05-08

First release. A CLI for Chatwoot that reads and writes the same Chatwoot API your dashboard uses.

### Added

- List conversations, view details, reply, change status, assign, label, and set priority.
- Noun-grammar CLI with id-first verb dispatch and a custom Kong help printer.
- SDK services for conversations, contacts, inboxes, agents, and profile, including conversation writes and subresources.
- Mentions support in private notes, including team mentions.
- Message rendering with pagination and autofetch.
- API keys stored in the OS keyring; hardened auth input and storage.
- Shell completion support.
- Release pipeline and smoke test.
- Pre-built binaries for macOS, Linux (x86_64 + arm64), and Windows.

Install with `curl -fsSL https://chwt.app/install-cli | sh`, then `chatwoot auth login`.

[Unreleased]: https://github.com/chatwoot/cli/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/chatwoot/cli/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/chatwoot/cli/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/chatwoot/cli/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/chatwoot/cli/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/chatwoot/cli/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/chatwoot/cli/releases/tag/v0.1.0
16 changes: 16 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,19 @@ internal/
## Commits

Use conventional commits without scope: `feat:`, `fix:`, `chore:`, `refactor:`, `docs:`

## Releasing

Releases are tag-driven and the GitHub release body comes from `CHANGELOG.md`.

1. Move the relevant items from `## [Unreleased]` into a new `## [x.y.z] - YYYY-MM-DD` section in `CHANGELOG.md`, and add its `[x.y.z]: .../compare/...` link at the bottom. (Follow [Keep a Changelog](https://keepachangelog.com/) / SemVer.)
2. Commit, then push tag `vx.y.z` (must match the changelog version, minus the `v`).
3. The `release` workflow (`.github/workflows/release.yml`) runs tests, extracts that version's section from `CHANGELOG.md` with awk, and passes it to GoReleaser via `--release-notes`. **If no matching section exists, the release fails fast** — so the changelog must be updated before tagging.
4. GoReleaser (`.goreleaser.yml`) builds the cross-platform archives, checksums, and the GitHub release; its own `changelog:` block is only a fallback if `--release-notes` is ever dropped.

Dry run (local goreleaser must be v2; CI pins `2.15.4`):

```bash
go run github.com/goreleaser/goreleaser/v2@v2.15.4 check
go run github.com/goreleaser/goreleaser/v2@v2.15.4 release --snapshot --clean --skip=publish
```
Loading