Skip to content

Commit 24c879f

Browse files
committed
docs: add internal release process docs
1 parent 5e2d3fd commit 24c879f

2 files changed

Lines changed: 226 additions & 0 deletions

File tree

README.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# HeyGen CLI
2+
3+
A Go CLI wrapping HeyGen's v3 API. Auto-generated from our OpenAPI spec. Single
4+
binary, JSON-first output.
5+
6+
## Install
7+
8+
### Internal dev build (recommended for internal users)
9+
10+
If `gh` is installed and authenticated:
11+
12+
```bash
13+
gh api repos/heygen-com/heygen-cli/contents/scripts/install.sh \
14+
--jq '.content' | base64 -d | bash
15+
```
16+
17+
If you want to use a token directly:
18+
19+
```bash
20+
curl -fsSL \
21+
-H "Authorization: Bearer $GITHUB_TOKEN" \
22+
-H "Accept: application/vnd.github.raw" \
23+
https://api.github.com/repos/heygen-com/heygen-cli/contents/scripts/install.sh \
24+
| bash
25+
```
26+
27+
This installs the latest internal dev build from the rolling `dev` prerelease
28+
into `~/.local/bin` by default.
29+
30+
### From source (contributors)
31+
32+
Requires Go 1.23+.
33+
34+
```bash
35+
git clone git@github.com:heygen-com/heygen-cli.git
36+
cd heygen-cli
37+
make install
38+
```
39+
40+
This installs `heygen` to your `$GOPATH/bin` (typically `~/go/bin`).
41+
42+
### Manual release download
43+
44+
Download the binary for your platform from
45+
[Releases](https://github.com/heygen-com/heygen-cli/releases) and put it in
46+
your `PATH`.
47+
48+
For this internal repository, users still need GitHub read access to download
49+
release assets. See [RELEASE.md](./RELEASE.md) for the maintainer release
50+
process and internal dev-release workflow.
51+
52+
## Setup
53+
54+
Authenticate with your HeyGen API key:
55+
56+
```bash
57+
heygen auth login
58+
59+
# Or non-interactively
60+
echo "$HEYGEN_API_KEY" | heygen auth login
61+
```
62+
63+
The key is stored in `~/.heygen/credentials`. You can also use the
64+
`HEYGEN_API_KEY` environment variable (takes precedence over the stored key).
65+
66+
## Usage
67+
68+
```bash
69+
heygen video list --limit 10
70+
heygen video get <video-id>
71+
heygen video create --avatar-id josh_lite --script "Hello world" --voice-id en_male
72+
heygen avatar list
73+
heygen voice list --type public
74+
heygen video list --limit 10 --human
75+
```
76+
77+
Every command supports `--help`:
78+
79+
```bash
80+
heygen --help # show all groups
81+
heygen video --help # show video commands
82+
heygen video-agent --help # show flattened nested task help
83+
heygen webhook --help # show flattened endpoint/event help
84+
```
85+
86+
### Complex request bodies
87+
88+
For endpoints with complex input (nested objects, unions), use `-d` to pass raw
89+
JSON:
90+
91+
```bash
92+
heygen video-translate create -d '{"video": {"type": "url", "url": "https://..."}, "output_languages": ["es"]}'
93+
94+
# Or from a file
95+
heygen video-translate create -d request.json
96+
97+
# Or from stdin
98+
cat request.json | heygen video-translate create -d -
99+
```
100+
101+
Flags and `-d` can be combined. Flags override fields in the JSON body.
102+
103+
## Output modes
104+
105+
The CLI defaults to JSON output, which is the best mode for scripts and agents:
106+
107+
```bash
108+
heygen video get <video-id>
109+
```
110+
111+
For human-readable tables and key/value views, add `--human`:
112+
113+
```bash
114+
heygen video list --limit 10 --human
115+
heygen webhook --help
116+
```
117+
118+
## Build & Test
119+
120+
```bash
121+
make build # build to bin/heygen
122+
make install # install to $GOPATH/bin/heygen
123+
make test # run all tests (mocked, no API key needed)
124+
make lint # golangci-lint
125+
make clean # remove build artifacts
126+
```
127+
128+
## Regenerate commands from OpenAPI spec
129+
130+
```bash
131+
make generate SPEC=/path/to/external-api.json
132+
```
133+
134+
This reads the OpenAPI spec, generates command definitions in `gen/`, and
135+
formats the output. Generated files should be committed.

RELEASE.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Release Process
2+
3+
## Install the CLI
4+
5+
### Internal dev build
6+
7+
Recommended for internal users who do not want to build from source.
8+
9+
If `gh` is installed and authenticated:
10+
11+
```bash
12+
gh api repos/heygen-com/heygen-cli/contents/scripts/install.sh \
13+
--jq '.content' | base64 -d | bash
14+
```
15+
16+
If you want to use a token directly:
17+
18+
```bash
19+
curl -fsSL \
20+
-H "Authorization: Bearer $GITHUB_TOKEN" \
21+
-H "Accept: application/vnd.github.raw" \
22+
https://api.github.com/repos/heygen-com/heygen-cli/contents/scripts/install.sh \
23+
| bash
24+
```
25+
26+
The installer downloads the latest internal dev build from the rolling `dev`
27+
prerelease and installs `heygen` into `~/.local/bin` by default.
28+
29+
### Manual download
30+
31+
1. Open the repo's Releases page.
32+
2. Find the `Internal Dev Build` prerelease.
33+
3. Download the archive for your platform.
34+
4. Extract the archive and move `heygen` into your `PATH`.
35+
36+
### From source
37+
38+
For contributors with Go installed:
39+
40+
```bash
41+
git clone git@github.com:heygen-com/heygen-cli.git
42+
cd heygen-cli
43+
make install
44+
```
45+
46+
## Release Types
47+
48+
### Dev builds
49+
50+
- Rolling prerelease tagged `dev`
51+
- Built from `main`
52+
- Version format: `dev-<sha>`
53+
- Intended for internal users and fast feedback
54+
55+
### Stable releases
56+
57+
- Immutable tagged releases like `v0.1.0`
58+
- Built from a tagged commit via GoReleaser
59+
- Intended for milestone cuts and broader distribution later
60+
61+
## How to Cut a Dev Release
62+
63+
1. Make sure `main` is in a good state.
64+
2. Trigger the GitHub Actions workflow:
65+
66+
```bash
67+
gh workflow run dev-release.yml
68+
```
69+
70+
3. Wait for the workflow to finish.
71+
4. Verify the `Internal Dev Build` prerelease was updated with the latest commit
72+
SHA.
73+
5. Share the installer command or release link with internal users as needed.
74+
75+
## How to Cut a Stable Release
76+
77+
1. Make sure `main` is ready for a stable cut.
78+
2. Tag and push:
79+
80+
```bash
81+
git tag v0.1.0
82+
git push --tags
83+
```
84+
85+
3. The tag-based release workflow publishes the stable release artifacts.
86+
87+
## Version Scheme
88+
89+
- `dev-<sha>` for rolling internal builds
90+
- `v0.x.y` for pre-1.0 stable releases
91+
- `v1.x.y` and beyond once the CLI surface is considered stable

0 commit comments

Comments
 (0)