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