charmbracelet / charmbracelet/vhs

How to print curl command with json payload

Open
#689 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
20.9k
Forks
474
Avg merge
4d 1h
Merged PRs (30d)
2

Description

**Please**: I do not know if this is a bug.

I want to send to the shell this:

~~~
curl -X POST localhost:8080/get/pets -H'Content-type: application/json' -d'{"payload":"low"}'
~~~

I searched through examples, I found nothing similar

file.tape contains:

~~~
Type "curl -X POST localhost:8080/get/pets -H\"Content-type: application/json\" -d\"{\"payload\":\"low\"}\""
Enter
Sleep 2s
~~~

This print "Invalid command: ..." here and there.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Type command from file.tape, including the escaped quotes in the JSON payload, and trace how VHS parses Type input. Check the command-line handling that produces “Invalid command” and verify the curl command can be typed without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.