Open progrium opened 7 years ago
Need to add player to site: https://github.com/asciinema/asciinema-player
Use this script (add to repo somewhere) with termplayer.go to reproduce using asciinema:
cd /tmp rm hello.cmd rm http.cmd ssh cmd.io :delete hello ssh cmd.io :delete http source ~/.profile.d/demo clear [wait 2]# Let's build two quick commands with Cmd.io! # First,[wait] a simple command that says hello. vim [wait 20]hello.cmd[wait 3][begin-pty] [wait 2]i[wait]#!cmd[wait] alpine bash[wait] #!/bin/bash [wait 20]echo "Hello, ${1:-world}!"[wait 20] [wait][esc]:wq[wait][end-pty] cat hello.cmd | ssh cmd.io :create[wait 10] hello [wait 10]ssh cmd.io hello[wait 2] ssh cmd.io hello[wait 5] everybody[wait 2] [wait 10]clear [wait]# Next, an HTTP API client with jq built-in.[wait 10] # We'll also use stateful environment vars.[wait 5] vim http.cmd[wait 5][begin-pty] [wait]i[wait]#!cmd[wait] alpine bash curl jq[wait 10] #!/bin/bash curl -Ls ${BASE}${1}[wait 30] | jq -C ${2:-.} [wait 20][esc]:wq[wait][end-pty] cat http.cmd | ssh cmd.io :create http [wait 5]ssh cmd.io http [wait 2]slack.com/api/api.test ssh cmd.io http slack.com/api/api.test [wait 2].ok [wait 10] ssh cmd.io :env http set BASE=slack.com/api/[wait 10] ssh cmd.io http api.test[wait] [wait] [wait 5]ssh cmd.io :env http set BASE=api.github.com/[wait 10] ssh cmd.io http orgs/gliderlabs [wait 5]ssh cmd.io http orgs/gliderlabs [wait].name ssh cmd.io http orgs/gliderlabs .location [wait] [wait]clear [wait]# Now let's see how we can run commands over HTTP. # This will require using access tokens. [wait] TOKEN=$(ssh cmd.io :tokens new)[wait 5] echo $TOKEN [wait 5]ssh cmd.io :access http grant $TOKEN[wait 20] [wait 10]curl -u $TOKEN:[wait 5] "https://cmd.io/run/progrium/http?args=orgs/gliderlabs" [wait 5]curl -u $TOKEN: "https://cmd.io/run/progrium/http?args=orgs/gliderlabs+.name" [wait 20] [wait 20]ssh cmd.io :tokens rm $TOKEN exit
est: 0.5d
Need to add player to site: https://github.com/asciinema/asciinema-player
Use this script (add to repo somewhere) with termplayer.go to reproduce using asciinema:
est: 0.5d