# Linkjar CLI

Send PDFs, Office files, HTML pages and folders as tracked links from a terminal or an AI agent, and read who opened them. Node 18+, no dependencies.

```bash
npx linkjar login
npx linkjar send deck.pdf --for "Sam Lee <sam@acme.com>"
npx linkjar activity deck
```

- Install globally: `npm i -g linkjar`
- Agent skills: `npx linkjar skills install` (https://linkjar.com/skills/)
- API docs: https://linkjar.com/docs/api.md

## Environment

- `LINKJAR_API_KEY`: an API key (from Settings → Claude, CLI & API); takes precedence over a saved login.
- `LINKJAR_URL`: the server (default https://linkjar.com).
- `XDG_CONFIG_HOME`: where the login is saved (`linkjar/config.json`, owner-only permissions).

## Output and exit codes

The first line of normal output is the link. `--json` prints the raw API response. Exit code 0 on success, 1 for an API error, 2 for a usage error.

## Overview

```
linkjar 0.1.0: send decks, proposals, PDFs and HTML pages as branded,
tracked links, and see who opened them.

Usage: linkjar <command> [options]

Commands:
  login              Log in through the browser (or --key <api key>)
  logout             Forget the saved login
  whoami             Show the account and workspace in use
  send <path|->      Publish a PDF, Office file, HTML file, folder (with index.html) or stdin HTML
  update <ref> <path|->  Replace what a link shows; the link stays the same
  list               Your recent documents with view counts
  activity <ref>     Who opened it, when, how far they read (alias: views)
  responses <ref>    What people submitted on a fillable PDF (--csv for a spreadsheet)
  link <ref>         A personal link for one person (--name, --email)
  settings <ref>     Password, email gate, allowed domains, expiry, button
  room <title> <ref...>  Several documents behind one link
  open <ref>         Open the document's settings page in the browser
  skills [install]   List agent skills, or install them for Claude Code

<ref> is a link, its slug (the part after the domain) or its id.

Global options:
  --json             Print the raw JSON response (for scripts and agents)
  --url <url>        Server (default https://linkjar.com, or LINKJAR_URL)
  -h, --help         Help for a command: linkjar send --help
  -v, --version

Auth: `linkjar login` stores a token in ~/.config/linkjar/config.json.
In CI or agents, set LINKJAR_API_KEY instead (Settings → Claude, CLI & API).

Examples:
  linkjar send deck.pdf --for "Sam Lee <sam@acme.com>"
  linkjar send ./proposal-site --title "Acme proposal" --password hunter22
  linkjar activity acme-proposal
```

## linkjar login

```
Usage: linkjar login [--key <api key>] [--no-browser]

Logs in through your browser (OAuth). The token is saved to the config file
with owner-only permissions and is never printed.

  --key <key>     Save an API key (starts with lj_) instead of logging in
  --no-browser    Don't try to open a browser; just print the login link

Examples:
  linkjar login
  linkjar login --no-browser       # over SSH: open the printed link anywhere
  LINKJAR_API_KEY=lj_... linkjar whoami   # no login needed with the env var
```

## linkjar logout

```
Usage: linkjar logout

Deletes the saved login (config file).
```

## linkjar whoami

```
Usage: linkjar whoami

Shows the account and workspace the CLI is using.
```

## linkjar send

```
Usage: linkjar send <path|-> [options]

Publishes a file and prints its link (first line of output).
  path: .pdf, .doc(x), .ppt(x), .xls(x), .html/.htm, .zip, or a folder with an
        index.html at its top (sent as a website). "-" reads HTML from stdin.

Options:
  --title <text>          Title shown to viewers (default: file name or <title>)
  --for "Name <email>"    Also make a personal link for this person (repeatable)
  --password <pw>         Visitors need this password to open it
  --email-gate            Ask visitors for their email first (Pro)
  --domains <a.com,b.com> Only allow emails at these company domains
  --expires <YYYY-MM-DD>  Link stops working after this date (paid plans)
  --cta-label <text>      Call-to-action button text, e.g. "Book a call"
  --cta-url <url>         Where the button goes

Examples:
  linkjar send deck.pdf
  linkjar send proposal.html --for "Sam Lee <sam@acme.com>" --for "priya@acme.com"
  linkjar send ./site --title "Q4 plan" --email-gate --domains acme.com
  cat page.html | linkjar send - --title "One-pager"
```

## linkjar update

```
Usage: linkjar update <ref> <path|-> [--title <text>]

Replaces what an existing link shows. Everyone who has the link sees the new
version. Accepts the same kinds of path as send.

Examples:
  linkjar update acme-proposal proposal-v2.html
  linkjar update https://linkjar.com/acme-proposal ./site
```

## linkjar list

```
Usage: linkjar list [--query <text>] [--limit <n>]

Recent documents with their links and view counts.

Examples:
  linkjar list
  linkjar list --query acme --json
```

## linkjar activity

```
Usage: linkjar activity <ref> [--days <n>] [--limit <n>]

Who opened it, when, from where; on Pro also time spent, how far they read
and what they clicked. Alias: linkjar views.

Examples:
  linkjar activity acme-proposal
  linkjar activity acme-proposal --days 7 --json
```

## linkjar responses

```
Usage: linkjar responses <ref> [--limit <n>] [--csv] [--save-signed <dir>]

What people filled in, signed and submitted on a fillable PDF: who, when and
their answers. Signed responses show who signed, when and where.

  --csv                 One row per response (columns: Submitted at, Respondent,
                        Respondent email, the signature columns when anything was
                        signed, then every field), ready for a spreadsheet
  --save-signed <dir>   Download each signed PDF (with its signature certificate)
                        into <dir>

Examples:
  linkjar responses order-form
  linkjar responses order-form --csv > responses.csv
  linkjar responses agreement --save-signed ./signed
  linkjar responses order-form --json
```

## linkjar link

```
Usage: linkjar link <ref> --name <name> [--email <email>]

A personal link for one person, so their views show under their name.

Examples:
  linkjar link acme-proposal --name "Sam Lee" --email sam@acme.com
```

## linkjar settings

```
Usage: linkjar settings <ref> [options]

Changes how a link behaves. Only the options you pass change.

Options:
  --title <text>
  --password <pw>         Visitors need this password to open it
  --email-gate            Ask visitors for their email first (Pro)
  --domains <a.com,b.com> Only allow emails at these company domains
  --expires <YYYY-MM-DD>  Link stops working after this date (paid plans)
  --cta-label <text>      Call-to-action button text, e.g. "Book a call"
  --cta-url <url>         Where the button goes
  --no-email-gate         Turn the email gate off
  --remove-password       Turn password protection off
  --remove-expiry         Remove the expiry date
  --remove-cta            Remove the button

Examples:
  linkjar settings acme-proposal --password hunter22 --expires 2026-12-31
  linkjar settings acme-proposal --remove-password --no-email-gate
```

## linkjar room

```
Usage: linkjar room <title> <ref...> [--description <text>] [--email-gate]

Puts several documents behind one link (a deal room). Pro.

Examples:
  linkjar room "Acme deal room" acme-proposal case-study security-faq --email-gate
```

## linkjar open

```
Usage: linkjar open <ref>

Opens the document's settings page in your browser.
```

## linkjar skills

```
Usage: linkjar skills [list]
       linkjar skills install [name...] [--dir <folder>]

Agent skills teach Claude Code (and other agents) to write proposals, pitch
decks, one-pagers and case studies, send them with this CLI and follow up.
install downloads them into ~/.claude/skills/ (or --dir); with no names it
installs all of them. No login needed.

Examples:
  linkjar skills
  linkjar skills install
  linkjar skills install proposal follow-up
  linkjar skills install --dir ./.claude/skills     # just this project
```
