norc-cli 0.1.0 → 0.1.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.
- package/README.md +71 -0
- package/dist/index.js +10 -12
- package/package.json +17 -1
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# norc-cli
|
|
2
|
+
|
|
3
|
+
Headless cron job scheduler for [norc](https://norc.app). Manage your machine's crontab from a CLI, pair it with your norc account, and keep a background bridge daemon online for remote admin from the norc web app.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Via npm:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g norc-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Via Homebrew:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
brew install norcapp/norc/norc-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Requires Node.js >= 18.
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
`norc login` / `norc pair` / `norc bridge` talk to the norc.app project by
|
|
24
|
+
default — nothing to configure. Pair this machine with your norc account:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
norc login you@example.com # one-time-code email login
|
|
28
|
+
norc pair # link this machine to your account
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
norc login <email> start email one-time-code login
|
|
35
|
+
norc pair pair this machine with your norc account
|
|
36
|
+
norc jobs list list jobs in this machine's crontab
|
|
37
|
+
norc jobs add <schedule> <cmd> add a job (schedule in 5-field cron syntax)
|
|
38
|
+
norc jobs rm <id> remove a job by id
|
|
39
|
+
norc jobs enable <id> enable a job
|
|
40
|
+
norc jobs disable <id> disable a job
|
|
41
|
+
norc runs --tail tail run history (not yet available)
|
|
42
|
+
norc bridge run the bridge daemon (stay online, admin from norc web)
|
|
43
|
+
norc service install register+start the per-user background service
|
|
44
|
+
norc service uninstall stop+remove the per-user background service
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Background service
|
|
48
|
+
|
|
49
|
+
`norc service install` registers a per-user background service (LaunchAgent on macOS) that runs the bridge daemon automatically. Uninstall it before removing the CLI:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
norc service uninstall
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If installed via Homebrew, run this before `brew uninstall norc-cli` — Homebrew formulas have no uninstall hook, so a stale service would otherwise be left behind.
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
From `apps/cli` in the [norc monorepo](https://github.com/redcoatasher/norc):
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
pnpm install
|
|
63
|
+
pnpm test # vitest
|
|
64
|
+
pnpm typecheck # tsc --noEmit
|
|
65
|
+
pnpm build # bundle to dist/index.js
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Links
|
|
69
|
+
|
|
70
|
+
- [norc.app](https://norc.app)
|
|
71
|
+
- [Issues](https://github.com/redcoatasher/norc/issues)
|
package/dist/index.js
CHANGED
|
@@ -30101,6 +30101,10 @@ function shouldShowDeprecationWarning() {
|
|
|
30101
30101
|
}
|
|
30102
30102
|
if (shouldShowDeprecationWarning()) console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
|
|
30103
30103
|
|
|
30104
|
+
// src/supabase-config.ts
|
|
30105
|
+
var DEFAULT_SUPABASE_URL = "https://eiuegfdaddrisfboijyy.supabase.co";
|
|
30106
|
+
var DEFAULT_SUPABASE_ANON_KEY = "sb_publishable_qGCC0eLvfmXwL86zA1SLHA_q8rFMCcG";
|
|
30107
|
+
|
|
30104
30108
|
// src/config.ts
|
|
30105
30109
|
var import_promises = require("node:fs/promises");
|
|
30106
30110
|
var import_node_os = require("node:os");
|
|
@@ -31000,7 +31004,7 @@ async function uninstallService(deps = defaultServiceDeps(process.execPath)) {
|
|
|
31000
31004
|
}
|
|
31001
31005
|
|
|
31002
31006
|
// src/index.ts
|
|
31003
|
-
var VERSION = "0.1.
|
|
31007
|
+
var VERSION = "0.1.1";
|
|
31004
31008
|
var HELP = `norc \u2014 headless job scheduler CLI
|
|
31005
31009
|
|
|
31006
31010
|
Usage:
|
|
@@ -31017,14 +31021,11 @@ Usage:
|
|
|
31017
31021
|
norc service uninstall stop+remove the per-user background service
|
|
31018
31022
|
|
|
31019
31023
|
Env:
|
|
31020
|
-
NORC_SUPABASE_URL, NORC_SUPABASE_ANON_KEY
|
|
31024
|
+
NORC_SUPABASE_URL, NORC_SUPABASE_ANON_KEY override the norc.app project this CLI talks to (self-hosted/dev)
|
|
31021
31025
|
`;
|
|
31022
31026
|
function supabase() {
|
|
31023
|
-
const url = process.env.NORC_SUPABASE_URL;
|
|
31024
|
-
const anon = process.env.NORC_SUPABASE_ANON_KEY;
|
|
31025
|
-
if (!url || !anon) {
|
|
31026
|
-
throw new Error("NORC_SUPABASE_URL and NORC_SUPABASE_ANON_KEY must be set for this command");
|
|
31027
|
-
}
|
|
31027
|
+
const url = process.env.NORC_SUPABASE_URL ?? DEFAULT_SUPABASE_URL;
|
|
31028
|
+
const anon = process.env.NORC_SUPABASE_ANON_KEY ?? DEFAULT_SUPABASE_ANON_KEY;
|
|
31028
31029
|
return createClient(url, anon);
|
|
31029
31030
|
}
|
|
31030
31031
|
async function prompt(question) {
|
|
@@ -31108,11 +31109,8 @@ async function cmdJobs(args) {
|
|
|
31108
31109
|
}
|
|
31109
31110
|
}
|
|
31110
31111
|
async function cmdBridge() {
|
|
31111
|
-
const url = process.env.NORC_SUPABASE_URL;
|
|
31112
|
-
const anonKey = process.env.NORC_SUPABASE_ANON_KEY;
|
|
31113
|
-
if (!url || !anonKey) {
|
|
31114
|
-
throw new Error("NORC_SUPABASE_URL and NORC_SUPABASE_ANON_KEY must be set for this command");
|
|
31115
|
-
}
|
|
31112
|
+
const url = process.env.NORC_SUPABASE_URL ?? DEFAULT_SUPABASE_URL;
|
|
31113
|
+
const anonKey = process.env.NORC_SUPABASE_ANON_KEY ?? DEFAULT_SUPABASE_ANON_KEY;
|
|
31116
31114
|
await runBridge({ supabaseUrl: url, anonKey }, systemCrontabIo);
|
|
31117
31115
|
}
|
|
31118
31116
|
async function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norc-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Headless cron job scheduler for norc — manage crontab, pair machines, run the bridge daemon.",
|
|
5
|
+
"homepage": "https://norc.app/cli",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/redcoatasher/norc.git",
|
|
9
|
+
"directory": "apps/cli"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/redcoatasher/norc/issues",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cron",
|
|
15
|
+
"crontab",
|
|
16
|
+
"scheduler",
|
|
17
|
+
"cli",
|
|
18
|
+
"norc"
|
|
19
|
+
],
|
|
4
20
|
"main": "./dist/index.js",
|
|
5
21
|
"files": [
|
|
6
22
|
"dist"
|