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 --shareInstallation
From npm (recommended)
npm install -g @tailor-app/cli
tailor --helpRequires Node.js 20+.
From the repo (development)
cd tools/tailor-cli
npm install
npm run buildRun 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.auConfigure via environment variables
export TAILOR_API_KEY=tailor_sk_your_key
export TAILOR_BASE_URL=https://tailor.auEnvironment variables take precedence over stored configuration.
Interactive login
tailor login
# Prompts for base URL and API keyCommand 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.auOptions:
| 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 ./report.md
tailor upload ./docs/*.docx
tailor upload ./deliverables/*.docx --share --public
tailor upload ./budget.xlsx --share --permission CommentOnly
tailor upload ./docs/*.docx --jsonArguments:
| 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 --publicArguments:
| 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 --jsonOptions:
| 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 30Options:
| 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 listtailor keys revoke
Revoke an API key.
tailor keys revoke key_abc123tailor tap — Tailor Agent Protocol
Collaborate on documents at machine speed. The tap command group lets AI agents join documents, propose edits, review proposals, and coordinate via the TAP protocol.
Command Reference
| Command | Description |
|---|---|
tailor tap join <docId> --as <name> |
Register as an agent on a document |
tailor tap leave <docId> |
Unregister from a document |
tailor tap get <docId> |
Get document as Markdown (pipeable) |
tailor tap sections <docId> |
Show section tree with IDs |
tailor tap propose <docId> --section <id> |
Propose an edit to a section |
tailor tap proposals <docId> |
List active proposals |
tailor tap approve <docId> <proposalId> |
Approve a proposal |
tailor tap reject <docId> <proposalId> --reason <text> |
Reject a proposal |
tailor tap agents <docId> |
List active agents |
tailor tap escalate <docId> --message <text> |
Escalate to human reviewer |
tailor tap events <docId> |
View event history |
tailor tap lock <docId> --section <id> |
Lock a section for editing |
tailor tap unlock <docId> --section <id> |
Unlock a section |
tailor tap join
tailor tap join abc123 --as "legal-reviewer" --role reviewer| Flag | Description | Required |
|---|---|---|
--as <agentName> |
Agent name | Yes |
--role <role> |
Agent role | No |
tailor tap get
Outputs raw Markdown to stdout so it can be piped:
tailor tap get abc123 > document.md
tailor tap get abc123 --section sec_01 | head -20| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Get single section | No |
tailor tap propose
Propose a change using a file or inline content:
# From a file
tailor tap propose abc123 --section sec_01 --file ./revised-intro.md --summary "Tightened intro"
# Inline content
tailor tap propose abc123 --section sec_01 --content "New paragraph text" --summary "Fixed typo"| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Target section | Yes |
--file <path> |
Read content from file | One of --file / --content |
--content <text> |
Inline content | One of --file / --content |
--summary <text> |
Change summary | No |
--reasoning <text> |
Reasoning for change | No |
tailor tap proposals
tailor tap proposals abc123
tailor tap proposals abc123 --section sec_01 --status pending --json| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Filter by section | No |
--status <status> |
Filter by status | No |
--json |
Output as JSON | No |
tailor tap lock / unlock
tailor tap lock abc123 --section sec_01 --ttl 60
tailor tap unlock abc123 --section sec_01| Flag | Description | Default |
|---|---|---|
--section <sectionId> |
Section to lock/unlock | Required |
--ttl <seconds> |
Lock time-to-live | 30 |
Agent Workflow Example
# 1. Join the document
tailor tap join abc123 --as "legal-reviewer" --role reviewer
# 2. Read the document
tailor tap get abc123 > doc.md
# 3. View sections
tailor tap sections abc123
# 4. Lock, propose, unlock
tailor tap lock abc123 --section sec_01 --ttl 60
tailor tap propose abc123 --section sec_01 --file ./revised.md --summary "Compliance fix"
tailor tap unlock abc123 --section sec_01
# 5. Another agent approves
tailor tap approve abc123 prop_abc --as "senior-reviewer"
# 6. Leave when done
tailor tap leave abc123Multi-Agent Example
# Agent A joins as editor
tailor tap join abc123 --as "editor-agent" --role editor
# Agent B joins as reviewer
tailor tap join abc123 --as "review-agent" --role reviewer
# Agent A proposes an edit
tailor tap propose abc123 --section sec_02 --file ./rewrite.md --summary "Rewrite methodology"
# Agent B reviews and approves
tailor tap proposals abc123 --section sec_02
tailor tap approve abc123 prop_xyz
# If stuck, escalate to human
tailor tap escalate abc123 --section sec_03 --message "Legal clause needs human review"Examples
LCC Quickstart: Upload 26 deliverables with shareable links
# 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...Upload Markdown files
# Upload a single Markdown file
tailor upload ./report.md --share
# Upload all Markdown files in a directory
tailor upload ./docs/*.md --share --publicMarkdown files are converted to HTML on upload for preview, with the original .md preserved as the source of truth.
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.jsonLocal 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 --jsonShare 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 --publicEnvironment 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