-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add curl config #115
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e197e59
feat: add curl config
zhangymPerson 7a35003
fix: add global_vars
zhangymPerson 0e2f4df
Merge pull request #1 from zhangymPerson/feat/curl
smeech c593780
Single form
smeech 912173d
Merge pull request #1 from smeech/main
zhangymPerson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 yanming zhang <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
package_name: "curl" | ||
package_title: "curl Package" | ||
package_desc: "A package to get curl code snippets" | ||
package_version: "0.1.0" | ||
package_author: "yanming zhang" | ||
package_repo: "https://github.com/zhangymPerson/espanso-package-curl" | ||
--- | ||
An package to get curl command code snippets | ||
|
||
For more information about espanso packages, read the [documentation](https://espanso.org/docs/). | ||
|
||
## Usage | ||
|
||
Available replacements: | ||
|
||
| replacement | description | output | | ||
| ---------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | | ||
| `:curl:` | Get curl command example | `curl --request GET http://example.com` | | ||
| `:curlget:` | Get curl command example with query string | `curl --request GET http://example.com?key=value` | | ||
| `:curlpost:` | Get curl command example with post | `curl --request POST http://example.com` | | ||
| `:curlput:` | Get curl command example with put | `curl --request PUT http://example.com` | | ||
| `:curldelete:` | Get curl command example with delete | `curl --request DELETE http://example.com` | | ||
| `:curlpatch:` | Get curl command example with patch | `curl --request PATCH http://example.com` | | ||
| `:curlxml:` | Get curl command example with xml | `curl --request POST --header 'Content-Type: application/xml' --data '<key>value</key>' http://example.com` | | ||
| `:curljson:` | Get curl command example with json | `curl --request POST --header 'Content-Type: application/json' --data '{"key":"value"}' http://example.com` | | ||
| `:curldata:` | Get curl command example with data | `curl --request POST --header 'Content-Type: multipart/form-data' --form 'key=value' http://example.com` | | ||
| `:curldownload:` | Get curl command example with download | `curl --request GET --output file.txt http://example.com` | | ||
| `:curlupload:` | Get curl command example with upload | `curl --request POST --form 'file=@/path/to/file' http://example.com` | | ||
| `:curlheader:` | Get curl command example with header | `curl --request GET --header 'X-My-Header: 123' http://example.com` | | ||
| `:curlcookie:` | Get curl command example with cookie | `curl --request GET --cookie 'key=value' http://example.com` | | ||
| `:curlbasic:` | Get curl command example with basic auth | `curl --request GET --user 'username:password' http://example.com` | | ||
| `:curlproxy:` | Get curl command example with proxy | `curl --request GET --proxy http://proxy.example.com:8080 http://example.com` | | ||
| `:curlbearer:` | Get curl command example with bearer auth | `curl --request GET --header 'Authorization: Bearer token' http://example.com` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
author: yanming zhang | ||
description: An package to get curl command code snippets | ||
name: curl | ||
title: curl Package | ||
version: 0.1.0 | ||
homepage: "https://github.com/zhangymPerson/espanso-package-curl" | ||
tags: ["curl", "shell", "development"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# curl package | ||
|
||
name: curl | ||
parent: default | ||
|
||
matches: | ||
- trigger: ":curl:" | ||
replace: "curl --request GET https://example.com" | ||
|
||
- trigger: ":curlget:" | ||
replace: "curl --request GET https://example.com?key=value" | ||
|
||
- trigger: ":curlpost:" | ||
replace: "curl --request POST https://example.com" | ||
|
||
- trigger: ":curlput:" | ||
replace: "curl --request PUT https://example.com" | ||
|
||
- trigger: ":curldelete:" | ||
replace: "curl --request DELETE https://example.com" | ||
|
||
- trigger: ":curlpatch:" | ||
replace: "curl --request PATCH https://example.com" | ||
|
||
- trigger: ":curldata:" | ||
replace: "curl --request POST --header 'Content-Type: multipart/form-data' --form 'key=value' http://example.com" | ||
|
||
- trigger: ":curlxml:" | ||
replace: "curl --request POST --header 'Content-Type: application/xml' --data '<key>value</key>' http://example.com" | ||
|
||
- trigger: ":curljson:" | ||
replace: 'curl --request POST --header ''Content-Type: application/json'' --data ''{"key":"value"}'' http://example.com' | ||
|
||
- trigger: ":curlheader:" | ||
replace: "curl --request GET --header 'X-My-Header: 123' http://example.com" | ||
|
||
- trigger: ":curlcookie:" | ||
replace: "curl --request GET --cookie 'key=value' http://example.com" | ||
|
||
- trigger: ":curlbasic:" | ||
replace: "curl --request GET --user 'username:password' http://example.com" | ||
|
||
- trigger: ":curlbearer:" | ||
replace: "curl --request GET --header 'Authorization: Bearer token' http://example.com" | ||
|
||
- trigger: ":curlproxy:" | ||
replace: "curl --request GET --proxy http://proxy.example.com:8080 http://example.com" | ||
|
||
- trigger: ":curldownload:" | ||
replace: "curl --request GET --output file.txt http://example.com" | ||
|
||
- trigger: ":curlupload:" | ||
replace: "curl --request POST --form 'file=@/path/to/file' http://example.com" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for the mix of
https:
andhttp:
? The former throughout might be safer? I'd be happy to merge if this is addressed (unless there are good reasons not to).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added the relevant global variables as per your prompt