-
Notifications
You must be signed in to change notification settings - Fork 2
feat: profiles list/use, attributed auth errors, init target naming, mail list #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,6 +149,14 @@ After creating the OAuth credentials in step 2 (or 3), run: | |
| gro init | ||
| ``` | ||
|
|
||
| Before touching anything, init names the profile (and account) it is about to | ||
| (re)authenticate. To add ANOTHER Google account later without overwriting the | ||
| first one, authenticate it as a new named profile: | ||
|
|
||
| ```bash | ||
| gro init --profile work | ||
| ``` | ||
|
|
||
| The wizard will: | ||
|
|
||
| 1. **Ingest credentials.json.** Pick one of three options when prompted: | ||
|
|
@@ -255,6 +263,16 @@ gro me --id | |
| gro me --extended | ||
|
|
||
|
|
||
| # List credential profiles (accounts) and their token state | ||
| gro profiles list | ||
| gro profiles list --check # live-verify each token | ||
|
|
||
| # Switch the active profile | ||
| gro profiles use work | ||
|
|
||
| # Add another account as a new named profile | ||
| gro init --profile work | ||
|
|
||
| # Check configuration status | ||
| gro config show | ||
|
|
||
|
|
@@ -277,6 +295,11 @@ gro -v <command> | |
| All Gmail commands are under `gro mail`: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File-level note: README.md The PR's stated purpose is to expose Reply inline to this comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File-level note: README.md The PR dossier states Reply inline to this comment. |
||
|
|
||
| ```bash | ||
| # List recent inbox messages | ||
| gro mail list | ||
| gro mail list --max 25 | ||
| gro mail list --ids # Output IDs only (for piping) | ||
|
|
||
| # Search messages | ||
| gro mail search "is:unread" | ||
| gro mail search "from:someone@example.com" --max 20 | ||
|
|
@@ -509,6 +532,7 @@ Flags: | |
| --credentials-file string Path to a downloaded OAuth client JSON (bypasses the wizard) | ||
| --no-browser Don't try to open the consent URL in a browser | ||
| --no-verify Skip connectivity verification after setup | ||
| --profile string Authenticate a NEW named profile (stored as google-readonly/<name>) without touching the active profile | ||
| ``` | ||
|
|
||
| ### gro me | ||
|
|
@@ -523,6 +547,32 @@ Flags: | |
| --extended Add granted scopes, token expiry, and storage backend | ||
| ``` | ||
|
|
||
| ### gro profiles list | ||
|
|
||
| List every credential profile stored in the OS keyring: the account email each | ||
| holds (as last verified), whether a token is present, and which profile is | ||
| active (marked `*`, with where the selection came from). | ||
|
|
||
| ``` | ||
| Usage: gro profiles list [flags] | ||
|
|
||
| Flags: | ||
| -j, --json Emit JSON | ||
| --check Live-verify each profile's token against the API | ||
| (ok / expired or revoked / error, one API call per profile) | ||
| ``` | ||
|
|
||
| ### gro profiles use | ||
|
|
||
| Switch the active profile (writes `credential_ref` in `config.yml`). Accepts a | ||
| bare profile name or a full `google-readonly/<profile>` ref. Never touches | ||
| stored tokens; switching to a profile with no token warns and points at | ||
| `gro init`. | ||
|
|
||
| ``` | ||
| Usage: gro profiles use <profile> | ||
| ``` | ||
|
|
||
| ### gro config show | ||
|
|
||
| Display current configuration status including credentials and token. | ||
|
|
@@ -549,6 +599,18 @@ removed without removing anything. | |
| Usage: gro config clear [--all] [--dry-run] | ||
| ``` | ||
|
|
||
| ### gro mail list | ||
|
|
||
| List the most recent inbox messages (equivalent to `gro mail search "in:inbox"`). | ||
|
|
||
| ``` | ||
| Usage: gro mail list [flags] | ||
|
|
||
| Flags: | ||
| -m, --max int Maximum number of results (default 10) | ||
| --ids Output only message IDs (one per line, for piping) | ||
| ``` | ||
|
|
||
| ### gro mail search | ||
|
|
||
| Search for Gmail messages using Gmail's search syntax. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File-level note: README.md
The two prior review threads about missing
gro profilesdocs are resolved in this diff:--profileis now listed undergro initflags, andgro profiles list/gro profiles useare documented in both the Configuration Commands quick reference and the Command Reference. One gap remains: the top-level Features section (unchanged by this diff) still doesn't mention the profiles UX, even though the PR's stated purpose is discoverability of profile/token state. Consider adding a short Features bullet (e.g. alongside 'Secure storage') pointing atgro profiles list --check.Reply inline to this comment.