-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:watzon/0x45
- Loading branch information
Showing
3 changed files
with
3 additions
and
244 deletions.
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
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
<ul> | ||
<li><a href="#getting-started">Getting Started</a></li> | ||
<li><a href="#file-upload-endpoints">File Upload Endpoints</a></li> | ||
<li><a href="#cli-usage">CLI Usage</a></li> | ||
{{#if apiKeysEnabled}} | ||
<li><a href="#authentication">Authentication & API Keys</a></li> | ||
<li><a href="#url-shortener">URL Shortener</a></li> | ||
|
@@ -31,206 +30,6 @@ | |
<p>The parameter names remain the same regardless of the content type used. The examples in this documentation use form data for simplicity, as it doesn't require explicitly setting content type headers.</p> | ||
</section> | ||
|
||
<section id="cli-usage"> | ||
<h2>CLI Usage</h2> | ||
|
||
<p>The 0x45 CLI tool provides a convenient way to interact with the service from your terminal.</p> | ||
|
||
<strong>Installation</strong> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>go install github.com/watzon/0x45-cli/cmd/0x45@latest</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="go install github.com/watzon/0x45-cli/cmd/0x45@latest"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<p>Alternatively, you can build from source:</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<pre><code>git clone https://github.com/watzon/0x45-cli.git | ||
cd 0x45-cli | ||
go build -o $GOPATH/bin/0x45 ./cmd/0x45</code></pre> | ||
<button class="action-btn" data-clipboard data-clipboard-content="git clone https://github.com/watzon/0x45-cli.git\ncd 0x45-cli\ngo build -o $GOPATH/bin/0x45 ./cmd/0x45"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<strong>Initial Setup</strong> | ||
<p>Before using the CLI, configure your API key and optionally the API URL:</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 config set api_key YOUR_API_KEY</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 config set api_key YOUR_API_KEY"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 config set api_url https://your-instance.com</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 config set api_url https://your-instance.com"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<strong>Getting an API Key</strong> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 key request --name "Your Name" --email "[email protected]"</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 key request --name \"Your Name\" --email \"[email protected]\""><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<strong>File Operations</strong> | ||
<p>1. Upload a file</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label curl-label">CURL</span> | ||
<div class="code-block"> | ||
<code>curl -F "file=@path/to/file.txt" {{baseUrl}}/p</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="curl -F "file=@path/to/file.txt" {{baseUrl}}/p"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 upload path/to/file.txt</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 upload path/to/file.txt"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<p>2. Upload a private file with expiration</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label curl-label">CURL</span> | ||
<div class="code-block"> | ||
<code>curl -F "file=@path/to/file.txt" -F "private=true" -F "expires_in=24h" "{{baseUrl}}/p"</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="curl -F "file=@path/to/file.txt" -F "private=true" -F "expires_in=24h" "{{baseUrl}}/p""><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 upload --private --expires 24h path/to/file.txt</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 upload --private --expires 24h path/to/file.txt"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<p>3. Upload from stdin</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label curl-label">CURL</span> | ||
<div class="code-block"> | ||
<code>echo "Hello, World!" | curl --data-binary @- {{baseUrl}}/p</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="echo "Hello, World!" | curl --data-binary @- {{baseUrl}}/p"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>echo "Hello, World!" | 0x45 upload -</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="echo "Hello, World!" | 0x45 upload -"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<strong>URL Operations</strong> | ||
<p>1. Shorten a URL</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label curl-label">CURL</span> | ||
<div class="code-block"> | ||
<code>curl -X POST -d "url=https://example.com" {{baseUrl}}/u</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="curl -X POST -d "url=https://example.com" {{baseUrl}}/u"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 shorten https://example.com</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 shorten https://example.com"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<p>2. Shorten a private URL with expiration</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 shorten --private --expires 7d https://example.com</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 shorten --private --expires 7d https://example.com"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<strong>Content Management</strong> | ||
<p>1. List your uploads</p> | ||
<div class="command-group"> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 list pastes</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 list pastes"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<p>2. List your shortened URLs</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 list urls</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 list urls"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<p>3. List with pagination</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 list pastes --page 2 --limit 10</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 list pastes --page 2 --limit 10"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<p>4. Delete content</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 delete CONTENT_ID</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 delete CONTENT_ID"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<strong>Configuration Management</strong> | ||
<p>1. Get a config value</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 config get KEY</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 config get KEY"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
|
||
<p>2. Set a config value</p> | ||
<div class="labeled-code-block"> | ||
<span class="command-label cli-label">0X45 CLI</span> | ||
<div class="code-block"> | ||
<code>0x45 config set KEY VALUE</code> | ||
<button class="action-btn" data-clipboard data-clipboard-content="0x45 config set KEY VALUE"><span>Copy</span></button> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
{{#if apiKeysEnabled}} | ||
<section id="authentication"> | ||
<h2>Authentication & API Keys</h2> | ||
|
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