Project detail · Developer Tools

cutl

A self-hosted URL shortener with a Rust CLI, HTTP API, web interface, expiration, and visit analytics.

Status
Completed
Started
Feb 2026
Role
Creator and maintainer — Rust API and CLI, SvelteKit frontend, data model, analytics, and deployment.
Stack
Rust · Axum · SQLite · SvelteKit · Docker

Own the links and their analytics while keeping creation fast from either the terminal or the web.

What it is

cutl combines an Axum API server, a native Rust CLI, and a SvelteKit interface around a lightweight SQLite database. Links can use generated or custom codes, expire automatically, and collect useful visit statistics without relying on a hosted shortening service.

Why I built it

Hosted URL shorteners trade convenience for dependency and limited control. For personal infrastructure and automation, link creation should be just as easy from a terminal as from a browser.

How it addresses the problem

cutl packages the redirect service, REST API, analytics, CLI client, and web UI as one self-hostable system. SQLite removes external database setup, Docker handles deployment, and optional bearer authentication protects private instances.

What the project actually does

01

CLI-first creation

Create a short link from one terminal command, choose a custom server, pass a custom code, or set a time-to-live.

02

Useful link controls

Supports generated or custom codes and expiration from five minutes to thirty days.

03

Visit analytics

Tracks totals, daily trends, referrers, recent visits, and optional country or city data through GeoLite2.

04

Simple REST API

Create links, redirect visitors, and retrieve analytics through focused HTTP endpoints.

05

Low-ops storage

SQLite provides persistence without a separate database service, including indexed link expiry and visit records.

06

Self-hosted delivery

Multi-stage Docker builds, health checks, non-root runtime behavior, optional auth, and cross-platform CLI releases support deployment.

How the pieces connect

  1. 01 CLI / web UI
  2. 02 Axum API
  3. 03 Link service
  4. 04 SQLite
  5. 05 Redirect handler
  6. 06 Analytics

From zero to a useful result

  1. 01

    Open the deployed app

    Use the live web interface to shorten a URL without installing anything.

    https://web.cutl.my.id/ ↗
  2. 02

    Create the link

    Paste a destination URL, optionally choose a custom code and expiration, then submit it.

  3. 03

    Share and inspect

    Copy the generated short URL and return to its analytics to inspect visits, referrers, locations, and daily activity.

Start from the terminal

cutl https://example.com --ttl 7d