makecindy / makecindy/cindy

feat(feishu): support creating docx under Drive folder_token

Open
#201 2 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: zhanghaomin
**客户端版本**: 0.1.6

---

## Background

The current Feishu plugin supports reading existing Feishu docx documents and writing document blocks, but it does not expose a capability to create a new Feishu docx document under a specified Drive folder.

This prevents automation flows from fully covering the common publishing path: generate content -> create document -> write content -> return document link.

## Requested Capability

Add a tool:

`docx_create_in_folder`

Parameters:

```json
{
"folder_token": "string",
"title": "string"
}
```

Return value:

```json
{
"document_id": "string",
"document_url": "string",
"folder_token": "string",
"title": "string"
}
```

## Implementation Suggestion

Call Feishu OpenAPI:

`POST /open-apis/docx/v1/documents`

Request body:

```json
{
"folder_token": "...",
"title": "..."
}
```

This capability should use `user_access_token`, because the target folder is typically a normal Drive folder where the current user has permission. It should not rely on `tenant_access_token` as a substitute, since that only covers resources available to the app itself.

After creation succeeds, existing docx block writing tools can be reused to append or update the document body.

## Permission Requirements

The Feishu OAuth app may need the relevant scope for creating new docx documents.

## Acceptance Criteria

- Given a `folder_token` where the current user has edit/create permission
- Calling `docx_create_in_folder(folder_token, title)` creates a new Feishu docx document in that Drive folder
- The tool returns a usable `document_id` and `document_url`
- The returned `document_id` can be passed to the existing docx writing tools
---
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start from the existing docx block-writing tools and the Feishu OpenAPI integration. Add the docx_create_in_folder entry point using POST /open-apis/docx/v1/documents with user_access_token, then verify that a permitted folder produces the requested document_id and document_url and that the ID works with existing writing tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.