{"id":17478,"library":"tdesign-publish-cli","title":"TDesign Publish CLI","description":"tdesign-publish-cli is a command-line interface tool designed to streamline the release process for JavaScript projects, particularly those adhering to Conventional Commits. It automates the generation of changelogs based on Git commit history, leveraging `standard-changelog`. Furthermore, it can create formatted messages for enterprise communication platforms like WeChat Work (WeCom) robots, supporting both release log notifications and instant recognition messages. The current stable version is `0.0.12`, indicating it's still in early development, and its release cadence is likely irregular as features are added and refined. Its key differentiator is the integrated robot message generation tailored for Chinese enterprise platforms, which goes beyond standard changelog tools.","status":"active","version":"0.0.12","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","changelog","robot message"],"install":[{"cmd":"npm install tdesign-publish-cli","lang":"bash","label":"npm"},{"cmd":"yarn add tdesign-publish-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add tdesign-publish-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for generating changelogs from git commits.","package":"standard-changelog","optional":false},{"reason":"Recommended optional dependency for enforcing commit message standards via Git hooks.","package":"husky","optional":true},{"reason":"Recommended optional dependency for interactive Conventional Commits message creation.","package":"cz-conventional-changelog","optional":true}],"imports":[{"note":"Invoke the changelog command to generate a `CHANGELOG.md` file based on Conventional Commits.","wrong":"node tdesign-publish-cli changelog","symbol":"tdesign-publish-cli changelog","correct":"npx tdesign-publish-cli changelog"},{"note":"Use this command to generate robot notification messages for WeChat Work (WeCom) based on changelog content or instant recognition templates.","symbol":"tdesign-publish-cli robot","correct":"npx tdesign-publish-cli robot"},{"note":"Get help for a specific command. Global `--help` might not be as detailed.","wrong":"tdesign-publish-cli --help","symbol":"tdesign-publish-cli help","correct":"npx tdesign-publish-cli help changelog"}],"quickstart":{"code":"npm i -D tdesign-publish-cli\n\n# Ensure your project uses Conventional Commits, e.g., via commitlint and husky\n# For initial changelog generation, ensure you have git tags (e.g., v1.0.0)\n\n# Generate CHANGELOG.md\nnpx tdesign-publish-cli changelog\n\n# Generate a robot message for a release (reads from CHANGELOG.md)\nnpx tdesign-publish-cli robot\n\n# After running 'robot', a robotMsg.json file will be created.\n# Example for sending the message using curl (replace with your webhook URL):\n# cat robotMsg.json | curl -X POST -H 'Content-Type: application/json' -d @- \"${PROCESS_ENV_WECOM_WEBHOOK_URL ?? ''}\"","lang":"bash","description":"This quickstart demonstrates installing the CLI, generating a changelog, and then generating a WeChat Work robot message, including an example of how to send it."},"warnings":[{"fix":"Adopt Conventional Commits in your project. Consider using `husky` and `cz-conventional-changelog` to enforce and facilitate this.","message":"This CLI strictly relies on Git commit messages following the Conventional Commits specification. If your commit history does not adhere to this standard, the generated changelog will be incomplete or malformed.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Add `robotMsg.json` to your `.gitignore` file. Always test robot messages in a dedicated testing group before sending to production channels to prevent 'operational incidents'.","message":"The robot message generation creates a `robotMsg.json` file in the project root. This file contains sensitive webhook content or message details. Ensure it's handled securely and not committed to public repositories inadvertently if it contains proprietary information.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Regularly check the project's repository and README for updates or breaking changes before upgrading. Pin exact versions (`\"tdesign-publish-cli\": \"0.0.12\"`) in `package.json` for stability.","message":"As a pre-1.0.0 package (current version 0.0.12), breaking changes can occur frequently without major version bumps, impacting API stability and command options.","severity":"breaking","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Initialize a git repository (`git init`), make some commits, and ensure you are in the project's root directory.","cause":"The command was run in a directory that is not a git repository or has no commit history.","error":"Error: Command 'changelog' requires a valid git repository with commit history."},{"fix":"Ensure you have recent commits that follow Conventional Commits and/or create a new Git tag (`git tag v1.0.0 && git push --tags`) to mark a release point.","cause":"There are no new commits matching the Conventional Commits specification since the last Git tag, or no tags exist.","error":"Changelog generation failed: No commits found since last tag."},{"fix":"Verify that `CHANGELOG.md` exists and contains content if generating release messages. Check terminal output for any errors during `tdesign-publish-cli robot` execution. Ensure proper write permissions in the project root.","cause":"The `robot` command failed to generate content, possibly due to missing changelog data, incorrect input, or permissions issues.","error":"Error: robotMsg.json not found or empty after 'robot' command."}],"ecosystem":"npm","meta_description":null}