ソース情報
- リポジトリ
- waf/gdoc-control
- ソースの最終更新活動
- 2026年3月4日 10:25
- 検出された SKILL.md の言語
- 英語
- スター
- 0
- フォーク
- 0
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/waf/gdoc-control --skill gdoc-controlコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SOC 職業分類に基づく
SKILL.md を表示中
| name | gdoc-control |
| description | Command Line Tool for retrieving, creating, and editing Google Docs. |
A command-line tool for reading and writing Google Docs. All output is JSON on stdout. Errors are JSON on stderr with a non-zero exit code.
Invocation: gdoc-control <command> [args]
gdoc-control search <query> [--limit <n>]
query — full-text search string (searches document content and title)--limit — max results, default 10Output:
{
"files": [
{
"id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
"name": "Q3 Status Report",
"modifiedTime": "2024-11-01T14:32:00.000Z",
"url": "https://docs.google.com/document/d/1BxiM.../edit"
}
]
}
gdoc-control get <document-id>
gdoc-control get <document-id> --structured
body is extracted plain text with headings prefixed #, ##, etc.--structured: body is the raw Google Docs API body JSON (includes character indices — use this when you need precise locations for editing, not for normal reading).Output (default):
{
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
"title": "Q3 Status Report",
"revisionId": "AOV_f48abc123...",
"body": "# Q3 Status Report\nSome intro text.\n\n## Status\nAll good.\n\n## Next Steps\nDo things."
}
Important: The revisionId is used by the update commands for optimistic concurrency. You do not need to pass it manually — the update commands fetch it automatically. It is shown in get output for informational purposes.
gdoc-control create <title> --content <markdown>
gdoc-control create <title> --stdin # read markdown from stdin
Markdown is converted to HTML via Markdig (advanced extensions enabled), then uploaded to Google Drive as a Google Doc.
Output:
{
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
"title": "My New Doc",
"url": "https://docs.google.com/document/d/1BxiM.../edit"
}
gdoc-control update append <document-id> --text <text>
Appends a newline followed by text at the very end of the document body.
Output:
{
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
"revisionId": "AOV_f48def456..."
}
gdoc-control update replace-text <document-id> --search <text> --replacement <text>
--search with --replacement across the entire document.Output: same shape as append.
gdoc-control update replace-section <document-id> --heading <heading> --content <text>
gdoc-control update replace-section <document-id> --heading <heading> --stdin
--heading (case-sensitive, trimmed).--content in its place.Output: same shape as append.
All errors are written to stderr with exit code 1:
{ "error": "Concurrent edit conflict — re-read the document and retry", "status": 412 }
{ "error": "Heading not found: \"Status\"" }
{ "error": "The caller does not have permission", "status": 403 }
Use get to read content. The plain-text body field uses markdown-style heading markers (#, ##, etc.) so you can identify sections by name for use with replace-section.
All update commands internally call get first to fetch the current revisionId, then submit the edit with WriteControl.RequiredRevisionId. If someone else edits the document between the read and write, the API returns 412 and the write is rejected — nothing is silently overwritten.
On a 412 error: retry the entire operation (re-read, then re-apply the edit).
search output: use the id field.https://docs.google.com/document/d/<ID>/edit — the <ID> segment.Run get first. The heading text to pass to --heading is the heading line from body without the # prefix. For example, if body contains ## Next Steps, pass --heading "Next Steps".
Use --stdin and pipe text in, or use shell $'...' syntax for embedded newlines. Example:
printf "Line one\nLine two\n" | gdoc-control update append <id> --stdin
(Note: append does not have --stdin; use replace-section --stdin or create --stdin for multi-line content. For append, embed \n directly in the --text value.)