Commit Graph

9 Commits

Author SHA1 Message Date
Harry b967831c68 refactor: simplify init command by removing tool handling
- 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.
2026-01-22 18:14:25 +08:00
Harry be1e8e8dd4 fix: update output for missing tools in config
- 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.
2026-01-21 14:54:51 +08:00
Harry 4fa55bcdf5 feat: support tool references 2026-01-19 23:03:54 +08:00
Harry dc53c0b3e3 feat: add env command to output shell commands for PATH configuration
- 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.
2026-01-04 11:38:47 +08:00
Harry 1c800b1019 fix: improve output handling in init command
- 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.
2026-01-04 11:31:48 +08:00
Harry 6e04ebb9da feat: add .dify_cli.json configuration file and enhance command initialization
- 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.
2025-12-30 16:49:57 +08:00
Harry 74e6fdf442 refactor: remove obsolete test files and streamline config handling
- 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.
2025-12-30 16:12:35 +08:00
Harry 8379d2673b refactor: separate tool schemas from env config
- 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>
2025-12-30 11:33:53 +08:00
Harry f90cd8aa9a feat: add dify_cli BusyBox-style CLI tool
Add a new CLI tool that allows invoking Dify platform tools like bash commands.

Features:
- BusyBox-style symlink invocation (e.g., google_search --query "hello")
- Cobra-based command structure for dify init/execute/list
- Flag-style parameters (--param value) instead of JSON
- Supports tool schema from Dify plugin entities

Usage:
  dify init --env <file> --schemas <file>   # Initialize config and create symlinks
  dify execute --tool <name> [--args...]    # Execute tool directly
  dify list                                 # List available tools
  google_search --query "hello"             # Via symlink

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 11:09:02 +08:00