中文文档 | English
A powerful web-based tool for filtering and editing cURL commands with configurable rules. Perfect for cleaning up cURL commands copied from browser developer tools before importing them into external systems.
Visit: https://jsrei.github.io/curl-filter/
When you copy a request as cURL from Chrome DevTools (or other browsers), it includes many default headers and parameters that you might not need:
- Unnecessary headers like
User-Agent
,Accept-Language
,Accept-Encoding
, etc. - Browser-specific headers like
sec-ch-ua
,sec-fetch-*
headers - Authentication cookies that shouldn't be shared
- Redundant query parameters
This tool helps you clean up these cURL commands by applying configurable filtering rules.
- API Testing Tools: Clean cURL commands before importing into Postman, Apifox, Insomnia
- Coze Plugin Development: Prepare clean API requests for plugin configuration
- Documentation: Generate clean cURL examples for API documentation
- Security: Remove sensitive headers and cookies from shared cURL commands
- Automation: Standardize cURL commands for scripts and CI/CD pipelines
- Smart Filtering: Remove unwanted headers, query parameters, and form data
- Configurable Rules: Create custom filtering rules with regex patterns
- Real-time Preview: See filtering results as you type
- Input Validation: Smart detection and validation of cURL commands
- Quick Start: One-click example to get started immediately
- Keyboard Shortcuts: Efficient workflow with keyboard shortcuts
- History Management: Keep track of your filtering history
- Export/Import: Save and share your filtering rules
- Rule Templates: Pre-built templates for common use cases
- Multi-language Support: Available in English and Chinese
- Responsive Design: Works on desktop and mobile devices
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone https://github.com/JSREI/curl-filter.git
cd curl-filter
- Install dependencies:
npm install
- Start the development server:
npm run dev
# or use the provided script
./start.sh
- Open your browser and visit
http://localhost:25519
npm run build
The built files will be in the dist
directory.
- Try the Example: Click "Use Example" to load a sample cURL command
- Configure Rules: Click "Rule Management" (Ctrl+M) to set up filtering rules
- Apply Filters: Click "Apply Filter Rules" (Ctrl+Enter) to process your cURL command
- Copy Result: Use the copy button to copy the cleaned cURL command
-
Paste cURL Command: Copy a cURL command from your browser's developer tools and paste it into the input field. The tool will automatically validate your input.
-
Configure Rules: Click "Rule Management" to set up filtering rules:
- Remove specific headers (e.g.,
User-Agent
,Accept-Language
) - Filter query parameters
- Clean form data
- Remove JSON body fields
- Use pre-built templates for common scenarios
- Remove specific headers (e.g.,
-
Apply Filters: Click "Apply Filter Rules" to process your cURL command. You can also use Ctrl+Enter for quick processing.
-
Copy Result: Use the copy button to copy the cleaned cURL command.
- Ctrl+Enter: Apply filter rules
- Ctrl+K: Clear input
- Ctrl+M: Open rule management
Before filtering:
curl 'https://api.example.com/users?page=1' \
-H 'accept: application/json' \
-H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: "Chrome";v="120"' \
-H 'sec-fetch-dest: empty' \
-H 'user-agent: Mozilla/5.0...'
After filtering:
curl 'https://api.example.com/users?page=1' \
-H 'accept: application/json' \
-H 'cache-control: no-cache'
The tool supports various filtering rules:
- Header Filters: Remove or modify HTTP headers
- Query Parameter Filters: Clean URL parameters
- Form Data Filters: Filter form fields
- JSON Body Filters: Remove JSON properties
- Custom Patterns: Use regex for advanced filtering
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with React, TypeScript, and Vite
- UI components from Material-UI
- Deployed on GitHub Pages
If you have any questions or need help, please:
- Check the Issues page
- Create a new issue if your problem isn't already reported
- Provide detailed information about your use case