- Changed the tool fetching mechanism to handle missing tools more effectively by introducing a batch fetch method.
- Removed the pull command to streamline the CLI, focusing on tool references and their management.
- Enhanced the list command to display available tool references and their statuses, improving user visibility into tool availability.
- Updated the configuration structure to include new fields for tool references and their enabled status.
This update improves the overall tool management experience in the CLI, making it more efficient and user-friendly.
- Removed the handling of tools from the init command, focusing solely on tool references.
- Updated output messages to reflect the changes in functionality, improving clarity for users.
This refactor streamlines the initialization process by concentrating on tool references, enhancing user experience.
- Changed error message output from stderr to stdout when no tools or tool references are defined in the configuration.
- Added support for custom configuration path via the DIFY_CLI_CONFIG environment variable.
This update improves user experience by providing clearer output and flexibility in configuration management.
- Added detailed descriptions for tool parameter types in the help command, including options for "select", "file", "files", "boolean", and "number".
- Improved user guidance by specifying accepted values and formats for each parameter type.
This update enhances the usability of the CLI by providing clearer information on tool parameters during help command execution.
- Improved error handling in the callDifyAPI function by reading the response body for non-200 status codes.
- This change ensures that error messages include the actual response content, providing better context for debugging.
This update enhances the clarity of error reporting during API interactions.
- Added a check for the API response status code in the callDifyAPI function to handle non-200 responses more effectively.
- Enhanced error reporting by including the status code and response body in the error message.
This update improves the robustness of API interactions by ensuring that errors are clearly communicated to the user.
- Updated the .dify_cli.json configuration to include cli_api_url, cli_api_session_id, and cli_api_secret for improved API interaction.
- Refactored the callDifyAPI and fetchProviders functions to utilize the new CLI API structure, including HMAC signature generation for enhanced security.
- Modified EnvConfig to reflect the new CLI API parameters, ensuring required fields are validated.
This update enhances the security and functionality of the CLI by transitioning to a new API structure and improving request handling.
- Replaced references to plugin_entities and requests with the new types package for tool parameters and descriptions.
- Enhanced the structure of tool parameters and descriptions to include LLM descriptions and improved type definitions.
- Updated the .dify_cli.json configuration to reflect changes in session ID format for enhanced security.
This refactor improves code organization and type safety, streamlining the handling of tool parameters in the CLI.
- Replaced inner_api_key and user_id with inner_api_session_id in the .dify_cli.json configuration.
- Updated EnvConfig and related functions to reflect the new session-based authentication.
- Removed obsolete tenant_id and user_id fields from the configuration and API request handling.
This update enhances security by transitioning to session-based authentication and streamlining the configuration structure.
- Introduced a new `env` command that outputs the necessary shell command to add the current working directory to the user's PATH.
- Updated the `runInit` function to inform users about the new `env` command for adding tools to PATH.
This update enhances the CLI by providing users with a convenient way to configure their environment for tool usage.
- Updated output statements in the runInit function to use fmt.Fprintf for consistent error and status reporting.
- Changed messages for missing tools and existing symlinks to direct output to the appropriate streams (stderr for errors, stdout for status).
This update enhances the clarity and consistency of command output in the CLI tool.
- Updated the EnvConfig struct to mark the FilesURL field as required, ensuring proper validation during configuration loading.
- This change enhances the robustness of the configuration management by preventing incomplete setups.
- Removed all tool definitions from the .dify_cli.json file to streamline configuration.
- Added a new `files_url` field to the environment section for improved resource management.
This update simplifies the configuration file and enhances the management of file resources.
- Introduced a new `pull` command that retrieves all available tools from the Dify platform and saves them to the `.dify_cli.json` configuration file.
- Implemented error handling for API requests and configuration saving to enhance reliability.
- Updated the command initialization to include the new `pull` command in the CLI structure.
- Enhanced the `EnvConfig` struct to include a `FilesURL` field for better tool management.
This update improves the CLI's functionality by allowing users to easily pull and manage tools from the Dify platform.
- Updated the argument check in the InvokeTool function to display help information when the first argument is either empty or a help flag ("--help" or "-h").
- This improvement ensures users receive guidance on tool usage when invoking without specific commands.
This update enhances user experience by providing immediate help options for the CLI tools.
- Added a check for empty arguments in the InvokeTool function to display tool help when no arguments are provided.
- Refactored the printToolHelp function to PrintToolHelp for consistency in naming conventions.
This update enhances user experience by providing immediate help information when invoking tools without arguments.
- Changed the output format in the list command to display the LLM description instead of the human-readable description.
- Added a hidden help command and disabled the default command completion options for improved command structure.
This update enhances the clarity of tool descriptions in the CLI and improves command usability.
- Replaced individual data type handling with a unified JSON output for API responses.
- Added error handling for JSON marshaling to ensure robust output.
- Enhanced logging to provide clearer context during tool execution.
This update improves the clarity and consistency of API interaction outputs in the CLI tool.
- Added error handling for API responses, including checks for nil data and specific error messages.
- Implemented a timeout for the HTTP client to improve reliability during long-running requests.
- Refactored response processing to handle various data types (text, JSON, file, blob, link) more effectively.
This update improves the robustness and clarity of API interactions within the CLI tool.
- Introduced a new .dify_cli.json file to define environment variables and tool configurations.
- Updated command initialization to create symlinks for tools defined in the new configuration file.
- Improved error handling and output messages during symlink creation.
- Removed obsolete environment file and related loading functions to streamline configuration management.
This update enhances the CLI's flexibility and usability by allowing dynamic tool management through JSON configuration.
- Deleted execute_test.go and config_test.go as they are no longer needed.
- Updated init.go to improve error handling and configuration validation.
- Simplified GetConfigPath and related functions for better clarity.
- Enhanced EnvConfig struct with validation tags for required fields.
This cleanup enhances code maintainability and reduces unnecessary complexity.
- Moved command definitions and execution logic to a new root.go file for better organization.
- Simplified main.go by delegating command execution to the new structure.
- Enhanced symlink detection for BusyBox-style invocation.
This refactor improves code maintainability and clarity in the CLI tool's architecture.
Use isSymlinkToSelf() to detect BusyBox-style invocation by checking
if os.Args[0] resolves to the same path as the current executable.
This eliminates the need to hardcode special names like "main" or
"__debug_bin", and works correctly with go run.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change schema format to flat {"tools": [...]} structure
- Add Provider field to EnvConfig for API calls
- Remove provider nesting, use simple ToolSchemas type
- Update FindTool to return only tool (no provider)
- Update all commands to use new structure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TenantID and UserID to EnvConfig
- Update config loading to parse TENANT_ID and USER_ID from env file
- Rewrite callDifyAPI to use daemon's http_requests.PostAndParseStream
- Use dify_invocation.InvokeToolRequest and tool_entities.ToolResponseChunk
- Update tests to verify new config fields
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change from `dify execute --tool name` to `dify execute name` to avoid
flag name conflicts with tool parameters.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Combined REMOTE_INSTALL_URL and REMOTE_INSTALL_PORT into a single line for clarity.
- This change improves the configuration format for easier understanding and usage.
* feat(oauth): implement refresh credentials functionality
- Added RefreshCredentials endpoint to handle OAuth credential refresh requests.
- Introduced RequestOAuthRefreshCredentials structure for request validation.
- Updated access types and actions to include refresh credentials.
- Enhanced server routing and controller logic to support the new functionality.
- Updated OAuth entities to include expiration handling for refreshed credentials.
* feat(oauth): add metadata field to OAuthGetCredentialsResult
---------
Co-authored-by: Harry <xh001x@hotmail.com>
* feat(plugin_decoder): add support for internationalized readme files
- Introduced the AvailableI18nReadme method in the PluginDecoder interface to retrieve available readme files in multiple languages.
- Implemented the method in FSPluginDecoder and ZipPluginDecoder to read localized readme files from the filesystem and zip archives.
- Enhanced UnixPluginDecoder to handle readme files in a structured manner, including support for reading from a dedicated "readme" directory.
- Added unit tests to verify the functionality of the AvailableI18nReadme method and ensure correct retrieval of localized readme content.
* feat(plugin): add support for multilingual README generation
- Introduced functionality to create README files in multiple languages (Simplified Chinese, Japanese, Portuguese) based on user selection.
- Enhanced the profile management to include options for enabling internationalized README and selecting languages.
- Added new language choice structure to manage language options and their selection state.
- Implemented rendering and writing of language-specific README files during plugin creation.
- Included new README template files for each supported language.
* feat(plugin): add README command and list functionality
- Introduced a new `readme` command to the plugin CLI for managing README files.
- Added `list` subcommand to display available README languages for a specified plugin path.
- Implemented functionality to read and list supported README languages in a tabular format.
- Enhanced error handling for plugin file reading and decoding processes.
* feat: add support for dark icon
- Introduced IconDark field in PluginDeclaration and related structures to support dark mode icons.
- Updated the installation process to handle dark icons.
- Enhanced asset validation to check for the presence of dark icons.
This change improves the visual consistency of plugins in dark mode environments.
* enhance(cli/icon): add plugin icon support with multiple categories
- Added support for light and dark icons for various plugin categories including agent, datasource, extension, model, tool, and trigger.
- Replaced the previous single icon implementation with a structured map for better organization and retrieval of icons based on category and theme.
- Removed the old Python icon file to streamline asset management.
This update improves the visual representation of plugins across different themes, enhancing user experience.
* change icons
* fix
* fix
* comments
- Removed redundant flag retrieval in the plugin initialization process, simplifying the code.
- Updated permission handling to use a single `permissionRequirement` structure for better clarity and maintainability.
- Enhanced YAML templates by adding quotes around dynamic values to ensure proper formatting and prevent potential parsing issues.
- Updated the method in the interface to remove the parameter, simplifying its usage.
- Introduced a new function to provide a default verification structure.
- Added a file to store verification data, improving the plugin signing process.
- Enhanced tests in to validate the verification process, ensuring proper handling of success and failure scenarios.
- Refactored related code to accommodate the new verification structure and improve overall maintainability.
* feat: Add code generation for plugin controllers and services
- Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers.
- Created new files for generated controllers, services, and templates to streamline the plugin invocation process.
- Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files.
- Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features.
* fix
* feat: Enhance plugin signing with authorized category verification
- Added support for an `authorized_category` flag in the signature command to validate the category before signing.
- Updated the `Sign` function to accept a verification parameter, allowing for category-based signing.
- Enhanced error handling for invalid categories during the signing process.
- Updated tests to cover new verification scenarios and ensure proper functionality with the authorized category.
* fix
* fix
* test
* test: Add unit test for plugin verification without verification field
- Introduced a new test case to verify the behavior of plugins that lack a verification field.
- Updated the signature_test.go file to include the test, ensuring proper functionality of the signing process.
- Removed the outdated verifier_test.go file and associated test data to streamline the codebase.
* feat: introduce 'run' command for local plugin execution
- Added a new command `run` to launch plugins locally, allowing communication through stdin/stdout.
- Removed the previous `test` command and its associated functionality to streamline the plugin testing process.
* feat: enhance 'run' command with TCP support
- Introduced a new `RunPluginPayload` structure to encapsulate plugin execution parameters.
- Added TCP communication mode to the `run` command, allowing multiple client connections.
- Updated command flags to configure run mode and logging options.
- Implemented client handling and server creation for both stdin/stdout and TCP modes.
* docs: improve comments in RunPlugin function for clarity
- Enhanced comments to provide clearer explanations of the plugin decoding process and the creation of client streams for both stdin/stdout and TCP modes.
- Updated comments to reflect the functionality and behavior of the plugin execution flow.
* refactor: update command structure and enhance plugin invocation handling
- Changed the command structure to add `runPluginCommand` under `pluginCommand` for better organization.
- Introduced `InvokePluginPayload` type to encapsulate plugin invocation details.
- Enhanced `RunPlugin` function to handle responses and errors more effectively, including logging to stdout.
- Updated client handling to support session management and improved error handling during plugin invocation.
- Renamed TCP server creation function for consistency.
* feat: enhance plugin response handling and logging capabilities
- Added a new flag `--response-format` to specify the output format (text or json) for plugin responses.
- Introduced a `logger` to manage logging output to stdout with timestamps and file information.
- Updated `logResponse` and `systemLog` functions to handle different response formats.
- Enhanced `handleClient` and `RunPlugin` functions to utilize the new response format feature.
- Implemented signal handling to clean up temporary directories on shutdown.
* feat: enhance plugin response structure and logging
- Added `InvokeID` to `InvokePluginPayload` and `GenericResponse` for better tracking of plugin invocations.
- Updated `logResponse` to include `InvokeID` in error responses for improved debugging.
- Enhanced client handling in `handleClient` to log plugin readiness and received requests.
- Refactored client stream creation for better readability and consistency.
* feat: add plugin invoke end response type and logging
- Introduced `GENERIC_RESPONSE_TYPE_PLUGIN_INVOKE_END` to enhance response tracking for plugin invocations.
- Updated `handleClient` to log the end of plugin invocation, improving visibility into the plugin lifecycle.
* chore: remove fullfeature tags