readable-cli 0.1.2 → 0.1.3
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/README.md +44 -15
- package/dist/index.js +3574 -13
- package/package.json +9 -6
- package/dist/api.d.ts +0 -13
- package/dist/api.js +0 -43
- package/dist/commands/auth.d.ts +0 -2
- package/dist/commands/auth.js +0 -86
- package/dist/commands/pages.d.ts +0 -2
- package/dist/commands/pages.js +0 -99
- package/dist/commands/publish.d.ts +0 -2
- package/dist/commands/publish.js +0 -128
- package/dist/config.d.ts +0 -9
- package/dist/config.js +0 -34
- package/dist/fmt.d.ts +0 -14
- package/dist/fmt.js +0 -41
- package/dist/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -16,20 +16,26 @@ npx readable-cli publish README.md
|
|
|
16
16
|
|
|
17
17
|
## Authentication
|
|
18
18
|
|
|
19
|
-
Get your API key from [readable.ashwinsathian.com](https://readable.ashwinsathian.com) → My Pages → Settings → API Keys. Keys look like `rdbl_xxxx…` (45 chars).
|
|
20
|
-
|
|
21
19
|
```bash
|
|
22
20
|
readable login
|
|
23
|
-
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This opens your browser to authorize the CLI. Sign in (or create an account) and you're done — no copy-pasting required. Your key is saved automatically to `~/.readable/config.json`.
|
|
24
|
+
|
|
25
|
+
**CI / non-interactive environments:** pass your key directly with `--key`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
24
28
|
readable login --key rdbl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
25
29
|
```
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
You can also set it via environment variable, which takes precedence over the config file:
|
|
28
32
|
|
|
29
33
|
```bash
|
|
30
34
|
export READABLE_API_KEY=rdbl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
31
35
|
```
|
|
32
36
|
|
|
37
|
+
Generate keys manually at [readable.ashwinsathian.com](https://readable.ashwinsathian.com) → My Pages → Settings → API Keys.
|
|
38
|
+
|
|
33
39
|
## Commands
|
|
34
40
|
|
|
35
41
|
### `readable publish [file]`
|
|
@@ -40,6 +46,7 @@ Publish a Markdown file as a Readable page.
|
|
|
40
46
|
readable publish README.md
|
|
41
47
|
readable publish NOTES.md --slug my-notes
|
|
42
48
|
readable publish NOTES.md --visibility unlisted
|
|
49
|
+
readable publish README.md --open # opens the page in your browser
|
|
43
50
|
```
|
|
44
51
|
|
|
45
52
|
**Publish from stdin:**
|
|
@@ -70,6 +77,7 @@ Options:
|
|
|
70
77
|
| `--visibility <v>` | `public` (default) or `unlisted` |
|
|
71
78
|
| `--update <id>` | Update an existing page by ID |
|
|
72
79
|
| `--watch` | Watch file and re-publish on change |
|
|
80
|
+
| `--open` | Open the page in your browser after publishing |
|
|
73
81
|
|
|
74
82
|
---
|
|
75
83
|
|
|
@@ -82,26 +90,28 @@ readable pages list
|
|
|
82
90
|
readable pages list --json # machine-readable output
|
|
83
91
|
```
|
|
84
92
|
|
|
85
|
-
### `readable pages
|
|
93
|
+
### `readable pages open <id>`
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
Open a page in your browser. Pass `--print` to print the URL without opening a browser.
|
|
88
96
|
|
|
89
97
|
```bash
|
|
90
|
-
readable pages
|
|
91
|
-
readable pages
|
|
98
|
+
readable pages open abc123 # opens browser
|
|
99
|
+
readable pages open abc123 --print # prints URL only
|
|
100
|
+
readable pages open my-custom-slug # works with slugs too
|
|
92
101
|
```
|
|
93
102
|
|
|
94
|
-
### `readable pages
|
|
103
|
+
### `readable pages delete <id>`
|
|
95
104
|
|
|
96
|
-
|
|
105
|
+
Delete a page by ID or slug. Shows the page title and URL in the confirmation prompt.
|
|
97
106
|
|
|
98
107
|
```bash
|
|
99
|
-
readable pages
|
|
108
|
+
readable pages delete abc123
|
|
109
|
+
readable pages delete abc123 --yes # skip confirmation prompt
|
|
100
110
|
```
|
|
101
111
|
|
|
102
112
|
### `readable whoami`
|
|
103
113
|
|
|
104
|
-
Show the active API key and
|
|
114
|
+
Show the active API key, base URL, and where the key was loaded from (env var or config file).
|
|
105
115
|
|
|
106
116
|
### `readable logout`
|
|
107
117
|
|
|
@@ -118,6 +128,9 @@ YAML frontmatter in your Markdown is parsed and applied automatically:
|
|
|
118
128
|
title: My Release Notes
|
|
119
129
|
slug: release-notes-v2
|
|
120
130
|
visibility: public
|
|
131
|
+
description: Summary of changes in v2.
|
|
132
|
+
author: Ashwin Sathian
|
|
133
|
+
date: 2026-05-24
|
|
121
134
|
---
|
|
122
135
|
|
|
123
136
|
# Release Notes v2
|
|
@@ -125,7 +138,16 @@ visibility: public
|
|
|
125
138
|
Content here…
|
|
126
139
|
```
|
|
127
140
|
|
|
128
|
-
Supported frontmatter fields:
|
|
141
|
+
Supported frontmatter fields:
|
|
142
|
+
|
|
143
|
+
| Field | Type | Notes |
|
|
144
|
+
|-------|------|-------|
|
|
145
|
+
| `title` | string | Overrides the extracted H1 title (max 200 chars) |
|
|
146
|
+
| `slug` | string | Custom URL slug (max 60 chars) |
|
|
147
|
+
| `visibility` | `"public"` \| `"unlisted"` | Defaults to public |
|
|
148
|
+
| `description` | string | SEO meta description (max 300 chars) |
|
|
149
|
+
| `author` | string | Stored as metadata (max 100 chars) |
|
|
150
|
+
| `date` | string | Stored as metadata, any format |
|
|
129
151
|
|
|
130
152
|
---
|
|
131
153
|
|
|
@@ -147,10 +169,17 @@ Use the `READABLE_API_KEY` secret to publish from CI:
|
|
|
147
169
|
- name: Publish to Readable
|
|
148
170
|
env:
|
|
149
171
|
READABLE_API_KEY: ${{ secrets.READABLE_API_KEY }}
|
|
150
|
-
run:
|
|
172
|
+
run: |
|
|
173
|
+
if [ -n "${{ vars.READABLE_PAGE_ID }}" ]; then
|
|
174
|
+
npx readable-cli publish CHANGELOG.md --update ${{ vars.READABLE_PAGE_ID }}
|
|
175
|
+
else
|
|
176
|
+
npx readable-cli publish CHANGELOG.md --slug release-notes --visibility public
|
|
177
|
+
fi
|
|
151
178
|
```
|
|
152
179
|
|
|
153
|
-
|
|
180
|
+
Set `READABLE_API_KEY` under Settings → Secrets → Actions. Set `READABLE_PAGE_ID` as a repository variable to reuse the same URL on every run.
|
|
181
|
+
|
|
182
|
+
See [.github/examples/publish-to-readable.yml](https://github.com/AshwinSathian/readable/blob/main/.github/examples/publish-to-readable.yml) for a complete example workflow.
|
|
154
183
|
|
|
155
184
|
---
|
|
156
185
|
|