Summary
lark-cli docs +script --command init-draft creates its generated workspace in the current working directory by default. When the command is run from an existing project or Git repository, this leaves a draft_<id>_folder/ directory in the project root.
The directory is a CLI work area rather than user-authored project content. It contains the Presentation Decision baseline and draft XML, and later document-authoring steps can add diagrams, downloaded media, and preview artifacts. This makes an otherwise clean repository appear dirty and makes it easy to accidentally commit generated files.
Environment
@larksuite/cli: 1.0.96
- macOS arm64
- Command identity:
lark-cli docs +script
Reproduction
From the root of an existing Git repository:
lark-cli docs +script \
--command init-draft \
--presentation-decision '{}' \
--format json
The command creates a workspace matching this pattern in the current directory:
draft_<8-hex-chars>_folder/
└── .presentation-decision.json
The dry-run response also reports:
{
"creates_workspace": true,
"directory_pattern": "draft_*_folder",
"xml_file_name": "draft.xml"
}
Expected behavior
Please consider one of these options:
- Default the generated workspace to the operating system temporary directory, while returning its absolute path in
data.cwd / data.workspace.
- Add an explicit
--work-dir or --output-dir option for callers that need to choose the location.
- Support an environment variable for the default workspace root, with the current-directory behavior as an explicit opt-in.
The workspace should remain persistent for the duration of the document-authoring workflow, but it should not silently pollute the caller's project directory.
Compatibility consideration
The existing returned draft_path and data.cwd contract can remain unchanged. Only the default parent directory would change, so callers that use the returned path should continue to work.
Summary
lark-cli docs +script --command init-draftcreates its generated workspace in the current working directory by default. When the command is run from an existing project or Git repository, this leaves adraft_<id>_folder/directory in the project root.The directory is a CLI work area rather than user-authored project content. It contains the Presentation Decision baseline and draft XML, and later document-authoring steps can add diagrams, downloaded media, and preview artifacts. This makes an otherwise clean repository appear dirty and makes it easy to accidentally commit generated files.
Environment
@larksuite/cli:1.0.96lark-cli docs +scriptReproduction
From the root of an existing Git repository:
lark-cli docs +script \ --command init-draft \ --presentation-decision '{}' \ --format jsonThe command creates a workspace matching this pattern in the current directory:
The dry-run response also reports:
{ "creates_workspace": true, "directory_pattern": "draft_*_folder", "xml_file_name": "draft.xml" }Expected behavior
Please consider one of these options:
data.cwd/data.workspace.--work-diror--output-diroption for callers that need to choose the location.The workspace should remain persistent for the duration of the document-authoring workflow, but it should not silently pollute the caller's project directory.
Compatibility consideration
The existing returned
draft_pathanddata.cwdcontract can remain unchanged. Only the default parent directory would change, so callers that use the returned path should continue to work.