clipcast-mac 0.0.0-stage → 1.0.1

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -2
  3. package/bin/cli.js +135 -0
  4. package/package.json +25 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ClipCast Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,77 @@
1
- # Temporary Holding Version
1
+ # ClipCast
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A lightweight, native macOS clipboard history picker built in Swift + AppKit, bringing a Raycast / macOS 26–27 Spotlight-style clipboard manager (`⌘Space → ⌘4` and `⌘⇧V`) to macOS 12 Monterey and newer.
4
+
5
+ ## Features
6
+
7
+ - **Spotlight-style trigger:** Press `⌘Space` then `⌘4` (within 5 seconds) to dismiss Spotlight and open ClipCast Clipboard, or use the direct shortcut `⌘⇧V` (customizable to `⌥Space`, `⌃⌘V`, `⌥⌘V`).
8
+ - **Rich previews:** Supports plain text, URLs, hex color swatches (`#RRGGBB` / `#RRGGBBAA`), images, and copied files.
9
+ - **Fast search & filters:** Instant text/app search plus `All`, `Text`, `Images`, `Links`, and `Pinned` tabs.
10
+ - **Keyboard-first workflow:**
11
+ - `↑` / `↓` — Navigate items
12
+ - `Enter` — Copy and auto-paste into the previous app
13
+ - `⌘1` – `⌘9` — Quick-paste items 1–9
14
+ - `⌘Enter` / `⇧Enter` — Copy only (without auto-pasting)
15
+ - `⌘P` — Pin / unpin item
16
+ - `⌘⌫` — Delete item
17
+ - `Esc` — Close panel
18
+ - **Privacy-aware:** Ignores concealed/transient clipboard entries from password managers (`org.nspasteboard.TransientType`, `ConcealedType`, `AutoGeneratedType`, 1Password, etc.).
19
+ - **Local storage:** Stores up to 200 unpinned items (plus unlimited pinned items) in `~/Library/Application Support/ClipCast/`.
20
+
21
+ ## Install
22
+
23
+ ### 1. Homebrew (Recommended)
24
+ ```bash
25
+ brew install --cask vohoangankhanh/tap/clipcast
26
+ ```
27
+
28
+ ### 2. One-Line Terminal Installer (`curl`)
29
+ ```bash
30
+ curl -fsSL https://raw.githubusercontent.com/vohoangankhanh/ClipCast/main/install.sh | zsh
31
+ ```
32
+
33
+ ### 3. npm / npx
34
+ ```bash
35
+ npx clipcast-mac
36
+ ```
37
+
38
+ ### 4. Nix Flake (macOS)
39
+ ```bash
40
+ nix profile install github:vohoangankhanh/ClipCast
41
+ ```
42
+
43
+ ### 5. GitHub Releases (`.dmg` / `.zip`)
44
+ Download `ClipCast-<version>-universal.dmg` (or `.zip`) from the [Releases](https://github.com/vohoangankhanh/ClipCast/releases) page, drag `ClipCast.app` into `/Applications`, and if macOS Gatekeeper warns on an ad-hoc signed build, run:
45
+ ```bash
46
+ xattr -cr /Applications/ClipCast.app
47
+ ```
48
+
49
+ ### 6. Build from Source (or MacPorts)
50
+ ```bash
51
+ git clone https://github.com/vohoangankhanh/ClipCast.git ClipCast
52
+ cd ClipCast
53
+ ./build.sh
54
+ open /Applications/ClipCast.app
55
+ ```
56
+ A MacPorts template is also available at `packaging/macports/Portfile`.
57
+
58
+ To build universal release artifacts (`.zip`, `.dmg`, `SHA256SUMS.txt` in `dist/`):
59
+ ```bash
60
+ ./build.sh --release 1.0.0
61
+ ```
62
+
63
+ ## Permissions
64
+
65
+ Grant **Accessibility** permission to **ClipCast** in **System Settings / System Preferences → Privacy & Security → Accessibility** to enable:
66
+ 1. Auto-pasting directly into the previous application on `Enter`
67
+ 2. Global `⌘Space → ⌘4` chord detection
68
+
69
+ (`⌘⇧V` copy-to-clipboard works without Accessibility permission.)
70
+
71
+ ## Automated Publishing (GitHub Actions)
72
+
73
+ Pushing a tag `v*` (e.g. `git tag v1.0.0 && git push origin v1.0.0`) automatically builds the universal `.dmg` & `.zip` and creates a GitHub Release.
74
+
75
+ Optional repository secrets to also auto-publish to Homebrew Tap and npm:
76
+ - `HOMEBREW_TAP_TOKEN`: GitHub PAT with `contents:write` access to `<owner>/homebrew-tap`
77
+ - `NPM_TOKEN`: npm Token (or configure **Trusted Publisher (OIDC)** on npmjs.com for `release.yml`)
package/bin/cli.js ADDED
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const https = require("https");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const os = require("os");
8
+ const crypto = require("crypto");
9
+ const { execFileSync } = require("child_process");
10
+
11
+ if (process.platform !== "darwin") {
12
+ console.error("ClipCast only supports macOS (darwin).");
13
+ process.exit(1);
14
+ }
15
+
16
+ const pkg = require("../package.json");
17
+ const version = pkg.version;
18
+ const appDest = "/Applications/ClipCast.app";
19
+
20
+ function resolveRepo() {
21
+ if (process.env.CLIPCAST_REPO) {
22
+ return process.env.CLIPCAST_REPO;
23
+ }
24
+ const url = (pkg.repository && pkg.repository.url) || "";
25
+ const match = url.match(/github\.com[:/]([^/]+\/[^/.]+)(?:\.git)?/i);
26
+ if (match) {
27
+ return match[1];
28
+ }
29
+ console.error(
30
+ "Missing GitHub repository URL in package.json. Set CLIPCAST_REPO=owner/repo or publish via GitHub Actions."
31
+ );
32
+ process.exit(1);
33
+ }
34
+
35
+ function downloadBuffer(url, redirectsLeft = 5) {
36
+ return new Promise((resolve, reject) => {
37
+ https
38
+ .get(url, { headers: { "User-Agent": "clipcast-mac-installer" } }, (res) => {
39
+ if (
40
+ res.statusCode >= 300 &&
41
+ res.statusCode < 400 &&
42
+ res.headers.location &&
43
+ redirectsLeft > 0
44
+ ) {
45
+ res.resume();
46
+ return resolve(downloadBuffer(res.headers.location, redirectsLeft - 1));
47
+ }
48
+ if (res.statusCode !== 200) {
49
+ res.resume();
50
+ return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
51
+ }
52
+ const chunks = [];
53
+ res.on("data", (chunk) => chunks.push(chunk));
54
+ res.on("end", () => resolve(Buffer.concat(chunks)));
55
+ })
56
+ .on("error", reject);
57
+ });
58
+ }
59
+
60
+ async function install() {
61
+ const repo = resolveRepo();
62
+ const zipName = `ClipCast-${version}-universal.zip`;
63
+ const baseUrl = `https://github.com/${repo}/releases/download/v${version}`;
64
+
65
+ console.log(`Downloading ClipCast v${version} from ${repo}...`);
66
+ const [zipBuf, sumsBuf] = await Promise.all([
67
+ downloadBuffer(`${baseUrl}/${zipName}`),
68
+ downloadBuffer(`${baseUrl}/SHA256SUMS.txt`).catch(() => null),
69
+ ]);
70
+
71
+ if (sumsBuf) {
72
+ const sumsText = sumsBuf.toString("utf8");
73
+ const line = sumsText.split(/\r?\n/).find((l) => l.includes(zipName));
74
+ if (line) {
75
+ const expected = line.trim().split(/\s+/)[0];
76
+ const actual = crypto.createHash("sha256").update(zipBuf).digest("hex");
77
+ if (expected !== actual) {
78
+ throw new Error(`SHA256 mismatch! Expected ${expected}, got ${actual}`);
79
+ }
80
+ console.log("SHA256 verified.");
81
+ }
82
+ }
83
+
84
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "clipcast-"));
85
+ const zipPath = path.join(tmpDir, zipName);
86
+ const extractDir = path.join(tmpDir, "extracted");
87
+ fs.mkdirSync(extractDir, { recursive: true });
88
+ fs.writeFileSync(zipPath, zipBuf);
89
+
90
+ try {
91
+ execFileSync("/usr/bin/ditto", ["-xk", zipPath, extractDir], { stdio: "inherit" });
92
+ const builtApp = path.join(extractDir, "ClipCast.app");
93
+ if (!fs.existsSync(builtApp)) {
94
+ throw new Error("ClipCast.app not found in archive.");
95
+ }
96
+ try {
97
+ execFileSync("/usr/bin/pkill", ["-x", "ClipCast"]);
98
+ } catch (_) {
99
+ // Not running
100
+ }
101
+ fs.rmSync(appDest, { recursive: true, force: true });
102
+ execFileSync("/usr/bin/ditto", [builtApp, appDest], { stdio: "inherit" });
103
+ execFileSync("/usr/bin/open", ["-a", appDest]);
104
+ console.log(`Installed and launched: ${appDest}`);
105
+ console.log(
106
+ "Tip: Grant Accessibility permission to ClipCast in System Settings -> Privacy & Security -> Accessibility for auto-paste and Cmd+Space -> Cmd+4."
107
+ );
108
+ } finally {
109
+ fs.rmSync(tmpDir, { recursive: true, force: true });
110
+ }
111
+ }
112
+
113
+ function uninstall() {
114
+ try {
115
+ execFileSync("/usr/bin/pkill", ["-x", "ClipCast"]);
116
+ } catch (_) {}
117
+ if (fs.existsSync(appDest)) {
118
+ fs.rmSync(appDest, { recursive: true, force: true });
119
+ console.log(`Removed ${appDest}`);
120
+ } else {
121
+ console.log("ClipCast.app is not installed.");
122
+ }
123
+ }
124
+
125
+ const cmd = process.argv[2] || "install";
126
+ if (cmd === "uninstall") {
127
+ uninstall();
128
+ } else if (cmd === "install") {
129
+ install().catch((err) => {
130
+ console.error("Install failed:", err.message);
131
+ process.exit(1);
132
+ });
133
+ } else {
134
+ console.log("Usage: clipcast [install|uninstall]");
135
+ }
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "clipcast-mac",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": "Install ClipCast (Raycast & macOS 26-27 style clipboard history picker for macOS 12+)",
5
+ "license": "MIT",
6
+ "os": [
7
+ "darwin"
8
+ ],
9
+ "bin": {
10
+ "clipcast": "bin/cli.js"
11
+ },
12
+ "keywords": [
13
+ "macos",
14
+ "clipboard",
15
+ "raycast",
16
+ "spotlight",
17
+ "productivity"
18
+ ],
19
+ "engines": {
20
+ "node": ">=16"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/vohoangankhanh/ClipCast.git"
25
+ },
26
+ "homepage": "https://github.com/vohoangankhanh/ClipCast"
27
+ }