diff --git a/public/css/app.css b/public/css/app.css index 940dc11..70eff48 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -81,13 +81,6 @@ code { border-radius: 3px; } -pre code { - display: block; - padding: 1em; - margin: 0; - overflow-x: auto; -} - blockquote { border-left: 4px solid #30363d; margin: 1em 0; @@ -361,16 +354,12 @@ section { .code-block { position: relative; background: #161b22; - border-radius: 6px; + border-radius: 3px; + border: 1px solid #30363d; margin: 0.5em 0; padding: 0.5em; } -.code-block pre { - margin: 0; - padding-right: 2.5em; /* Reduced padding for smaller button */ -} - .code-block .action-btn { position: absolute; right: 8px; @@ -523,4 +512,63 @@ section { background: rgba(255, 255, 255, 0.1); padding: 0.2rem 0.4rem; border-radius: 3px; +} + +/* Info Box */ +.info-box { + margin: 20px 0; + padding: 15px; + background: #161b22; + border: 1px solid #30363d; + border-radius: 6px; +} + +.info-box h3 { + margin-top: 0; +} + +/* Command Labels and Code Blocks */ +.command-label { + display: block; + font-size: 10px; + font-weight: bold; + letter-spacing: 0.5px; + padding: 5px 0 0 1.5em; + background: #161b22; + border: 1px solid #30363d; + border-bottom: none; + border-radius: 3px 3px 0 0; +} + +.curl-label { + color: #2ea043; +} + +.cli-label { + color: #1f6feb; +} + +.labeled-code-block { + margin-bottom: 15px; +} + +.code-block { + border-radius: 3px; + border: 1px solid #30363d; +} + +.labeled-code-block .code-block { + margin-top: 0; + border-top: none; + border-top-left-radius: 0; + border-top-right-radius: 0; + padding-top: 2px; +} + +.labeled-code-block .code-block pre { + margin: 0; +} + +.command-group { + margin-bottom: 20px; } \ No newline at end of file diff --git a/views/docs.hbs b/views/docs.hbs index 3ae99fa..74249d3 100644 --- a/views/docs.hbs +++ b/views/docs.hbs @@ -8,6 +8,7 @@
The 0x45 CLI tool provides a convenient way to interact with the service from your terminal.
+ + Installation +go install github.com/watzon/0x45-cli/cmd/0x45@latest
+
+ Alternatively, you can build from source:
+git clone https://github.com/watzon/0x45-cli.git
+cd 0x45-cli
+go build -o $GOPATH/bin/0x45 ./cmd/0x45
+
+ Before using the CLI, configure your API key and optionally the API URL:
+0x45 config set api_key YOUR_API_KEY
+
+ 0x45 config set api_url https://your-instance.com
+
+ 0x45 key request --name "Your Name" --email "your@email.com"
+
+ 1. Upload a file
+curl -F "file=@path/to/file.txt" {{baseUrl}}
+
+ 0x45 upload path/to/file.txt
+
+ 2. Upload a private file with expiration
+curl -F "file=@path/to/file.txt" "{{baseUrl}}?private=true&expires=24h"
+
+ 0x45 upload --private --expires 24h path/to/file.txt
+
+ 3. Upload from stdin
+echo "Hello, World!" | curl --data-binary @- {{baseUrl}}
+
+ echo "Hello, World!" | 0x45 upload -
+
+ 1. Shorten a URL
+curl -X POST -d "url=https://example.com" {{baseUrl}}/api/urls
+
+ 0x45 shorten https://example.com
+
+ 2. Shorten a private URL with expiration
+0x45 shorten --private --expires 7d https://example.com
+
+ 1. List your uploads
+0x45 list pastes
+
+ 2. List your shortened URLs
+0x45 list urls
+
+ 3. List with pagination
+0x45 list pastes --page 2 --limit 10
+
+ 4. Delete content
+0x45 delete CONTENT_ID
+
+ 1. Get a config value
+0x45 config get KEY
+
+ 2. Set a config value
+0x45 config set KEY VALUE
+
+ POST {{baseUrl}}
-
+ POST {{baseUrl}}
+
+ POST {{baseUrl}}
-
+ POST {{baseUrl}}
+
+ POST {{baseUrl}}
-
+ POST {{baseUrl}}
+
+ GET {{baseUrl}}/:id
-
+ GET {{baseUrl}}/:id
+
+ GET {{baseUrl}}/raw/:id[.:ext]
-
+ GET {{baseUrl}}/raw/:id[.:ext]
+
+ GET {{baseUrl}}/download/:id[.:ext]
-
+ GET {{baseUrl}}/download/:id[.:ext]
+
+ DELETE {{baseUrl}}/delete/:id/:key
-
+ DELETE {{baseUrl}}/delete/:id/:key
+
+ POST {{baseUrl}}/url
-
+ POST {{baseUrl}}/url
+
+ GET {{baseUrl}}/urls
-
+ GET {{baseUrl}}/urls
+
+ GET {{baseUrl}}/url/:id/stats
-
+ GET {{baseUrl}}/url/:id/stats
+
+ PUT {{baseUrl}}/url/:id/expire
-
+ PUT {{baseUrl}}/url/:id/expire
+
+ DELETE {{baseUrl}}/url/:id
-
+ DELETE {{baseUrl}}/url/:id
+
+ curl -X POST {{baseUrl}}/api-key \
+
+ CURL
+
+ curl -X POST {{baseUrl}}/api-key \
-H "Content-Type: application/json" \
-d '{
"email": "your@email.com",
"name": "Your Name"
}'
-
+
+
Response:
@@ -425,11 +665,14 @@
Once verified, your API key can be used by including it in the Authorization header:
-
- Authorization: Bearer your-api-key
-
+
+ CURL
+
+ Authorization: Bearer your-api-key
+
+
diff --git a/views/index.hbs b/views/index.hbs
index 575f373..75c98a2 100644
--- a/views/index.hbs
+++ b/views/index.hbs
@@ -10,35 +10,94 @@
+
+
+ 📦 CLI Tool Available!
+ Install our CLI tool for easier interaction:
+
+ go install github.com/watzon/0x45-cli/cmd/0x45@latest
+
+
+
+
+
Usage
-
- curl -F 'file=@file.txt' {{baseUrl}}
-
+
+
+
+ CURL
+
+ curl -F 'file=@file.txt' {{baseUrl}}
+
+
+
+
+
+ 0X45 CLI
+
+ 0x45 upload file.txt
+
+
+
-
- curl -X POST --data-binary @file.txt {{baseUrl}}
-
+
+
+ CURL
+
+ curl -X POST --data-binary @file.txt {{baseUrl}}
+
+
+
+
+
+ 0X45 CLI
+
+ cat file.txt | 0x45 upload -
+
+
+
-
- curl -d '{"url":"https://example.com"}' {{baseUrl}}/url
-
+
+
+ CURL
+
+ curl -d '{"url":"https://example.com"}' {{baseUrl}}/url
+
+
+
+
+
+ 0X45 CLI
+
+ 0x45 shorten https://example.com
+
+
+
-
+
For more examples and API docs, visit:
{{baseUrl}}/docs
-
+
View detailed statistics at:
{{baseUrl}}/stats