You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/Configuration.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,3 +102,7 @@ Cache files are automatically refreshed from the server on each app launch and m
102
102
All data files can optionally be encrypted with a password. See [Encryption](/docs/Features/Encryption) for details.
103
103
104
104
When encryption is enabled, account passwords are stored inside the encrypted `config.json` instead of the OS keyring.
105
+
106
+
## Password Command
107
+
108
+
Instead of storing a password in the OS keyring, you can set `pass_cmd` on an account to have matcha fetch the password from an external command (e.g. `pass`, `gopass`, or an age script). See [Password Command](/docs/Features/PassCmd) for details.
Matcha can fetch your account password from an external command rather than the OS keyring. This lets you integrate any CLI-based password manager — [pass](https://www.passwordstore.org/), [gopass](https://github.com/gopasspw/gopass), [age](https://github.com/FiloSottile/age) scripts, or any tool that prints a password to stdout.
4
+
5
+
This is the same pattern used by [isync (`PassCmd`)](https://isync.sourceforge.io/mbsync.html) and [msmtp (`passwordeval`)](https://marlam.de/msmtp/msmtp.html).
6
+
7
+
## Configuration
8
+
9
+
Add `pass_cmd` to an account in `~/.config/matcha/config.json`:
10
+
11
+
```json
12
+
{
13
+
"accounts": [
14
+
{
15
+
"id": "unique-id-1",
16
+
"name": "John Doe",
17
+
"email": "john@example.com",
18
+
"service_provider": "custom",
19
+
"imap_server": "imap.example.com",
20
+
"smtp_server": "smtp.example.com",
21
+
"pass_cmd": "pass show email/john@example.com"
22
+
}
23
+
]
24
+
}
25
+
```
26
+
27
+
Matcha runs the command via `sh -c` at startup and uses its stdout (trailing newlines stripped) as the password. The password is never written to `config.json` or the OS keyring.
28
+
29
+
## Examples
30
+
31
+
### pass / gopass
32
+
33
+
```json
34
+
"pass_cmd": "pass show email/john@example.com"
35
+
```
36
+
37
+
```json
38
+
"pass_cmd": "gopass show -o email/john@example.com"
The command can be anything that exits `0` and prints the password to stdout.
54
+
55
+
## Notes
56
+
57
+
-**Priority**: `pass_cmd` takes precedence over both the OS keyring and any password stored in a secure (encrypted) config. If `pass_cmd` is set, no other source is consulted.
58
+
-**Errors**: If the command exits non-zero or cannot be found, matcha logs the error and continues with an empty password, which will cause authentication to fail. Check the command works in a shell before adding it to your config.
59
+
-**Encryption compatibility**: `pass_cmd` works alongside [Encryption](/docs/Features/Encryption). The command is stored in the encrypted config, and the resolved password is never written to disk.
0 commit comments