readable-cli 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +97 -33
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @readable/cli
1
+ # readable-cli
2
2
 
3
- Publish Markdown pages from your terminal.
3
+ Publish Markdown pages from your terminal using [Readable](https://readable.ashwinsathian.com).
4
4
 
5
5
  ## Install
6
6
 
@@ -16,82 +16,146 @@ 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.
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
20
 
21
21
  ```bash
22
22
  readable login
23
- # Paste your API key when prompted, or:
24
- readable login --key rdbl_xxxxxxxxxxxx
23
+ # Paste your API key when prompted, or pass it directly:
24
+ readable login --key rdbl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
25
25
  ```
26
26
 
27
- ## Usage
28
-
29
- ### Publish a file
27
+ Your key is saved to `~/.readable/config.json`. You can also set it via environment variable — useful for CI:
30
28
 
31
29
  ```bash
32
- readable publish README.md
30
+ export READABLE_API_KEY=rdbl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
33
31
  ```
34
32
 
35
- ### Publish from stdin
33
+ ## Commands
34
+
35
+ ### `readable publish [file]`
36
+
37
+ Publish a Markdown file as a Readable page.
36
38
 
37
39
  ```bash
38
- cat NOTES.md | readable publish -
39
- echo "# Hello" | readable publish -
40
+ readable publish README.md
41
+ readable publish NOTES.md --slug my-notes
42
+ readable publish NOTES.md --visibility unlisted
40
43
  ```
41
44
 
42
- ### Custom slug and visibility
45
+ **Publish from stdin:**
43
46
 
44
47
  ```bash
45
- readable publish README.md --slug my-readme --visibility unlisted
48
+ cat CHANGELOG.md | readable publish -
49
+ echo "# Hello world" | readable publish -
46
50
  ```
47
51
 
48
- ### Update an existing page
52
+ **Update an existing page in-place:**
49
53
 
50
54
  ```bash
51
55
  readable publish README.md --update <page-id>
52
56
  ```
53
57
 
54
- ### Watch and auto-republish on save
58
+ **Watch mode auto-republish on every save:**
55
59
 
56
60
  ```bash
57
61
  readable publish README.md --watch
58
62
  readable publish README.md --update <id> --watch
59
63
  ```
60
64
 
61
- ### List your pages
65
+ Options:
66
+
67
+ | Flag | Description |
68
+ |------|-------------|
69
+ | `--slug <slug>` | Set a custom URL slug (e.g. `my-readme`) |
70
+ | `--visibility <v>` | `public` (default) or `unlisted` |
71
+ | `--update <id>` | Update an existing page by ID |
72
+ | `--watch` | Watch file and re-publish on change |
73
+
74
+ ---
75
+
76
+ ### `readable pages list`
77
+
78
+ List all your published pages.
62
79
 
63
80
  ```bash
64
81
  readable pages list
65
- readable pages list --json
82
+ readable pages list --json # machine-readable output
66
83
  ```
67
84
 
68
- ### Delete a page
85
+ ### `readable pages delete <id>`
86
+
87
+ Delete a page by ID.
69
88
 
70
89
  ```bash
71
- readable pages delete <id>
72
- readable pages delete <id> --yes # skip confirmation
90
+ readable pages delete abc123xyz
91
+ readable pages delete abc123xyz --yes # skip confirmation prompt
73
92
  ```
74
93
 
75
- ## Environment variables
94
+ ### `readable pages open <id>`
95
+
96
+ Print the URL of a page.
97
+
98
+ ```bash
99
+ readable pages open abc123xyz
100
+ ```
101
+
102
+ ### `readable whoami`
103
+
104
+ Show the active API key and base URL.
105
+
106
+ ### `readable logout`
76
107
 
77
- | Variable | Description |
78
- | ------------------- | --------------------------------------------- |
79
- | `READABLE_API_KEY` | API key (overrides `~/.readable/config.json`) |
80
- | `READABLE_API_URL` | API base URL (default: production) |
81
- | `NO_COLOR` | Disable ANSI colour output |
108
+ Remove the saved API key from `~/.readable/config.json`.
82
109
 
83
- ## Frontmatter
110
+ ---
111
+
112
+ ## Frontmatter support
84
113
 
85
- Frontmatter in your Markdown is parsed and applied automatically:
114
+ YAML frontmatter in your Markdown is parsed and applied automatically:
86
115
 
87
116
  ```markdown
88
117
  ---
89
- title: My Page
90
- slug: my-page
91
- visibility: unlisted
118
+ title: My Release Notes
119
+ slug: release-notes-v2
120
+ visibility: public
92
121
  ---
93
122
 
94
- # My Page
123
+ # Release Notes v2
95
124
 
96
125
  Content here…
97
126
  ```
127
+
128
+ Supported frontmatter fields: `title`, `slug`, `visibility`.
129
+
130
+ ---
131
+
132
+ ## Environment variables
133
+
134
+ | Variable | Description |
135
+ |----------|-------------|
136
+ | `READABLE_API_KEY` | API key — overrides `~/.readable/config.json` |
137
+ | `READABLE_API_URL` | Override API base URL (default: production) |
138
+ | `NO_COLOR` | Set to any value to disable ANSI colour output |
139
+
140
+ ---
141
+
142
+ ## CI / GitHub Actions
143
+
144
+ Use the `READABLE_API_KEY` secret to publish from CI:
145
+
146
+ ```yaml
147
+ - name: Publish to Readable
148
+ env:
149
+ READABLE_API_KEY: ${{ secrets.READABLE_API_KEY }}
150
+ run: npx readable-cli publish CHANGELOG.md --update ${{ vars.READABLE_PAGE_ID }}
151
+ ```
152
+
153
+ See [.github/examples/publish-to-readable.yml](https://github.com/AshwinSathian/readable/blob/main/.github/examples/publish-to-readable.yml) for a full example.
154
+
155
+ ---
156
+
157
+ ## Links
158
+
159
+ - [readable.ashwinsathian.com](https://readable.ashwinsathian.com) — Create your account
160
+ - [npmjs.com/package/readable-cli](https://www.npmjs.com/package/readable-cli) — npm package
161
+ - [GitHub](https://github.com/AshwinSathian/readable) — Source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "readable-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for Readable — publish Markdown from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,9 +30,11 @@
30
30
  "email": "ashwinsathyan19@gmail.com"
31
31
  },
32
32
  "license": "MIT",
33
+ "homepage": "https://readable.ashwinsathian.com",
33
34
  "repository": {
34
35
  "type": "git",
35
- "url": "git+https://github.com/AshwinSathian/readable.git"
36
+ "url": "git+https://github.com/AshwinSathian/readable.git",
37
+ "directory": "packages/cli"
36
38
  },
37
39
  "keywords": [
38
40
  "readable",