@openctx/provider-google-docs
v0.0.17
Published
Google Docs context for code AI and editors (OpenCtx provider)
Downloads
128
Readme
Google Docs context provider for OpenCtx
This is a context provider for OpenCtx that brings Google Docs context to code AI and editors. Only items, not annotations, are supported.
Status: experimental
Configuration for Sourcegraph teammates
- Find "OpenCtx Google Docs provider config" in 1Password and follow instructions from there.
Configuration outside of Sourcegraph
To create Google Drive/Docs API credentials:
- Enable the following services in your Google Cloud project:
gcloud services enable drive.googleapis.com docs.googleapis.com
- Configure the OAuth consent screen (only a name and email addresses are required)
- Create a new OAuth client ID (select "Desktop app" as the application type)
- Save the credentials JSON file (
client_secret_xxx.apps.googleusercontent.json
) - Obtain an access token for your Google Drive user account: run
GOOGLE_OAUTH_CLIENT_FILE=path/to/client_secret_xxx.apps.googleusercontent.json pnpm run google-auth
and continue in your web browser
Then use the following OpenCtx provider configuration:
"openctx.providers": {
// ...other providers...
"https://openctx.org/npm/@openctx/provider-google-docs": {
"googleOAuthClient": {
"client_id": "XXX",
"client_secret": "XXX",
"redirect_uris": ["http://localhost"]
},
"googleOAuthCredentials": {
"refresh_token": "XXX",
"access_token": "XXX",
"expiry_date": "XXX",
}
}
},
Development
- Source code
- Docs
- License: Apache 2.0