- 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 `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.
- 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.
- 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>