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: shortcuts/doc/docs_create_v2.go
+30-3Lines changed: 30 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@
4
4
package doc
5
5
6
6
import (
7
+
"bytes"
7
8
"context"
9
+
"encoding/xml"
8
10
"strings"
9
11
10
12
"github.com/larksuite/cli/errs"
@@ -14,6 +16,7 @@ import (
14
16
// v2CreateFlags returns the flag definitions for the v2 (OpenAPI) create path.
15
17
funcv2CreateFlags() []common.Flag {
16
18
return []common.Flag{
19
+
{Name: "title", Desc: "document title; when provided, the CLI prepends it to --content as <title>...</title> so the title wins over later content titles"},
17
20
{Name: "content", Desc: "document body; XML by default or Markdown when --doc-format markdown. "+docsContentSkillHelp+"; use --help for the latest command flags", Input: []string{common.File, common.Stdin}},
18
21
{Name: "doc-format", Desc: "content format; xml is default and supports richer DocxXML blocks, markdown imports plain Markdown", Default: "xml", Enum: []string{"xml", "markdown"}},
19
22
{Name: "parent-token", Desc: "parent folder token or wiki node token; mutually exclusive with --parent-position"},
Copy file name to clipboardExpand all lines: tests/cli_e2e/docs/coverage.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,15 @@
10
10
- TestDocs_CreateAndFetchWorkflowAsUser: proves the same shortcut pair with UAT injection via `create as user` and `fetch as user`; creates its own Drive folder fixture first, then reads back the created doc by token.
11
11
- TestDocs_UpdateWorkflow: proves `docs +update` via `update-title-and-content as bot`, then re-fetches the same doc in `verify as bot` to assert persisted title/content changes.
12
12
- TestDocs_DryRunDefaultsToV2OpenAPI: proves `docs +create`, `docs +fetch`, and `docs +update` dry-run all emit `/open-apis/docs_ai/v1/...` requests without MCP or `--api-version` guidance.
13
+
- TestDocs_CreateTitleDryRunPrependsContent: proves `docs +create --title` dry-run prepends an escaped `<title>...</title>` tag to request body `content`.
13
14
- Setup note: docs workflows create a Drive folder through `drive files create_folder` in `helpers_test.go`; that helper is external to the docs domain and is not counted here.
14
15
- Blocked area: media and search shortcuts still need deterministic fixtures and local file orchestration.
15
16
16
17
## Command Table
17
18
18
19
| Status | Cmd | Type | Testcase | Key parameter shapes | Notes / uncovered reason |
19
20
| --- | --- | --- | --- | --- | --- |
20
-
| ✓ | docs +create | shortcut | docs/helpers_test.go::createDocWithRetry; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/create as user; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/create|`--parent-token`; `--doc-format markdown`; `--content`| helper asserts returned doc id from `data.document.document_id`|
21
+
| ✓ | docs +create | shortcut | docs/helpers_test.go::createDocWithRetry; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/create as user; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/create; docs_update_dryrun_test.go::TestDocs_CreateTitleDryRunPrependsContent |`--parent-token`; `--doc-format markdown`; `--content`; `--title`| helper asserts returned doc id from `data.document.document_id`; dry-run asserts title is prepended into request body content|
21
22
| ✓ | docs +fetch | shortcut | docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflow/fetch as bot; docs_update_test.go::TestDocs_UpdateWorkflow/verify as bot; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/fetch as user; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/fetch |`--doc <docToken>`; `--doc-format markdown`||
22
23
| ✕ | docs +media-download | shortcut || none | no media fixture workflow yet |
0 commit comments