Install
openclaw skills install url-shortener-cliShorten URLs from terminal with custom slugs, local storage, and basic analytics. A self‑contained CLI that maps long URLs to short slugs using a local JSON file.
openclaw skills install url-shortener-cliA local, self‑contained URL shortener that runs entirely on your machine. No external APIs, no internet required after setup.
Key features:
~/.url-shortener/mappings.json)./scripts/main.py shorten https://example.com/very/long/path
./scripts/main.py shorten https://example.com --slug mypage
./scripts/main.py expand mypage
./scripts/main.py list
./scripts/main.py info mypage
./scripts/main.py delete mypage
./scripts/main.py search "example"
./scripts/main.py export --file urls.json
./scripts/main.py import --file urls.json
./scripts/main.py help
shorten: Create a new short URL
url: The long URL to shorten (required)--slug: Custom slug (optional, auto‑generated if omitted)--description: Optional description--tags: Comma‑separated tags for organizationexpand: Get the original URL for a slug
slug: The short slug (required)list: List all mappings
--sort: Sort by created, clicks, slug, url (default: created)--reverse: Reverse sort order--limit: Show only N entries--json: Output as JSONinfo: Show detailed information for a slug
slug: The short slug (required)--json: Output as JSONdelete: Delete a mapping
slug: The short slug to delete (required)--force: Skip confirmationsearch: Search in URLs, descriptions, or tags
query: Search term (required)--field: Search field: url, description, tags, all (default: all)export: Export mappings to a JSON file
--file: Output file (default: urls-export.json)import: Import mappings from a JSON file
--file: Input file (required)--overwrite: Replace existing mappings (default: merge)stats: Show usage statistics
--json: Output as JSONcleanup: Remove old or unused mappings
--older-than-days: Remove entries older than N days--max-clicks: Remove entries with fewer than N clicks--dry-run: Show what would be removed$ ./scripts/main.py shorten https://github.com/openclaw/openclaw
Shortened: https://github.com/openclaw/openclaw
Slug: x7f9k2
Full command: ./scripts/main.py expand x7f9k2
Slug URL Clicks Created
------- -------------------------------------- ------ -------------------
x7f9k2 https://github.com/openclaw/openclaw 12 2026‑03‑18 10:30:00
mypage https://example.com 5 2026‑03‑17 14:22:00
docs https://docs.openclaw.ai 42 2026‑03‑16 09:15:00
--json):{
"x7f9k2": {
"url": "https://github.com/openclaw/openclaw",
"slug": "x7f9k2",
"clicks": 12,
"created": "2026-03-18T10:30:00Z",
"description": "OpenClaw GitHub repo",
"tags": ["github", "openclaw"]
}
}
Requires Python 3.6+. No external dependencies. The tool creates a configuration directory at ~/.url-shortener/ and stores mappings in mappings.json.
./scripts/main.py shorten https://docs.openclaw.ai --slug docs --description "OpenClaw documentation"
./scripts/main.py list --sort clicks --reverse --limit 5
./scripts/main.py search "github" --field url
./scripts/main.py export --file url-backup-$(date +%Y%m%d).json
./scripts/main.py cleanup --older-than-days 30