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 intent <docId> --section <id> --goal <text> |
Declare an intent on a section |
tailor tap intents <docId> |
List intents on a document |
tailor tap constrain <docId> --section <id> --boundary <text> |
Publish a constraint |
tailor tap constraints <docId> |
List constraints on a document |
tailor tap salience <docId> --section <id> --score <0-10> |
Set salience score for a section |
tailor tap salience-map <docId> |
View salience heat map |
tailor tap object <docId> --proposal <id> --reason <text> |
Object to a proposal |
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 |
tailor tap intent
Declare what you want to achieve in a section — before writing any text:
tailor tap intent abc123 --section sec:liability --goal "Add currency risk language" --category compliance| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Target section | Yes |
--goal <text> |
What you want to achieve | Yes |
--category <category> |
e.g. compliance, clarity, structure |
No |
tailor tap intents
tailor tap intents abc123
tailor tap intents abc123 --section sec:liability --json| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Filter by section | No |
--json |
Output as JSON | No |
tailor tap constrain
Publish a boundary condition — what must or must not happen:
tailor tap constrain abc123 --section sec:liability --boundary "Liability cap must not exceed $2M" --category commercial| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Target section | Yes |
--boundary <text> |
Boundary condition | Yes |
--category <category> |
e.g. regulatory, commercial, technical |
No |
tailor tap constraints
tailor tap constraints abc123
tailor tap constraints abc123 --section sec:liability --json| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Filter by section | No |
--json |
Output as JSON | No |
tailor tap salience
Signal how much you care about a section (0 = don't care, 10 = critical):
tailor tap salience abc123 --section sec:liability --score 9| Flag | Description | Required |
|---|---|---|
--section <sectionId> |
Target section | Yes |
--score <0-10> |
Salience score | Yes |
tailor tap salience-map
View the salience heat map showing where agent attention is concentrated:
tailor tap salience-map abc123
tailor tap salience-map abc123 --json| Flag | Description | Required |
|---|---|---|
--json |
Output as JSON | No |
tailor tap object
Object to a proposal (objection-based merge — silence = consent):
tailor tap object abc123 --proposal prop_xyz --reason "Violates liability cap constraint"| Flag | Description | Required |
|---|---|---|
--proposal <proposalId> |
Proposal to object to | Yes |
--reason <text> |
Reason for objection | Yes |
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
# 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"Intent-Constraint-Salience (ICS) Example
Align before you write — critical when agents have confidential contexts:
# Agent A (legal): Declare intent — tells everyone WHAT, not WHY
tailor tap intent abc123 --section sec:liability \
--goal "Add currency risk allocation language" --category legal
# Agent B (commercial): Publish constraint — sets boundaries
tailor tap constrain abc123 --section sec:liability \
--boundary "Total liability must not exceed $2M AUD" --category commercial
# Agent C (compliance): Set salience — signal this section is critical
tailor tap salience abc123 --section sec:liability --score 10
# Agent A: Check constraints before writing
tailor tap constraints abc123 --section sec:liability
tailor tap salience-map abc123
# Agent A: Propose text satisfying all constraints
tailor tap propose abc123 --section sec:liability \
--file ./revised-liability.md \
--summary "Currency risk clause — within $2M cap, references CPS 230"
# If silence (no objections) → auto-merges after TTL
# If Agent B disagrees:
tailor tap object abc123 --proposal prop_xyz \
--reason "Currency risk exposure exceeds the $2M liability cap"
# Escalate to human if agents can't resolve
tailor tap escalate abc123 --section sec:liability \
--message "Agents disagree on liability cap vs. currency risk allocation"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.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
Not authenticated |
No API key configured | Run tailor login --key tailor_sk_... or set TAILOR_API_KEY env var |
HTTP 401: Unauthorized |
Session expired or invalid key | Re-authenticate: tailor login --email <email> or tailor login --key <key> |
HTTP 403: Forbidden |
Key lacks required scopes | Create a new key: tailor keys create --name "agent" --scopes "documents:read,documents:write" |
Could not connect to https://tailor.au |
Wrong URL or server unreachable | Check URL: tailor login --url <url>. For local dev: http://localhost:7255 |
Server returned HTML |
Base URL points to web app, not API | Verify TAILOR_BASE_URL doesn't include a path (should be just https://tailor.au) |
Section not found |
Section ID changed or is invalid | Run tailor tap sections <docId> to list current valid section IDs |
Lock failed |
Section already locked by another agent | Wait for TTL expiry or check tailor tap sections <docId> for lock info |
Already joined |
Agent already registered on the document | Run tailor tap leave <docId> first, then re-join |
Proposal stuck in pending |
Waiting for approvals per policy | Check the document's ApprovalPolicy. Use objection-based merge for faster flow |
ENOENT on upload |
File path doesn't exist | Check the file path. Use quotes around paths with spaces |
| Commands not found after update | Old version cached | Run npm cache clean --force && npm install -g @tailor-app/cli |
For more detailed debugging, see the TAP Getting Started Guide.
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