Skip to content

Commit ca69460

Browse files
committed
update cli usage docs
1 parent 7066a23 commit ca69460

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,29 @@ When using Login Only mode:
102102
### Quick Start
103103
```bash
104104
# Basic execution
105-
python main.py
105+
attend
106106

107107
# View statistics
108-
python main.py --stats
108+
attend stats
109109

110110
# Refresh login session
111-
python main.py --login-only
111+
attend login
112112

113113
# Run specific week
114-
python main.py --week 4
114+
attend week 4
115115

116116
# Show browser (headed mode)
117-
python main.py --headed
117+
attend --headed
118118
```
119119

120+
Install from PyPI:
121+
```bash
122+
pip install always-attend
123+
attend --help
124+
```
125+
126+
`python main.py` remains available as a compatibility launcher inside the repository checkout.
127+
120128
## 🧰 CLI Environment Setup
121129

122130
### Option A — uv (recommended)
@@ -140,18 +148,18 @@ Why uv?
140148
```
141149
4. Launch the CLI (examples):
142150
```bash
143-
uv run python main.py --dry-run
144-
uv run python main.py --login-only
151+
uv run attend --dry-run
152+
uv run attend login
145153
```
146154

147155
### Option B — Standard venv + pip
148156
```bash
149157
python3 -m venv .venv
150158
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
151159
pip install -U pip
152-
pip install -r requirements.txt
160+
pip install -e .
153161
python -m playwright install chromium
154-
python main.py
162+
attend
155163
```
156164

157165
What the launchers do:
@@ -194,7 +202,7 @@ The tool now automatically tracks your attendance submission statistics:
194202

195203
```bash
196204
# View detailed statistics
197-
python main.py --stats
205+
attend stats
198206

199207
# Or use the stats module directly
200208
python stats.py
@@ -226,10 +234,10 @@ Always Attend ships with a polished terminal UI powered by [Rich](https://github
226234

227235
```bash
228236
# Full experience: animated banner, live block progress
229-
CLI_STYLE=fancy CLI_PROGRESS_RICH=1 python main.py --dry-run
237+
CLI_STYLE=fancy CLI_PROGRESS_RICH=1 attend --dry-run
230238

231239
# Quiet fallback suitable for basic terminals
232-
CLI_STYLE=minimal CLI_PROGRESS_RICH=0 python main.py
240+
CLI_STYLE=minimal CLI_PROGRESS_RICH=0 attend
233241
```
234242

235243
Set these in your `.env` to persist the chosen style across runs.
@@ -249,7 +257,7 @@ Set these in your `.env` to persist the chosen style across runs.
249257

250258
## Command-Line Arguments
251259

252-
main.py
260+
Primary command: `attend`
253261

254262
| Argument | Type | Description | Example |
255263
| --- | --- | --- | --- |
@@ -265,6 +273,12 @@ main.py
265273
| `--verbose` | flag | Enable verbose logging profile | `--verbose` |
266274
| `--skip-update` | flag | Skip the git update check before running | `--skip-update` |
267275

276+
## Release Automation
277+
278+
- Push a version tag such as `v0.1.0` to trigger `.github/workflows/release.yml`.
279+
- The workflow validates that the tag matches `pyproject.toml`, builds `sdist` and `wheel`, creates a GitHub Release, and publishes to PyPI.
280+
- PyPI publishing is configured for Trusted Publishing, so the GitHub repository still needs to be registered as a trusted publisher in the target PyPI project.
281+
268282
## Environment Variables
269283

270284
| Variable | Type | Required | Description | Example |

README_zh.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,17 @@ sed -i 's/^PORTAL_URL=.*/PORTAL_URL="https:\/\/your.portal.url"/' .env
164164

165165
5) 快速开始(Quick Start)
166166
```bash
167-
python main.py
167+
attend
168+
```
169+
170+
如果直接从 PyPI 安装:
171+
```bash
172+
pip install always-attend
173+
attend --help
168174
```
169175

176+
仓库内的 `python main.py` 仍然保留,作为兼容入口。
177+
170178
## 🧰 CLI 环境准备
171179

172180
### 方案 A —— 使用 uv(推荐)
@@ -190,18 +198,18 @@ python main.py
190198
```
191199
4. 之后可通过 `uv run …` 执行脚本,例如:
192200
```bash
193-
uv run python main.py --dry-run
194-
uv run python main.py --login-only
201+
uv run attend --dry-run
202+
uv run attend login
195203
```
196204

197205
### 方案 B —— 标准 venv + pip
198206
```bash
199207
python3 -m venv .venv
200208
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
201209
pip install -U pip
202-
pip install -r requirements.txt
210+
pip install -e .
203211
python -m playwright install chromium
204-
python main.py
212+
attend
205213
```
206214

207215
运行后会发生什么:

0 commit comments

Comments
 (0)