papermark 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openai.yaml ADDED
@@ -0,0 +1,56 @@
1
+ schema_version: v1
2
+ name_for_human: Papermark CLI
3
+ name_for_model: papermark
4
+ description_for_human: Share documents, create protected links, and read analytics from your terminal.
5
+ description_for_model: |
6
+ Use this action to interact with Papermark — a document-sharing and dataroom
7
+ service. Available workflows: upload documents, create password- or email-
8
+ protected share links, list viewers, read per-document and per-link analytics,
9
+ and manage datarooms. Every subcommand supports --json for machine-parseable
10
+ output. Follow the output contract in docs/CONTRACT_V1.md within this package
11
+ (or at https://papermark.com/docs/cli/contract).
12
+
13
+ Safety:
14
+ - Never upload a file the user did not explicitly reference.
15
+ - Never invent a password, expiry date, or email recipient — ask the user.
16
+ - Run `papermark doctor` before other commands if you're unsure the CLI is
17
+ configured. If doctor reports auth failures, surface them to the user and
18
+ suggest `papermark login`.
19
+ - Retry only on error.retryable === true and exit codes 1 or 4.
20
+
21
+ auth:
22
+ type: user_http
23
+ authorization_type: bearer
24
+ instructions: |
25
+ The end user authenticates Papermark on their own machine with
26
+ `papermark login` (OAuth 2.1 device flow). For headless environments, they
27
+ may set PAPERMARK_TOKEN or pipe a token via `papermark auth set --stdin`.
28
+
29
+ entry_point:
30
+ type: command_line
31
+ command: papermark
32
+ version_pin: ">=0.1.0 <2.0.0"
33
+
34
+ commands:
35
+ - name: doctor
36
+ description: Health check. Run before other commands when unsure of state.
37
+ example: papermark doctor --json
38
+ - name: documents.list
39
+ description: List documents in the authenticated team.
40
+ example: papermark documents list --limit 25 --json
41
+ - name: documents.search
42
+ description: Substring-search documents by name.
43
+ example: papermark documents search "q3 deck" --json
44
+ - name: documents.upload
45
+ description: Upload a local file and create a document.
46
+ example: papermark documents upload ./deck.pdf --link --json
47
+ - name: links.create
48
+ description: Create a share link for a document or dataroom.
49
+ example: papermark links create --document <id> --password <pw> --json
50
+ - name: views.list
51
+ description: List view events for a share link.
52
+ example: papermark views list --link <link-id> --json
53
+
54
+ contract: docs/CONTRACT_V1.md
55
+ contact_email: support@papermark.com
56
+ legal_info_url: https://www.papermark.com/legal
package/package.json CHANGED
@@ -1,27 +1,73 @@
1
1
  {
2
2
  "name": "papermark",
3
- "version": "0.0.1",
4
- "description": "Papermark CLI. Full release coming soon. See https://www.papermark.com and https://github.com/mfts/papermark.",
3
+ "version": "0.2.0",
4
+ "description": "Command-line interface for Papermark share documents, create data rooms, generate access links, and read analytics.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.papermark.com",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/mfts/papermark.git"
9
+ "url": "git+https://github.com/papermark/papermark-cli.git"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/mfts/papermark/issues"
12
+ "url": "https://github.com/papermark/papermark-cli/issues"
13
13
  },
14
14
  "keywords": [
15
15
  "papermark",
16
- "cli",
17
- "documents",
18
- "document-sharing",
19
16
  "dataroom",
20
- "share-links",
21
- "analytics"
17
+ "datarooms",
18
+ "data room",
19
+ "virtual data room",
20
+ "document sharing",
21
+ "secure file sharing",
22
+ "access links",
23
+ "analytics",
24
+ "cli"
22
25
  ],
26
+ "type": "module",
27
+ "bin": {
28
+ "papermark": "dist/index.js"
29
+ },
23
30
  "files": [
31
+ "dist",
32
+ "docs",
33
+ "skills",
34
+ "openai.yaml",
24
35
  "README.md",
25
36
  "LICENSE"
26
- ]
37
+ ],
38
+ "engines": {
39
+ "node": ">=24"
40
+ },
41
+ "scripts": {
42
+ "build": "tsup",
43
+ "dev": "tsx src/index.ts",
44
+ "typecheck": "tsc --noEmit",
45
+ "test": "vitest run",
46
+ "test:watch": "vitest",
47
+ "changeset": "changeset",
48
+ "version": "changeset version",
49
+ "release": "npm run build && changeset publish",
50
+ "prepublishOnly": "npm run build"
51
+ },
52
+ "dependencies": {
53
+ "chalk": "^5.3.0",
54
+ "commander": "^14.0.3",
55
+ "conf": "^13.0.1",
56
+ "mime-types": "^3.0.2",
57
+ "oauth4webapi": "^3.8.5",
58
+ "open": "^11.0.0",
59
+ "ora": "^9.4.0",
60
+ "prompts": "^2.4.2"
61
+ },
62
+ "devDependencies": {
63
+ "@changesets/changelog-github": "^0.6.0",
64
+ "@changesets/cli": "^2.31.0",
65
+ "@types/mime-types": "^3.0.1",
66
+ "@types/node": "^22.13.5",
67
+ "@types/prompts": "^2.4.9",
68
+ "tsup": "^8.3.5",
69
+ "tsx": "^4.21.0",
70
+ "typescript": "^5.7.2",
71
+ "vitest": "^4.1.5"
72
+ }
27
73
  }
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: papermark
3
+ description: >
4
+ Upload documents to Papermark, create password- and email-protected share
5
+ links, read view analytics, and manage datarooms from the command line.
6
+ Use this Skill whenever the user says something like "share this deck",
7
+ "who viewed my pitch", or "make a dataroom for Acme".
8
+ commands:
9
+ - papermark documents list
10
+ - papermark documents upload
11
+ - papermark links create
12
+ - papermark views list
13
+ - papermark doctor
14
+ contract: docs/CONTRACT_V1.md
15
+ ---
16
+
17
+ # Papermark CLI Skill
18
+
19
+ ## When to use this
20
+
21
+ Papermark is a document-sharing and dataroom service. Reach for this Skill
22
+ whenever the user asks you to:
23
+
24
+ - upload a file and hand them a share link
25
+ - check who viewed something they sent
26
+ - organize documents into a dataroom for a deal or diligence process
27
+ - pull analytics (views, viewers, read time) on a document or link
28
+
29
+ Do **not** use this Skill for general file-sharing (use the OS), for email
30
+ composition (use a mail Skill), or for anything outside the Papermark domain.
31
+
32
+ ## Setup
33
+
34
+ Before running any command, verify auth is present:
35
+
36
+ ```bash
37
+ papermark doctor --json
38
+ ```
39
+
40
+ If `checks[*].ok` has any `false`, run `papermark login` (interactive device
41
+ flow). In a non-interactive environment, the user must set `PAPERMARK_TOKEN`,
42
+ pipe a token via `papermark auth set --stdin`, or point
43
+ `PAPERMARK_CREDENTIALS_FILE` at a JSON credentials file.
44
+
45
+ ## Core workflows
46
+
47
+ ### Share a document as a protected link
48
+
49
+ 1. Make sure the document exists:
50
+ ```bash
51
+ papermark documents search "q3 deck" --json
52
+ ```
53
+ 2. If it's not there yet, upload it:
54
+ ```bash
55
+ papermark documents upload ./deck.pdf --json
56
+ ```
57
+ 3. Create the link, asking the user first about password, expiry, email gating,
58
+ and download permission. Never invent a password — either ask or generate
59
+ one and tell the user the exact value:
60
+ ```bash
61
+ papermark links create --document <id> --expires 2026-05-01T00:00:00Z \
62
+ --password "chosen-by-user" --json
63
+ ```
64
+ 4. Return the `url` from the response.
65
+
66
+ ### Answer "who viewed X"
67
+
68
+ 1. Resolve the doc or link by name if the user didn't give an id:
69
+ ```bash
70
+ papermark documents search "acme" --json
71
+ papermark links list --document <id> --json
72
+ ```
73
+ 2. List views:
74
+ ```bash
75
+ papermark views list --link <link-id> --json
76
+ ```
77
+
78
+ ### Create a dataroom
79
+
80
+ Always `papermark doctor` first, then confirm the name with the user. Don't
81
+ invent `internal_name` or `description` — ask or leave blank.
82
+
83
+ ## Output contract
84
+
85
+ All commands support `--json` for machine-parseable output, auto-enabled when
86
+ stdout is piped. The full contract — envelope shape, error codes, exit codes,
87
+ retry semantics — is at `docs/CONTRACT_V1.md` in this package (also at
88
+ <https://papermark.com/docs/cli/contract>).
89
+
90
+ Retry policy: retry only when `error.retryable === true`. Never retry on
91
+ `AUTH_INVALID`, `FORBIDDEN`, `VALIDATION`, or exit code 2/3/5.
92
+
93
+ ## Do not
94
+
95
+ - Upload any file the user didn't explicitly point at.
96
+ - Create share links for documents the user didn't name.
97
+ - Invent passwords, expiry dates, or email recipients — ask.
98
+ - Call tools repeatedly after an `AUTH_INVALID` — surface the error and suggest
99
+ `papermark login`.