snips

Usage

snips is an SSH-driven snippet manager. All interactions happen through your terminal — upload, download, edit, delete, and share files using standard SSH commands. No account creation needed; your SSH key is your identity.

Quick reference

Action Command
Upload echo "content" | ssh s.dwx.io
Upload (private) echo "content" | ssh s.dwx.io -private
Upload (with type hint) echo "content" | ssh s.dwx.io -ext py
Upload (private + signed URL) echo "content" | ssh s.dwx.io -private -ttl 24h
Download ssh f:<id>@s.dwx.io
Update echo "new" | ssh f:<id>:[email protected]
Delete ssh f:<id>@s.dwx.io rm
Force delete ssh f:<id>@s.dwx.io rm -f
Sign ssh f:<id>@s.dwx.io sign -ttl 1h
Interactive TUI ssh s.dwx.io

Authentication

snips uses SSH public key authentication exclusively. The first time you connect with a key, a user account is automatically created and linked to your key fingerprint. All files you create are tied to that key.

If your server has an authorized keys file configured, only listed keys will be allowed to connect.

Uploading

Pipe any content to the SSH server to create a new snippet:

echo "Hello, world!" | ssh s.dwx.io
cat main.go | ssh s.dwx.io
curl -s https://example.com | ssh s.dwx.io

The server auto-detects the file type from the content. To override detection, pass an extension hint:

cat config | ssh s.dwx.io -ext yaml

Private uploads

By default, files are public. To upload a private file:

echo "secret" | ssh s.dwx.io -private

Private files are only accessible by the owner (via their SSH key) or through signed URLs.

You can combine -private with -ttl to get a signed URL back immediately:

echo "secret" | ssh s.dwx.io -private -ttl 24h

Limits

  • Max file size: 1 MB (default)
  • Max files per user: 100 (default)
  • Empty files are rejected.

Downloading

Retrieve a file by connecting as f:<id>:

ssh f:[email protected]

Output goes to stdout, so you can pipe it:

ssh f:[email protected] > local_copy.txt
ssh f:[email protected] | less

Private files can only be downloaded by their owner.

Updating content

Pipe new content to f:<id>:content to replace a file’s contents:

echo "updated content" | ssh f:abc123:[email protected]

You can also change the file type during an update:

cat renamed.py | ssh f:abc123:[email protected] -ext py

Only the file owner can update content. Each update creates a revision with a unified diff of the changes (for text files). Old revisions are pruned once the limit (default 64, but configurable) is reached.

Deleting

Delete a file with the rm command:

ssh f:[email protected] rm

This prompts for confirmation. To skip the prompt:

ssh f:[email protected] rm -f

Only the file owner can delete their files.

Signed URLs

Private files can be shared via time-limited signed URLs. Use the sign command with a -ttl duration:

ssh f:[email protected] sign -ttl 1h
ssh f:[email protected] sign -ttl 7d

The returned URL can be opened by anyone until it expires. Signing only works on private files.

Duration format

Durations support these units, and can be combined:

Unit Meaning
s seconds
m minutes
h hours
d days
w weeks

Examples: 30s, 2h30m, 1w2d, 7d

Interactive TUI

Connect without piping to open an interactive terminal UI:

ssh s.dwx.io

The TUI lets you browse your files, view contents, see revision history, delete files, and generate signed URLs. Sessions have a default timeout of 15 minutes.

Web access

Public files are also available over HTTP:

https://snips.dwx.io/f/<id>

The web view includes syntax highlighting, metadata, and revision history. Private files require a valid signed URL to access over HTTP.