Skip to content

Commit 9f621af

Browse files
authored
feat(core): improve robustness of IMAP/SMTP client and add CLI reference doc (#9)
* ci(package): update core workflow * ci(release): clean release template * ci(templates): clean up issue templates * docs(installation): clean up installation instructions * docs(makefile): switch to trusted publishing * docs(reference): add CLI reference * refactor(cli): rename account to accounts * docs(snippet): update code snippets * style(scripts): fix lint * refactor(core): remove duplicate constant * docs(reference): clean up reference * style: fix format * feat(imap): improve imap resolution * test(imap): update tests * docs(providers): clean up docstrings * docs(changelog): update changelog * docs(changelog): fix legacy syntax * ci(package): improve triggers * fix(core): fix legacy import * ci(package): improve CI triggers * ci(package): add reference doc * fix(cli): fix command import * build(deps): remove support for Python 3.10 * fix(core): fix provider resolution * test(core): update test suite * style: fix lint
1 parent 07c1bf8 commit 9f621af

File tree

25 files changed

+1044
-386
lines changed

25 files changed

+1044
-386
lines changed
Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: 🐛 Bug report
22
description: Create a report to help us improve the project
3-
assignees:
4-
3+
labels: ["bug"]
54
body:
65
- type: markdown
76
attributes:
87
value: >
98
#### Before reporting a bug, please check that the issue hasn't already been addressed in [the existing and past issues](https://github.com/relaycli/relay/issues?q=is%3Aissue).
109
- type: textarea
1110
attributes:
12-
label: Bug description
11+
label: Summary
1312
description: |
1413
A clear and concise description of what the bug is.
1514
@@ -23,18 +22,18 @@ body:
2322
attributes:
2423
label: Code snippet to reproduce the bug
2524
description: |
26-
Sample code to reproduce the problem.
25+
Minimal code snippet to reproduce the problem.
2726
2827
Please wrap your code snippet with ```` ```triple quotes blocks``` ```` for readability.
2928
placeholder: |
3029
```python
31-
Sample code to reproduce the problem
30+
Minimal code snippet to reproduce the problem
3231
```
3332
validations:
3433
required: true
3534
- type: textarea
3635
attributes:
37-
label: Error traceback
36+
label: Console output
3837
description: |
3938
The error message you received running the code snippet, with the full traceback.
4039
@@ -45,15 +44,34 @@ body:
4544
```
4645
validations:
4746
required: true
47+
- type: input
48+
attributes:
49+
label: Platform
50+
description: What operating system and architecture are you using? (see `uname -orsm`)
51+
placeholder: e.g., macOS 14 arm64, Windows 11 x86_64, Ubuntu 20.04 amd64
52+
validations:
53+
required: true
54+
- type: input
55+
attributes:
56+
label: Version
57+
description: What version of relaycli are you using? (see `relay version`)
58+
placeholder: e.g., relay 0.0.1
59+
validations:
60+
required: true
61+
- type: input
62+
attributes:
63+
label: Python version
64+
description: What version of Python are you using? (see `python --version`)
65+
placeholder: e.g., Python 3.11.10
66+
validations:
67+
required: false
4868
- type: textarea
4969
attributes:
50-
label: Environment
70+
label: Additional information
5171
description: |
5272
Being able to reproduce the behaviour is key to resolving bugs. Share a few information about your setup:
5373
placeholder: |
54-
- OS: Mac/Windows/Linux
5574
- From source: Y/N
56-
- Release version:
5775
- Commit hash:
5876
validations:
5977
required: true

.github/ISSUE_TEMPLATE/feature_request.yml renamed to .github/ISSUE_TEMPLATE/2_feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 🚀 Feature request
2-
description: Submit a proposal/request for a new feature for the companion API
2+
description: Submit a proposal/request for a new feature for the CLI
33
assignees:
44

55
body:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
blank_issues_enabled: true
22
contact_links:
3+
- name: Documentation
4+
url: https://docs.relaycli.com/
5+
about: Please consult the documentation before creating an issue.
6+
- name: Community
7+
url: https://discord.gg/T4zbT7RcVy
8+
about: Join our Discord community to ask questions and collaborate.
39
- name: Usage questions
410
url: https://github.com/relaycli/relay/discussions
511
about: Ask questions and discuss with other Relay community members

.github/labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@
9090
# CLI-specific
9191
########################################################
9292

93-
'commands: account':
93+
'commands: accounts':
9494
- changed-files:
9595
- any-glob-to-any-file:
9696
- relay/cli/commands/account/*
9797

98-
'commands: auth':
98+
'commands: messages':
9999
- changed-files:
100100
- any-glob-to-any-file:
101-
- relay/cli/commands/auth/*
101+
- relay/cli/commands/messages/*

.github/release.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ changelog:
33
labels:
44
- ignore-for-release
55
categories:
6-
- title: Breaking Changes 🛠
6+
- title: Breaking changes 🛠
77
labels: ["type: breaking change"]
8-
- title: New Features
9-
labels: ["type: feat"]
8+
- title: New features & enhancements
9+
labels: ["type: feat", "type: enhancement"]
1010
- title: Bug Fixes 🐛
1111
labels: ["type: fix"]
12-
- title: Dependencies
13-
labels: ["dependencies"]
1412
- title: Documentation 📖
1513
labels: ["service: docs"]
16-
- title: Improvements
17-
labels: ["type: improvement"]
18-
- title: Other changes
19-
labels: ["*"]
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
name: core
1+
name: package
22

33
on:
44
push:
55
branches: main
66
paths:
7+
- '.github/workflows/package.yml'
78
- 'relay/**'
8-
- 'cli/**'
9+
- 'tests/**'
910
- 'pyproject.toml'
1011
- 'Makefile'
11-
- '.github/workflows/core.yml'
1212
pull_request:
1313
branches: main
1414
paths:
15+
- '.github/workflows/package.yml'
1516
- 'relay/**'
16-
- 'cli/**'
17+
- 'tests/**'
1718
- 'pyproject.toml'
1819
- 'Makefile'
19-
- '.github/workflows/core.yml'
2020
release:
2121
types: [published]
2222

@@ -28,12 +28,16 @@ env:
2828
jobs:
2929
install:
3030
if: github.event_name == 'pull_request'
31-
runs-on: ubuntu-latest
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
matrix:
34+
os: [ubuntu-latest, windows-latest, macos-latest]
35+
python: ['3.11', '3.12', '3.13']
3236
steps:
3337
- uses: actions/checkout@v4
3438
- uses: actions/setup-python@v5
3539
with:
36-
python-version: ${{ env.PYTHON_VERSION }}
40+
python-version: ${{ matrix.python }}
3741
architecture: x64
3842
- uses: astral-sh/setup-uv@v6
3943
with:
@@ -126,13 +130,18 @@ jobs:
126130
fail_ci_if_error: true
127131

128132
build:
129-
if: github.event_name != 'release'
130-
runs-on: ubuntu-latest
133+
if: github.event_name == 'pull_request'
134+
needs: install
135+
runs-on: ${{ matrix.os }}
136+
strategy:
137+
matrix:
138+
os: [ubuntu-latest, windows-latest, macos-latest]
139+
python: ['3.11', '3.12', '3.13']
131140
steps:
132141
- uses: actions/checkout@v4
133142
- uses: actions/setup-python@v5
134143
with:
135-
python-version: ${{ env.PYTHON_VERSION }}
144+
python-version: ${{ matrix.python }}
136145
architecture: x64
137146
- uses: astral-sh/setup-uv@v6
138147
with:
@@ -170,20 +179,21 @@ jobs:
170179
echo "package_version=${BUILD_VERSION}" >> $GITHUB_OUTPUT
171180
echo "BUILD_VERSION=${BUILD_VERSION}" >> $GITHUB_ENV
172181
- name: Publish to PyPI
173-
env:
174-
UV_PUBLISH_USERNAME: __token__
175-
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }}
176182
run: |
177183
make set-version
178184
make build && make publish
179185
180186
verify-publish:
181-
runs-on: ubuntu-latest
187+
runs-on: ${{ matrix.os }}
188+
strategy:
189+
matrix:
190+
os: [ubuntu-latest, windows-latest, macos-latest]
191+
python: ['3.11', '3.12', '3.13']
182192
needs: publish
183193
steps:
184194
- uses: actions/setup-python@v5
185195
with:
186-
python-version: ${{ env.PYTHON_VERSION }}
196+
python-version: ${{ matrix.python }}
187197
architecture: x64
188198
- uses: astral-sh/setup-uv@v6
189199
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ build: ${PYPROJECT_CONFIG_FILE} ## Build the package
6060
uv build ${ENGINE_DIR}
6161

6262
publish: ${ENGINE_DIR} ## Publish the package to PyPI
63-
uv publish
63+
uv publish --trusted-publishing always
6464

6565
lock: ${PYPROJECT_CONFIG_FILE}
6666
uv lock --project ${ENGINE_DIR}

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ Relay helps builds create apps on email workflows. See it as a crossover between
5151
### Fetching your unread emails
5252

5353
```shell
54-
$ relay messages ls --limit 10 --unread
55-
54+
relay messages ls --limit 10 --unread
55+
```
56+
```
5657
Using account: piedpiper
5758
Messages from [email protected]
5859
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
@@ -80,8 +81,9 @@ Showing 5 of 5 unread messages
8081
### Reading email details
8182

8283
```shell
83-
$ relay messages cat 15443
84-
84+
relay messages cat 15443
85+
```
86+
```
8587
Using account: piedpiper
8688
8789
Message Details
@@ -96,7 +98,7 @@ BCC: N/A
9698
Message Body:
9799
The migration is done. Obviously.
98100
99-
While you were all probably panicking about downtime (which never happened),
101+
While you were all probably panicking about downtime (which never happened),
100102
I successfully migrated our entire server infrastructure to the new data center.
101103
102104
Key accomplishments:
@@ -105,13 +107,13 @@ Key accomplishments:
105107
- Optimized database queries by 340%
106108
- Fixed 23 security vulnerabilities
107109
108-
Richard, the system is now running at 99.97% efficiency. The remaining 0.03%
110+
Richard, the system is now running at 99.97% efficiency. The remaining 0.03%
109111
is due to the laws of physics, which even I cannot override.
110112
111-
Dinesh, I've documented everything in a way that even you might comprehend,
113+
Dinesh, I've documented everything in a way that even you might comprehend,
112114
though I make no guarantees.
113115
114-
The servers are purring like a well-fed cat. You may now return to your
116+
The servers are purring like a well-fed cat. You may now return to your
115117
regularly scheduled mediocrity.
116118
117119
--
@@ -137,15 +139,16 @@ pip install relaycli
137139
```
138140
#### 2 - Connect your email account
139141
```shell
140-
relay account add
142+
relay accounts add
141143
```
142144
Follow the instructions to connect your email account.
143145

144146
#### 3 - Play with the CLI
145147

146148
```shell
147-
$ relay messages --help
148-
149+
relay messages --help
150+
```
151+
```
149152
Usage: relay messages [OPTIONS] COMMAND [ARGS]...
150153
151154
Email message commands

docs/changelog/overview.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The changelog below reflects new product developments and updates on a monthly b
1313

1414
### 🔧 CLI Commands
1515

16-
* `relay account add` - Connect your email accounts (Gmail, Outlook, Yahoo, custom IMAP)
17-
* `relay account ls` - List all connected accounts
16+
* `relay accounts add` - Connect your email accounts (Gmail, Outlook, Yahoo, custom IMAP)
17+
* `relay accounts ls` - List all connected accounts
1818
* `relay messages ls` - Fetch and list recent emails
1919
* `relay messages grep` - Search your inbox with powerful text matching
2020
* `relay messages cat` - Read full message content and metadata
@@ -40,6 +40,6 @@ The changelog below reflects new product developments and updates on a monthly b
4040

4141
### 🚀 Getting Started
4242

43-
Install with `pip install relaycli` and run `relay account add` to connect your first inbox.
43+
Install with `pip install relaycli` and run `relay accounts add` to connect your first inbox.
4444
Check out our [quickstart guide](/documentation/getting-started/quickstart) for a 5-minute setup walkthrough.
4545
</Update>

docs/docs.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@
3636
}
3737
]
3838
},
39+
{
40+
"tab": "Reference",
41+
"groups": [
42+
{
43+
"group": "CLI reference",
44+
"pages": [
45+
"reference/cli/accounts",
46+
"reference/cli/messages"
47+
]
48+
}
49+
]
50+
},
3951
{
4052
"tab": "Changelog",
4153
"groups": [
@@ -76,8 +88,9 @@
7688
"navbar": {
7789
"links": [
7890
{
79-
"label": "Support",
80-
"href": "mailto:[email protected]"
91+
"label": "Community",
92+
"icon": "discord",
93+
"href": "https://discord.gg/T4zbT7RcVy"
8194
}
8295
],
8396
"primary": {

0 commit comments

Comments
 (0)