diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 99d9342..61773da 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -89,4 +89,4 @@ jobs: run: | EXT="" if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi - go build -trimpath -o "linksmith${EXT}" ./cmd/linksmith + go build -trimpath -o "linksmith${EXT}" ./cmd/linksmith \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 18db98c..b67bb46 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -86,4 +86,4 @@ jobs: with: files: | dist/*.tar.gz - dist/checksums.txt + dist/checksums.txt \ No newline at end of file diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 12b6c1e..8618ded 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -31,7 +31,7 @@ jobs: else VERSION="0.0.0" fi - echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "version=${VERSION}" >> $GITHUB_OUTPUT echo "Version: $VERSION" - name: Check if tag exists @@ -63,4 +63,4 @@ jobs: repo: context.repo.repo, workflow_id: 'release.yaml', ref: 'v${{ steps.version.outputs.version }}' - }) + }) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..b9490d9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,400 @@ + + +
+ + +Agentic-first link shortener. The agent IS the interface.
+# Build the single static binary +make build + +# Run with zero config โ starts on :8080 +./linksmith + +# Shorten a link +curl -X POST http://localhost:8080/api/links \ + -H "Authorization: Bearer <token>" \ + -d "url=https://example.com" + +# Response (plain text, one line per record) +handle=link_a1b2c url=https://example.com clicks=0 + +# Redirect (public, no auth needed) +curl -I http://localhost:8080/l/link_a1b2c +# โ 301 Location: https://example.com+
No UI, no SDK. The AI agent is the user. The API is the product.
+One labeled, grepable line per record. Token-cheap, survives context truncation. JSON on demand.
+Every 4xx includes a hint telling the agent what to do next. Self-correcting without a schema.
+GET /help returns a one-page operating manual the agent loads at runtime.
OTP via email โ long-lived bearer token. No complex OAuth flows.
+Go, zero external dependencies, CGO_ENABLED=0. Deploys as one file.
+Runs out of the box. Config layered: defaults < file < env < flags.
+Workspaces isolate links per tenant. Plans, limits, audit logs built in.
+POST /auth/request email=<email>&workspace=<handle> โ OTP code +POST /auth/verify email=<email>&code=<code> โ Bearer token+ +
| Method | Path | Description |
|---|---|---|
POST | /api/links | Create a shortened link |
GET | /api/links | List all links |
GET | /api/links/<handle> | Get link details |
DELETE | /api/links/<handle> | Delete a link |
GET | /api/workspace | Workspace info |
GET /l/<handle> โ 301 redirect to original URL
+
+ # Plain text (default) +handle=link_a1b2c url=https://example.com clicks=0 + +# JSON (add Accept: application/json or ?format=json) +{"handle":"link_a1b2c","url":"https://example.com","clicks":0}+
| Flag | Env Var | Default | Description |
|---|---|---|---|
-addr | LINKSMITH_ADDR | :8080 | Listen address |
-db | LINKSMITH_DB | linksmith.json | Data file path |
-secret | LINKSMITH_SECRET | random | Token signing secret |
make build # CGO_ENABLED=0, single static binary +make test # go test ./... +make vet # go vet ./...+