@hiyve/cli 1.0.9 → 1.0.11
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 +50 -18
- package/package.json +1 -1
- package/src/commands/init.js +1 -1
- package/src/config.js +2 -2
- package/src/config.test.js +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# hiyve
|
|
1
|
+
# @hiyve/cli
|
|
2
2
|
|
|
3
3
|
Command-line tool for configuring npm to use the private Hiyve SDK registry.
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ Command-line tool for configuring npm to use the private Hiyve SDK registry.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# One command to authenticate and configure npm
|
|
9
|
-
npx hiyve
|
|
9
|
+
npx @hiyve/cli login
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
After login,
|
|
12
|
+
After login, install Hiyve packages normally:
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install @hiyve/rtc-client
|
|
@@ -18,37 +18,56 @@ npm install @hiyve/react @hiyve/react-ui
|
|
|
18
18
|
|
|
19
19
|
## Commands
|
|
20
20
|
|
|
21
|
-
### `
|
|
21
|
+
### `login`
|
|
22
22
|
|
|
23
23
|
Authenticate with Hiyve and configure npm for @hiyve packages.
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
# Interactive mode (prompts for API key)
|
|
27
|
-
npx hiyve
|
|
27
|
+
npx @hiyve/cli login
|
|
28
28
|
|
|
29
|
-
#
|
|
30
|
-
npx hiyve
|
|
29
|
+
# Non-interactive (CI/CD)
|
|
30
|
+
npx @hiyve/cli login --key sk_live_your_secret_key_here
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### `
|
|
33
|
+
### `logout`
|
|
34
34
|
|
|
35
35
|
Remove Hiyve configuration from your ~/.npmrc file.
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npx hiyve
|
|
38
|
+
npx @hiyve/cli logout
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
### `
|
|
41
|
+
### `whoami`
|
|
42
42
|
|
|
43
43
|
Show current authentication status.
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npx hiyve
|
|
46
|
+
npx @hiyve/cli whoami
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### `list`
|
|
50
|
+
|
|
51
|
+
List all available @hiyve packages.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @hiyve/cli list
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `init`
|
|
58
|
+
|
|
59
|
+
Scaffold a new Hiyve project from a template.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx @hiyve/cli init my-app
|
|
63
|
+
npx @hiyve/cli init my-app --template ai
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Templates: `basic`, `ai`, `full`
|
|
67
|
+
|
|
49
68
|
## Getting Your API Key
|
|
50
69
|
|
|
51
|
-
1. Log in to the [Hiyve
|
|
70
|
+
1. Log in to the [Hiyve Developer Console](https://console.hiyve.dev)
|
|
52
71
|
2. Navigate to **API Keys** in the sidebar
|
|
53
72
|
3. Copy your secret key (starts with `sk_test_` or `sk_live_`)
|
|
54
73
|
|
|
@@ -58,17 +77,30 @@ The `login` command:
|
|
|
58
77
|
|
|
59
78
|
1. Validates your API key with the Hiyve registry
|
|
60
79
|
2. Adds two lines to your `~/.npmrc` file:
|
|
61
|
-
|
|
62
|
-
|
|
80
|
+
```
|
|
81
|
+
@hiyve:registry=https://api.hiyve.dev/registry/
|
|
82
|
+
//api.hiyve.dev/registry/:_authToken=sk_live_...
|
|
83
|
+
```
|
|
63
84
|
|
|
64
85
|
This tells npm to fetch `@hiyve/*` packages from the private Hiyve registry instead of the public npm registry.
|
|
65
86
|
|
|
87
|
+
## CI/CD Setup
|
|
88
|
+
|
|
89
|
+
For automated deployments, add registry credentials as environment variables in your CI/CD pipeline. Your project `.npmrc` should use variable expansion:
|
|
90
|
+
|
|
91
|
+
```ini
|
|
92
|
+
@hiyve:registry=https://api.hiyve.dev/registry/
|
|
93
|
+
//api.hiyve.dev/registry/:_authToken=${HIYVE_API_KEY}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Set `HIYVE_API_KEY` in your CI environment (GitHub Actions secrets, AWS SSM, etc.). npm natively expands `${ENV_VAR}` in `.npmrc` files — no custom tooling needed.
|
|
97
|
+
|
|
66
98
|
## Troubleshooting
|
|
67
99
|
|
|
68
100
|
### "Invalid API key" error
|
|
69
101
|
|
|
70
102
|
- Make sure your key starts with `sk_test_` or `sk_live_`
|
|
71
|
-
- Verify your account is active in the
|
|
103
|
+
- Verify your account is active in the developer console
|
|
72
104
|
|
|
73
105
|
### "Connection failed" error
|
|
74
106
|
|
|
@@ -80,7 +112,7 @@ This tells npm to fetch `@hiyve/*` packages from the private Hiyve registry inst
|
|
|
80
112
|
After login, verify your configuration:
|
|
81
113
|
|
|
82
114
|
```bash
|
|
83
|
-
npx hiyve
|
|
115
|
+
npx @hiyve/cli whoami
|
|
84
116
|
```
|
|
85
117
|
|
|
86
118
|
Or check your `~/.npmrc` manually:
|
|
@@ -92,8 +124,8 @@ cat ~/.npmrc | grep hiyve
|
|
|
92
124
|
## Security
|
|
93
125
|
|
|
94
126
|
- Your API key is stored in `~/.npmrc` (standard npm token storage)
|
|
95
|
-
- The
|
|
96
|
-
- Run `hiyve logout` to remove your credentials
|
|
127
|
+
- The key is sent only to the Hiyve registry during npm operations
|
|
128
|
+
- Run `npx @hiyve/cli logout` to remove your credentials
|
|
97
129
|
|
|
98
130
|
## Support
|
|
99
131
|
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -218,7 +218,7 @@ export default defineConfig({
|
|
|
218
218
|
|
|
219
219
|
function generateEnvExample(template) {
|
|
220
220
|
let env = `# Hiyve API Key (from console.hiyve.dev)
|
|
221
|
-
HIYVE_API_KEY=
|
|
221
|
+
HIYVE_API_KEY=pk_live_your_api_key_here
|
|
222
222
|
|
|
223
223
|
# Room configuration
|
|
224
224
|
HIYVE_SIGNALING_URL=https://signal.hiyve.dev
|
package/src/config.js
CHANGED
|
@@ -28,10 +28,10 @@ export function getApiUrl() {
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Get the registry URL for ~/.npmrc (where npm fetches tarballs).
|
|
31
|
-
*
|
|
31
|
+
* Must match the API URL since tarballs are served through the API.
|
|
32
32
|
*/
|
|
33
33
|
export function getRegistryUrl() {
|
|
34
|
-
return PROD_API_URL;
|
|
34
|
+
return _devMode ? DEV_API_URL : PROD_API_URL;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Backwards-compatible named export
|
package/src/config.test.js
CHANGED
|
@@ -22,11 +22,11 @@ describe('config', () => {
|
|
|
22
22
|
setDevMode(false);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
it('getRegistryUrl
|
|
25
|
+
it('getRegistryUrl switches with dev mode', () => {
|
|
26
26
|
setDevMode(false);
|
|
27
27
|
expect(getRegistryUrl()).toBe('https://api.hiyve.dev/registry/');
|
|
28
28
|
setDevMode(true);
|
|
29
|
-
expect(getRegistryUrl()).toBe('https://api.
|
|
29
|
+
expect(getRegistryUrl()).toBe('https://api.muziemedia.com/registry/');
|
|
30
30
|
setDevMode(false);
|
|
31
31
|
});
|
|
32
32
|
});
|