@hynaweb/stage 1.0.2 → 1.0.4

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/bin/cli.js +12 -1
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -11,9 +11,20 @@ const SUPABASE_KEY = 'sb_publishable_sG0q8k6txKHOihBduyr67w_UKfolcvj';
11
11
  const configPath = path.join(require('os').homedir(), '.hyna-stage');
12
12
 
13
13
  async function getApiKey() {
14
+ // Check for --key argument first (Auto-Injection)
15
+ const keyArg = process.argv.find(arg => arg.startsWith('--key='));
16
+ if (keyArg) {
17
+ const key = keyArg.split('=')[1];
18
+ fs.writeFileSync(configPath, key.trim()); // Save it for next time
19
+ return key.trim();
20
+ }
21
+
22
+ // Check cache
14
23
  if (fs.existsSync(configPath)) {
15
24
  return fs.readFileSync(configPath, 'utf8').trim();
16
25
  }
26
+
27
+ // Otherwise prompt
17
28
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
18
29
  return new Promise((resolve) => {
19
30
  rl.question('🔑 Enter your HYNA-Stage API Key: ', (key) => {
@@ -51,7 +62,7 @@ async function main() {
51
62
  }
52
63
  }
53
64
  else if (command === 'down') {
54
- const sandboxId = process.argv[3];
65
+ const sandboxId = process.argv.find(arg => !arg.startsWith('--') && arg !== 'down' && arg !== 'up');
55
66
 
56
67
  if (!sandboxId) {
57
68
  console.error('❌ Please provide a sandbox ID: hyna-stage down <sandbox_id>');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hynaweb/stage",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Instant ephemeral staging environments for AI agents.",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {