Skip to content

Commit feab78e

Browse files
committed
docs: update README with install instructions (Homebrew, AUR, Go) and simplified setup
1 parent 5515bc8 commit feab78e

1 file changed

Lines changed: 59 additions & 18 deletions

File tree

README.md

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,54 +129,95 @@ Sending from `personal` to `colleague@company.com` will be blocked with a sugges
129129

130130
## Setup
131131

132-
### 1. Register an Azure AD App
132+
### 1. Add an Account
133133

134-
1. [Azure Portal](https://portal.azure.com) → App registrations → New registration
135-
2. Supported account types: "Accounts in any organizational directory and personal Microsoft accounts"
136-
3. Enable "Allow public client flows" under Authentication
137-
4. Add delegated API permissions: `Calendars.ReadWrite`, `Contacts.ReadWrite`, `User.Read`, `Mail.Send` (optional)
134+
Interactive setup (guided TUI):
135+
```bash
136+
md365 auth add -i
137+
```
138+
139+
Or non-interactive (AI-friendly):
140+
```bash
141+
md365 auth add --name work --hint you@company.com \
142+
--scopes "Calendars.ReadWrite,Contacts.ReadWrite,User.Read,Mail.Send" \
143+
--domains "company.com" --login
144+
```
145+
146+
md365 ships with a built-in app registration — no Azure setup needed. If your tenant requires a custom app, you can set `client_id` per account in the config.
147+
148+
### 2. Login and Sync
149+
150+
```bash
151+
md365 auth login --account work
152+
md365 sync
153+
```
154+
155+
### Auth Flows
156+
157+
Most tenants work with the default **Device Code Flow**. If your tenant blocks it (Conditional Access), use **Authorization Code Flow with PKCE**:
158+
159+
```yaml
160+
accounts:
161+
work:
162+
auth_flow: authcode # opens browser instead of device code
163+
hint: you@company.com
164+
scope: "offline_access Calendars.ReadWrite User.Read"
165+
```
138166

139-
### 2. Configure
167+
### Configuration
140168

141-
Create `~/.config/md365/config.yaml`:
169+
Config lives at `~/.config/md365/config.yaml`:
142170

143171
```yaml
144172
accounts:
145173
work:
146-
client_id: "YOUR_APP_CLIENT_ID"
147174
hint: "you@company.com"
148175
scope: "offline_access Calendars.ReadWrite Contacts.ReadWrite User.Read Mail.Send"
149176
domains:
150177
- company.com
151178
personal:
152-
client_id: "YOUR_APP_CLIENT_ID"
153179
hint: "you@outlook.com"
154180
scope: "offline_access Calendars.ReadWrite Contacts.ReadWrite User.Read"
155181
domains:
156182
- gmail.com
157183
```
158184

159-
You can use the same or different `client_id` per account.
185+
## Token Storage
160186

161-
### 3. Login and sync
187+
Tokens are stored exclusively in the system keyring (gnome-keyring, macOS Keychain, Windows Credential Manager). A running keyring daemon is required — no file fallback.
188+
189+
The `offline_access` scope enables refresh tokens, so you only need to log in once per account. Tokens refresh automatically on use and remain valid for up to 90 days of inactivity.
190+
191+
## Installation
192+
193+
### Homebrew (macOS & Linux)
162194

163195
```bash
164-
md365 auth login --account work
165-
md365 sync
196+
brew install lcorneliussen/md365/md365
166197
```
167198

168-
## Token Storage
199+
### AUR (Arch Linux)
169200

170-
Tokens are stored exclusively in the system keyring (gnome-keyring, macOS Keychain, Windows Credential Manager). A running keyring daemon is required — no file fallback.
201+
```bash
202+
yay -S md365-bin
203+
```
171204

172-
The `offline_access` scope enables refresh tokens, so you only need to log in once per account. Tokens refresh automatically on use and remain valid for up to 90 days of inactivity.
205+
### Go Install
173206

174-
## Installation
207+
```bash
208+
go install github.com/lcorneliussen/md365@latest
209+
```
210+
211+
### GitHub Releases
212+
213+
Download pre-built binaries for Linux, macOS, and Windows from [Releases](https://github.com/lcorneliussen/md365/releases).
214+
215+
### Build from Source
175216

176217
```bash
177218
git clone https://github.com/lcorneliussen/md365.git
178219
cd md365
179-
go build -o ~/.local/bin/md365 .
220+
go build -o md365 .
180221
```
181222

182223
## Sync Details

0 commit comments

Comments
 (0)