curlconverter
tree-sitter-bash
Our great sponsors
curlconverter | tree-sitter-bash | |
---|---|---|
6 | 5 | |
7,128 | 187 | |
1.7% | 2.7% | |
7.7 | 0.0 | |
22 days ago | 10 days ago | |
TypeScript | C | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
curlconverter
-
Convert Curl Commands to Code
Simple way would be to add a “curl” options, looks like you’d just need to write up a method that matches this Request interface [0] to some curl command substrings you mash together.
Problem is of course: the headers and options are all going to be included. You could make it so it organizes them better though, maybe indenting and grouping like-options together so it’s easier to remove stuff.
[0] https://github.com/curlconverter/curlconverter/blob/e4b6fb74...
-
Show HN: OpenAPI DevTools – Chrome ext. that generates an API spec as you browse
I made a fork of the Chrome DevTools that adds exactly this. You can tell Chrome to use a different version of the DevTools if you start it from the command line
https://github.com/curlconverter/curlconverter/issues/64#iss...
- Program that converts a curl call into python code?
-
Ask HN: What companies are embracing “HTML over the wire”?
Someone added a ColdFusion Markup Language generator to https://curlconverter.com/cfml/ last year and after a few months I decided to remove it since I've never heard of it so nobody could possibly be using it, and the next day the guy who added support for it and 3 other people complained about it, so it seems like they're out there.
https://github.com/curlconverter/curlconverter.github.io/pul...
-
I absolutely love web scraping.
Relevant tools: - Browser dev tools and front-end tooling to debug JS and reconstruct requests in your code - grep.app and SourceGraph to check open-source parsers for some URLs (often, there are such repositories) - curlconverter to quickly draft a script from the cURL command - Regex and regex playgrounds to extract data from inline JavaScript - GraphQL introspection tools - Optionally, Fiddler or Wireshark to intercept and debug network requests (I don't use but my teammate does)
-
Convert curl commands to code in several languages
Original author here. Many smart people have contributed code over the years, but one warrants special mention.
About a year ago, verhovsky showed up out of nowhere. He rewrote the core of the application and increased the professionalism across the board. (dedicated domain, github page hosting, UI refresh, privacy improvements, and much more)
The tree-sitter PR is a monster achievement: https://github.com/curlconverter/curlconverter/pull/278
Search for parseAnsiCString in there. I don't think that had ever been implemented in JavaScript before.
For you, verhovsky, 10x engineer might be an understatement. Thank you!
tree-sitter-bash
-
Ask HN: What are some unpopular technologies you wish people knew more about?
(1) Zulip Chat - https://zulip.com/ - seems to be reasonably popular, but more people should know about it
I’ve been using it for over 5 years now [1], and it’s as good as ever. It’s way faster than any other chat app I’ve used. It has a good UI and conversation model. It has a simple and functional API that lets me curl threads and write blog posts based on them.
(only problem is that I Ctrl-+ in my browser to make the font bigger – I think it’s too dense for most people)
(2) re2c regex to state machine compiler - https://re2c.org
A gem from the 90’s, which people have done a great job maintaining and improving (getting Go and Rust target support in the last few years). I started using it in 2016, and used for a new program a few months ago. I came to the conclusion that it should have been built into C, because C has shitty string processing – and Ken Thompson both invented C AND brought regular languages to computing !!
In comparison, treesitter lexers are very low level, fiddly, and error prone. I recently saw dozens of ad hoc fixes to the tree-sitter-bash lexer, which is unsurprising if you look at the structure of the code (manually crawling through backslashes and braces in C).
https://github.com/tree-sitter/tree-sitter-bash/blob/master/...
These fixes are definitely appreciated, but I think it indicates a problem with the model itself.
(based on https://lobste.rs/s/endspx/software_you_are_thankful_for#c_y...)
[1] https://www.oilshell.org/blog/2018/04/26.html
-
Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit
(use-package treesit :ensure nil :custom ;; Some stuff taken from here: https://robbmann.io/posts/emacs-treesit-auto/ (treesit-extra-load-path '("/usr/lib64/")) (treesit-language-source-alist '((bash . ("https://github.com/tree-sitter/tree-sitter-bash")) (c . ("https://github.com/tree-sitter/tree-sitter-c")) (c++ . ("https://github.com/tree-sitter/tree-sitter-cpp")) (csharp . ("https://github.com/tree-sitter/tree-sitter-c-sharp")) (css . ("https://github.com/tree-sitter/tree-sitter-css")) (elixir ("https://github.com/elixir-lang/tree-sitter-elixir")) (html . ("https://github.com/tree-sitter/tree-sitter-html")) (java . ("https://github.com/tree-sitter/tree-sitter-java")) (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript")) (json . ("https://github.com/tree-sitter/tree-sitter-json")) (lua . ("https://github.com/Azganoth/tree-sitter-lua")) (makefile . ("https://github.com/alemuller/tree-sitter-make")) (org . ("https://github.com/milisims/tree-sitter-org")) (python . ("https://github.com/tree-sitter/tree-sitter-python")) (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")) (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")) (ruby . ("https://github.com/tree-sitter/tree-sitter-ruby")) (rust . ("https://github.com/tree-sitter/tree-sitter-rust")) (sql . ("https://github.com/m-novikov/tree-sitter-sql")) (toml . ("https://github.com/tree-sitter/tree-sitter-toml")) (yaml . ("https://github.com/ikatyang/tree-sitter-yaml")))) (major-mode-remap-alist '((c-mode . c-ts-mode) (c++-mode . c++-ts-mode) (csharp-mode . csharp-ts-mode) (css-mode . css-ts-mode) (html-mode . html-ts-mode) (java-mode . java-ts-mode) (js-mode . js-ts-mode) (json-mode . json-ts-mode) (makefile-mode . makefile-ts-mode) ;; (org-mode . org-ts-mode) ;; not mature yet (python-mode . python-ts-mode) (typescript-mode . typescript-ts-mode) (ruby-mode . ruby-ts-mode) (rust-mode . rust-ts-mode) (toml-mode . toml-ts-mode) (yaml-mode . yaml-ts-mode))) (treesit-auto-fallback-alist '((toml-ts-mode . conf-toml-mode) (typescript-ts-mode . nil) (tsx-ts-mode . nil))) (treesit-font-lock-settings t) (treesit-simple-indent t) (treesit-defun-type-regexp t)) (use-package treesit-auto :demand t :config (setq treesit-auto-install t) (global-treesit-auto-mode))
-
Treesiter problem with .bashrc
I ran into this issue as well a few weeks ago, there's already a few issues for it: https://github.com/tree-sitter/tree-sitter-bash/issues/151
- Building tree-sitter languages for Emacs
-
Convert curl commands to code in several languages
All 3 of these are linked to under "Related Tools".
Those projects use a pretty basic tokenizer
https://github.com/luckymarmot/Paw-cURLImporter/blob/master/...
Insomnia and Postman use commander.js for their bash parsing which looks like it just splits on space:
https://github.com/tj/commander.js/blob/02a124c7d58dbae2ef11...
and only support a few of curl's options. Curlconverter uses tree-sitter's Bash grammar https://github.com/tree-sitter/tree-sitter-bash/ and tries to at least correctly discard all of curl's options and any options that curl used to have.
What are some alternatives?
curl-to-php - Convert curl commands to PHP code in your browser
tree-sitter-zig - Tree-sitter package for the Zig programming language
NSwag - The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
curl-to-go - Convert curl commands to Go code in your browser
tree-sitter-yaml - YAML grammar for tree-sitter
playwright_stealth - playwright stealth
insomnia - The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
tree-sitter-cmake - A Tree-sitter parser for CMake
rosso - Data parsers and formatters
tree-sitter-css - CSS grammar for Tree-sitter