@cyber-supplies/cysu 0.4.0 → 0.6.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.
Files changed (4) hide show
  1. package/README.md +127 -0
  2. package/index.js +2 -0
  3. package/package.json +26 -15
  4. package/bin/cysu +0 -0
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # Cyber Supplies CLI
2
+
3
+ This is the CLI the agent and user use for interacting with our backend.
4
+
5
+ ## Installing
6
+
7
+ On Linux or macOS, run the installer. Node.js (npm and npx) and git are required:
8
+
9
+ ```sh
10
+ curl -fsSL https://cysu-gateway-670100724771.europe-west1.run.app/install.sh | sh
11
+ ```
12
+
13
+ On Windows PowerShell, install the CLI with npm and the agent skill from a local checkout:
14
+
15
+ ```powershell
16
+ npm install -g @cyber-supplies/cysu
17
+ git clone https://github.com/cyber-supplies/cysu-cli.git
18
+ npx -y skills add .\cysu-cli -g
19
+ ```
20
+
21
+ Set `CYSU_TOKEN`, run `cysu key init`, then use `cysu debug check` to check the token and gateway. `cysu proxy install` is supported only on Linux.
22
+
23
+ ## Build From Source
24
+
25
+ ```
26
+ go vet ./... 2>&1 && go build -o cysu ./cmd/cysu 2>&1 && echo "BUILD OK"
27
+ ./cysu help
28
+ ```
29
+
30
+ ## Releasing
31
+
32
+ The repository secret `NPM_TOKEN` must be a granular npm token with permission to publish to the `@cyber-supplies` scope and bypass 2FA. A new version tag builds Linux, macOS, and Windows binaries for x64 and arm64, checks the generated npm packages on native runners, and publishes the platform packages before `@cyber-supplies/cysu`. npm will not overwrite an existing version.
33
+
34
+ ```sh
35
+ git checkout main && git pull
36
+ git tag -a v0.5.0 -m "v0.5.0"
37
+ git push origin v0.5.0
38
+ gh run watch --exit-status
39
+ ```
40
+
41
+ ## Environment Variables
42
+
43
+ `CYSU_TOKEN` - Supplies the API token.
44
+
45
+ `CYSU_PROVIDER` - The default provider: `AGENTS`, `CLAUDE`, or `CODEX`.
46
+
47
+ ## Usage
48
+
49
+ ```
50
+ cysu - CyberSupplies CLI
51
+
52
+ Usage:
53
+ cysu <resource> <action> [flags]
54
+
55
+ Storage:
56
+ cysu storage list [--dir <dir>]
57
+ cysu storage upload --file <local> --path <path>
58
+ cysu storage download --path <path> --output <local>
59
+ cysu storage read --path <path>
60
+ cysu storage delete --path <path>
61
+
62
+ JavaScript:
63
+ cysu javascript add --url <url> [--url <url>...]
64
+ cysu javascript list [--domain <domain>]
65
+ cysu javascript download --domain <domain>
66
+ cysu javascript clear
67
+
68
+ Endpoints:
69
+ cysu endpoints list [--domain <domain>] [--path <path>] [--method <method>] [--full]
70
+
71
+ cysu endpoints list-scope
72
+
73
+ cysu endpoints add-scope --scope <regex>
74
+ cysu endpoints set-scope --scope <regex>
75
+
76
+ Notes:
77
+ cysu notes list [--domain <regex>] [--path <regex>]
78
+
79
+ cysu notes create --domain <domain> [--path <path>] --content <content>
80
+ cysu notes modify --note <note> [--domain <domain>] [--path <path>] [--content <content>]
81
+ cysu notes delete --note <note>
82
+
83
+ Email:
84
+ cysu email accounts
85
+ cysu email list --account <accountsId>
86
+ cysu email read --account <accountId> --email <emailId>
87
+
88
+ Profiles:
89
+ cysu profiles install --scope <global|project> --profile <profile> [--provider <provider>]
90
+ cysu profiles uninstall --scope <global|project> [--provider <provider>]
91
+
92
+ cysu profiles list
93
+ cysu profiles read --profile <profile>
94
+ cysu profiles remove --profile <profile>
95
+
96
+ cysu profiles create --profile <profile> [--example]
97
+ cysu profiles edit [--profile <profile>] [--all]
98
+ cysu profiles save [--profile <profile>] [--all]
99
+
100
+ Accounts:
101
+ cysu accounts list [--location <location>]
102
+ cysu accounts get --account <account>
103
+ cysu accounts set-cookie --account <account> --cookie <cookie>
104
+
105
+ cysu accounts create --username <user> --password <pass> --location <location>
106
+ cysu accounts modify --account <account> [--username <user>] [--password <pass>] [--location <location>]
107
+ cysu accounts remove --account <account>
108
+
109
+ Key:
110
+ cysu key init [--force]
111
+ cysu key path
112
+ cysu key verify
113
+ ```
114
+
115
+ ## Authentication
116
+
117
+ The recommended way to authenticate is to set an environment variable:
118
+
119
+ ```
120
+ export CYSU_TOKEN=sk-xxxx
121
+ ```
122
+
123
+ It is also possible to pass the token directly via a CLI flag:
124
+
125
+ ```
126
+ cysu debug check --token sk-xxxx
127
+ ```
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";var P=Object.create;var l=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var J=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of k(e))!G.call(o,n)&&n!==r&&l(o,n,{get:()=>e[n],enumerable:!(t=_(e,n))||t.enumerable});return o};var d=(o,e,r)=>(r=o!=null?P(w(o)):{},J(e||!o||!o.__esModule?l(r,"default",{value:o,enumerable:!0}):r,o));var s=require("node:process");var c=require("node:path");var f=require("node:fs"),g=require("node:fs/promises"),S=require("node:os"),u=d(require("node:process"),1),m=()=>(0,S.platform)()==="win32",v=o=>(0,g.access)(o,f.constants.X_OK).then(()=>!0,()=>!1),a=o=>(console.error(o),u.default.exit(1));var h=(o,e)=>{let r=o[e];if(!r)return a(`Unsupported platform: ${e}. Supported: ${Object.keys(o).join(", ")}`);let t=r.name.join("/");try{let n=require.resolve((0,c.join)(...r.name,"package.json"));return(0,c.join)((0,c.dirname)(n),r.bin)}catch(n){let{code:p,message:I}=n;return a(p==="MODULE_NOT_FOUND"?`The platform package ${t} is not installed. Remove node_modules and install again, and check that optional dependencies are not being skipped.`:`Could not resolve the platform package ${t}: ${I}`)}};var x=require("node:child_process"),E=require("node:os"),i=d(require("node:process"),1);var U=["SIGINT","SIGQUIT"],$=["SIGTERM","SIGHUP","SIGUSR1","SIGUSR2"],N=async(o,e,r)=>{var t,n;await O(o)?(n=(t=i.default).execve)==null||n.call(t,o,[o,...e],r):R(o,e,r)},O=async o=>!m()&&typeof i.default.execve=="function"&&await v(o),R=(o,e,r)=>{let t=(0,x.spawn)(o,e,{stdio:"inherit",env:r});t.on("error",n=>a(`Failed to spawn ${o}: ${n.message}`)),t.on("exit",(n,p)=>p?j(p):i.default.exit(n??0)),b(t)},b=o=>{m()||(U.forEach(e=>i.default.on(e,()=>{})),$.forEach(e=>i.default.on(e,()=>o.kill(e))))},j=o=>(i.default.removeAllListeners(o),i.default.kill(i.default.pid,o),i.default.exit(128+E.constants.signals[o]));var M={"linux_arm64":{"name":["@cyber-supplies","cysu_linux_arm64"],"bin":"cysu"},"linux_x64":{"name":["@cyber-supplies","cysu_linux_amd64"],"bin":"cysu"},"darwin_x64":{"name":["@cyber-supplies","cysu_darwin_amd64"],"bin":"cysu"},"darwin_arm64":{"name":["@cyber-supplies","cysu_darwin_arm64"],"bin":"cysu"},"win32_x64":{"name":["@cyber-supplies","cysu_windows_amd64"],"bin":"cysu.exe"},"win32_arm64":{"name":["@cyber-supplies","cysu_windows_arm64"],"bin":"cysu.exe"}};N(h(M,s.platform+"_"+s.arch),s.argv.slice(2),s.env);
package/package.json CHANGED
@@ -1,26 +1,37 @@
1
1
  {
2
2
  "name": "@cyber-supplies/cysu",
3
- "version": "0.4.0",
4
- "description": "Cyber Supplies CLI (cysu). Compiled binary for Linux x64.",
5
- "license": "UNLICENSED",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/cyber-supplies/cysu-cli.git"
3
+ "version": "0.6.0",
4
+ "bin": {
5
+ "cysu": "index.js"
6
+ },
7
+ "optionalDependencies": {
8
+ "@cyber-supplies/cysu_linux_arm64": "0.6.0",
9
+ "@cyber-supplies/cysu_linux_amd64": "0.6.0",
10
+ "@cyber-supplies/cysu_darwin_amd64": "0.6.0",
11
+ "@cyber-supplies/cysu_darwin_arm64": "0.6.0",
12
+ "@cyber-supplies/cysu_windows_amd64": "0.6.0",
13
+ "@cyber-supplies/cysu_windows_arm64": "0.6.0"
9
14
  },
10
15
  "os": [
11
- "linux"
16
+ "linux",
17
+ "darwin",
18
+ "win32"
12
19
  ],
13
20
  "cpu": [
21
+ "arm64",
14
22
  "x64"
15
23
  ],
16
- "bin": {
17
- "cysu": "bin/cysu"
18
- },
19
24
  "files": [
20
- "bin/"
25
+ "README.md"
21
26
  ],
22
- "publishConfig": {
23
- "registry": "https://registry.npmjs.org",
24
- "access": "public"
27
+ "keywords": [],
28
+ "license": "UNLICENSED",
29
+ "engines": {
30
+ "node": ">=14.18.0"
31
+ },
32
+ "description": "Cyber Supplies CLI",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/cyber-supplies/cysu-cli"
25
36
  }
26
- }
37
+ }
package/bin/cysu DELETED
Binary file