JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 156
  • Score
    100M100P100Q74717F
  • License MIT

Tailor Documents CLI — upload, share, and manage documents from your terminal

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tailor-app/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Tailor CLI

    Command-line tool for uploading, sharing, and managing documents on Tailor.

    Quickstart

    npm install -g @tailor-app/cli
    tailor login --email you@company.com
    tailor upload ./my-document.docx --share

    Installation

    npm install -g @tailor-app/cli
    tailor --help

    Requires Node.js 20+.

    From the repo (development)

    cd tools/tailor-cli
    npm install
    npm run build

    Run commands via node bin/tailor.js <command> or set up a shell alias.

    Authentication

    The CLI uses API keys for authentication. Keys are prefixed with tailor_sk_ and sent as X-Api-Key headers.

    Configure via CLI

    tailor login --key tailor_sk_your_key --url https://tailor.au

    Configure via environment variables

    export TAILOR_API_KEY=tailor_sk_your_key
    export TAILOR_BASE_URL=https://tailor.au

    Environment variables take precedence over stored configuration.

    Interactive login

    tailor login
    # Prompts for base URL and API key

    Command Reference

    tailor login

    Configure API key and base URL for the CLI.

    tailor login                          # Interactive prompt
    tailor login --key tailor_sk_abc123   # Set API key
    tailor login --url http://localhost:7255  # Set base URL (local dev)
    tailor login --key tailor_sk_abc123 --url https://tailor.au

    Options:

    Flag Description Default
    --key <apiKey> API key (must start with tailor_sk_)
    --url <baseUrl> Base URL for the Tailor API https://tailor.au

    tailor upload <files...>

    Upload one or more documents. Supports glob patterns for batch uploads.

    tailor upload ./report.docx
    tailor upload ./docs/*.docx
    tailor upload ./deliverables/*.docx --share --public
    tailor upload ./budget.xlsx --share --permission CommentOnly
    tailor upload ./docs/*.docx --json

    Arguments:

    Argument Description
    <files...> One or more file paths or glob patterns

    Options:

    Flag Description Default
    --share Create shareable links after upload false
    --permission <perm> Share permission: ReadOnly, CommentOnly, FullReview ReadOnly
    --public Public links (no email verification) false
    --json Output results as JSON false

    tailor share <documentId>

    Create a shareable link for an existing document.

    tailor share a1b2c3d4-e5f6-7890-abcd-ef1234567890
    tailor share a1b2c3d4 --permission FullReview
    tailor share a1b2c3d4 --public

    Arguments:

    Argument Description
    <documentId> Document ID (GUID)

    Options:

    Flag Description Default
    --permission <perm> ReadOnly, CommentOnly, FullReview ReadOnly
    --public No email verification required false

    tailor list

    List all your documents.

    tailor list
    tailor list --json

    Options:

    Flag Description Default
    --json Output as JSON false

    tailor keys create

    Create a new API key.

    tailor keys create --name "CI Pipeline"
    tailor keys create --name "LCC Upload" --scopes "documents:read,documents:write"
    tailor keys create --name "Temp Key" --expires 30

    Options:

    Flag Description Default
    --name <name> Key name (required)
    --scopes <scopes> Comma-separated scopes documents:read,documents:write
    --expires <days> Days until expiry 365

    tailor keys list

    List all active API keys.

    tailor keys list

    tailor keys revoke

    Revoke an API key.

    tailor keys revoke key_abc123

    Examples

    # Configure for production
    tailor login --key tailor_sk_lcc_production_key
    
    # Upload all DOCX files and generate public share links
    tailor upload ./deliverables/*.docx --share --public
    
    # Output:
    # Uploading 26 file(s)...
    #
    # ✓ LCC-Policy-Report.docx → a1b2c3d4
    #   https://tailor.au/share/abc123...
    # ✓ LCC-Budget-Analysis.docx → e5f6g7h8
    #   https://tailor.au/share/def456...
    # ...
    # ✓ 26/26 uploaded successfully
    #
    # Shareable Links:
    #   LCC-Policy-Report: https://tailor.au/share/abc123...
    #   LCC-Budget-Analysis: https://tailor.au/share/def456...

    CI/CD Integration

    # Set credentials via environment variables
    export TAILOR_API_KEY=tailor_sk_ci_key
    export TAILOR_BASE_URL=https://tailor.au
    
    # Upload build artifacts
    tailor upload ./output/*.docx --share --json > upload-results.json

    Local Development

    # Point to local API
    tailor login --url http://localhost:7255 --key tailor_sk_dev_key
    
    # Upload a test document
    tailor upload ./test-fixtures/demo.docx
    
    # List documents
    tailor list --json

    Share with specific permissions

    # Read-only share (default)
    tailor share abc123
    
    # Allow comments
    tailor share abc123 --permission CommentOnly
    
    # Full review access, no email verification
    tailor share abc123 --permission FullReview --public

    Environment Variables

    Variable Description Default
    TAILOR_API_KEY API key for authentication
    TAILOR_BASE_URL Base URL for the Tailor API https://tailor.au

    Environment variables override stored configuration.

    Config Storage

    Configuration is stored locally using the conf package:

    • Windows: %APPDATA%/tailor-cli/config.json
    • macOS: ~/Library/Preferences/tailor-cli/config.json
    • Linux: ~/.config/tailor-cli/config.json

    Run tailor login to see the exact path.

    Requirements

    • Node.js >= 20.0.0
    • A Tailor account with an API key

    Tech Stack

    • Commander.js — CLI framework
    • chalk — Terminal colors
    • ora — Terminal spinners
    • conf — Persistent config
    • glob — File pattern matching