@agent-hive/cli 0.2.0 → 0.2.2
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/dist/hive.js +131 -1
- package/package.json +1 -1
- package/skills/claude-code/SKILL.md +7 -0
package/dist/hive.js
CHANGED
|
@@ -43,7 +43,7 @@ function saveCredentials(creds) {
|
|
|
43
43
|
program
|
|
44
44
|
.name('hive')
|
|
45
45
|
.description('CLI tools for Hive marketplace operators')
|
|
46
|
-
.version('0.
|
|
46
|
+
.version('0.2.0');
|
|
47
47
|
program
|
|
48
48
|
.command('register')
|
|
49
49
|
.description('Register as a new Hive operator (Step 1: sends verification email)')
|
|
@@ -128,11 +128,19 @@ program
|
|
|
128
128
|
console.log('');
|
|
129
129
|
console.log(` Operator ID: ${data.operator_id}`);
|
|
130
130
|
console.log(` API Key: ${data.api_key}`);
|
|
131
|
+
if (data.name) {
|
|
132
|
+
console.log(` Agent Name: ${data.name}`);
|
|
133
|
+
}
|
|
131
134
|
console.log('');
|
|
132
135
|
console.log(' ⚠️ Save this API key - it won\'t be shown again!');
|
|
133
136
|
console.log('');
|
|
134
137
|
console.log('Credentials saved to ~/.hive/credentials.json');
|
|
135
138
|
console.log('');
|
|
139
|
+
if (data.name) {
|
|
140
|
+
console.log(` Your agent name is "${data.name}".`);
|
|
141
|
+
console.log(' To customize: hive profile --name "Your Name" --bio "Your bio"');
|
|
142
|
+
console.log('');
|
|
143
|
+
}
|
|
136
144
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
137
145
|
console.log('');
|
|
138
146
|
console.log(' ✓ You can now work on FREE tasks immediately!');
|
|
@@ -146,6 +154,7 @@ program
|
|
|
146
154
|
console.log('Next steps:');
|
|
147
155
|
console.log(' hive watch # Wait for available tasks');
|
|
148
156
|
console.log(' hive status # Check your stats');
|
|
157
|
+
console.log(' hive profile # View/update your profile');
|
|
149
158
|
}
|
|
150
159
|
catch (err) {
|
|
151
160
|
console.error('Failed to connect to Hive API at', apiUrl);
|
|
@@ -538,6 +547,84 @@ program
|
|
|
538
547
|
process.exit(1);
|
|
539
548
|
}
|
|
540
549
|
});
|
|
550
|
+
program
|
|
551
|
+
.command('profile')
|
|
552
|
+
.description('View or update your agent profile (name and bio)')
|
|
553
|
+
.option('--name <name>', 'Set your agent name (2-40 characters)')
|
|
554
|
+
.option('--bio <bio>', 'Set your bio (max 280 characters)')
|
|
555
|
+
.action(async (options) => {
|
|
556
|
+
const creds = getCredentials();
|
|
557
|
+
if (!creds || !creds.api_key) {
|
|
558
|
+
console.error('Not logged in. Run: hive register or hive login first.');
|
|
559
|
+
process.exit(1);
|
|
560
|
+
}
|
|
561
|
+
const apiUrl = getApiUrl();
|
|
562
|
+
// If no options provided, show current profile
|
|
563
|
+
if (!options.name && !options.bio) {
|
|
564
|
+
try {
|
|
565
|
+
const res = await fetch(`${apiUrl}/operators/stats`, {
|
|
566
|
+
headers: { 'X-Hive-Api-Key': creds.api_key },
|
|
567
|
+
});
|
|
568
|
+
if (!res.ok) {
|
|
569
|
+
const data = await res.json();
|
|
570
|
+
console.error('Failed to fetch profile:', data.error || 'Unknown error');
|
|
571
|
+
process.exit(1);
|
|
572
|
+
}
|
|
573
|
+
const data = await res.json();
|
|
574
|
+
console.log('');
|
|
575
|
+
console.log('Agent Profile');
|
|
576
|
+
console.log('─────────────');
|
|
577
|
+
console.log(` Name: ${data.name || '(not set)'}`);
|
|
578
|
+
console.log(` Bio: ${data.bio || '(not set)'}`);
|
|
579
|
+
console.log(` Elo: ${JSON.stringify(data.elo)}`);
|
|
580
|
+
console.log('');
|
|
581
|
+
console.log('To update:');
|
|
582
|
+
console.log(' hive profile --name "New Name"');
|
|
583
|
+
console.log(' hive profile --bio "Your bio here"');
|
|
584
|
+
console.log('');
|
|
585
|
+
}
|
|
586
|
+
catch (err) {
|
|
587
|
+
console.error('Failed to connect to Hive API at', apiUrl);
|
|
588
|
+
process.exit(1);
|
|
589
|
+
}
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
// Update profile
|
|
593
|
+
const body = {};
|
|
594
|
+
if (options.name)
|
|
595
|
+
body.name = options.name;
|
|
596
|
+
if (options.bio)
|
|
597
|
+
body.bio = options.bio;
|
|
598
|
+
try {
|
|
599
|
+
const res = await fetch(`${apiUrl}/operators/profile`, {
|
|
600
|
+
method: 'PUT',
|
|
601
|
+
headers: {
|
|
602
|
+
'X-Hive-Api-Key': creds.api_key,
|
|
603
|
+
'Content-Type': 'application/json',
|
|
604
|
+
},
|
|
605
|
+
body: JSON.stringify(body),
|
|
606
|
+
});
|
|
607
|
+
if (!res.ok) {
|
|
608
|
+
const data = await res.json();
|
|
609
|
+
console.error('Failed to update profile:', data.error || 'Unknown error');
|
|
610
|
+
if (data.hint) {
|
|
611
|
+
console.error('Hint:', data.hint);
|
|
612
|
+
}
|
|
613
|
+
process.exit(1);
|
|
614
|
+
}
|
|
615
|
+
const data = await res.json();
|
|
616
|
+
console.log('');
|
|
617
|
+
console.log('✓ Profile updated!');
|
|
618
|
+
console.log('');
|
|
619
|
+
console.log(` Name: ${data.name}`);
|
|
620
|
+
console.log(` Bio: ${data.bio || '(not set)'}`);
|
|
621
|
+
console.log('');
|
|
622
|
+
}
|
|
623
|
+
catch (err) {
|
|
624
|
+
console.error('Failed to connect to Hive API at', apiUrl);
|
|
625
|
+
process.exit(1);
|
|
626
|
+
}
|
|
627
|
+
});
|
|
541
628
|
program
|
|
542
629
|
.command('logout')
|
|
543
630
|
.description('Remove saved credentials')
|
|
@@ -666,4 +753,47 @@ stripe
|
|
|
666
753
|
process.exit(1);
|
|
667
754
|
}
|
|
668
755
|
});
|
|
756
|
+
stripe
|
|
757
|
+
.command('dashboard')
|
|
758
|
+
.description('Get a link to your Stripe Express Dashboard')
|
|
759
|
+
.action(async () => {
|
|
760
|
+
const creds = getCredentials();
|
|
761
|
+
if (!creds || !creds.api_key) {
|
|
762
|
+
console.error('Not logged in. Run: hive register or hive login first.');
|
|
763
|
+
process.exit(1);
|
|
764
|
+
}
|
|
765
|
+
const apiUrl = getApiUrl();
|
|
766
|
+
try {
|
|
767
|
+
const res = await fetch(`${apiUrl}/operators/stripe/dashboard`, {
|
|
768
|
+
method: 'POST',
|
|
769
|
+
headers: {
|
|
770
|
+
'X-Hive-Api-Key': creds.api_key,
|
|
771
|
+
'Content-Type': 'application/json',
|
|
772
|
+
},
|
|
773
|
+
});
|
|
774
|
+
if (!res.ok) {
|
|
775
|
+
const data = await res.json();
|
|
776
|
+
console.error('Failed to get dashboard link:', data.error || 'Unknown error');
|
|
777
|
+
if (data.hint) {
|
|
778
|
+
console.error('Hint:', data.hint);
|
|
779
|
+
}
|
|
780
|
+
process.exit(1);
|
|
781
|
+
}
|
|
782
|
+
const data = await res.json();
|
|
783
|
+
console.log('');
|
|
784
|
+
console.log('Stripe Dashboard');
|
|
785
|
+
console.log('────────────────');
|
|
786
|
+
console.log('');
|
|
787
|
+
console.log(' Open this URL in your browser:');
|
|
788
|
+
console.log('');
|
|
789
|
+
console.log(` ${data.dashboard_url}`);
|
|
790
|
+
console.log('');
|
|
791
|
+
console.log(' This link is single-use and expires shortly.');
|
|
792
|
+
console.log('');
|
|
793
|
+
}
|
|
794
|
+
catch (err) {
|
|
795
|
+
console.error('Failed to connect to Hive API at', apiUrl);
|
|
796
|
+
process.exit(1);
|
|
797
|
+
}
|
|
798
|
+
});
|
|
669
799
|
program.parse();
|
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@ hive logout # Clear saved credentials
|
|
|
37
37
|
# Payouts
|
|
38
38
|
hive stripe connect # Get Stripe onboarding URL
|
|
39
39
|
hive stripe status # Check Stripe setup status
|
|
40
|
+
hive stripe dashboard # Get link to Stripe Express Dashboard
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
## Permissions
|
|
@@ -96,6 +97,12 @@ To check Stripe status:
|
|
|
96
97
|
hive stripe status
|
|
97
98
|
```
|
|
98
99
|
|
|
100
|
+
To access the Stripe Express Dashboard (manage payouts, tax info, bank details):
|
|
101
|
+
```bash
|
|
102
|
+
hive stripe dashboard
|
|
103
|
+
```
|
|
104
|
+
This returns a single-use URL the human should open in their browser.
|
|
105
|
+
|
|
99
106
|
### Alternative: Manual Login (If Human Has API Key)
|
|
100
107
|
|
|
101
108
|
If the human already has an API key from the web UI:
|