CLI-difycall is a simple command line tool to chat with different Dify AI platforms.
- Install requirements:
pip install -r requirements.txt- Configure your Dify API:
- Copy
config.example.pytoconfig.py - Add your Dify API endpoints and keys in
config.py
- Fix SSL warning (if you see urllib3 SSL warning):
# Option 1: Downgrade urllib3
pip install urllib3==1.26.6
# Option 2: Upgrade OpenSSL (on Mac)
brew install [email protected]Basic usage:
python main.py -p <platform> -m "your message"-por--platform: Choose the AI platform (required)-mor--message: Your message to send (required)
Simple chat:
python main.py -p wechat -m "Hello, what's the weather?"You can use these platforms:
- telegram
- (other platforms from your config)
If something goes wrong, you will see:
- Wrong platform error
- Connection error
- Other error messages
Run this to see all options:
python main.py --helpIf you see "400 BAD REQUEST" error:
- Check if your Dify API service is running
- Verify your API endpoints in config.py
- Make sure your platform configuration is correct
- Check if your API key is valid
Common issues:
- API service not running (check if http://127.0.0.1 is correct)
- Wrong API endpoint
- Invalid API key
- Platform not properly configured
SSL/TLS Issues:
- If you see urllib3 SSL warning, you can:
- Downgrade urllib3:
pip install urllib3==1.26.6 - Upgrade OpenSSL (recommended for Mac users):
brew install [email protected] - Ignore the warning if everything works fine
- Downgrade urllib3: