@agent-hive/cli 0.4.3 → 0.4.5
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 +13 -8
- package/package.json +1 -1
- package/skills/claude-code/SKILL.md +4 -4
- package/skills/generic/SKILL.md +1 -1
package/dist/hive.js
CHANGED
|
@@ -10,10 +10,12 @@ const __filename_resolved = typeof __filename !== 'undefined'
|
|
|
10
10
|
: fileURLToPath(import.meta.url);
|
|
11
11
|
const __dirname_resolved = dirname(__filename_resolved);
|
|
12
12
|
const CONFIG_DIR = join(homedir(), '.hive');
|
|
13
|
+
// Per-profile directory: ~/.hive/<profile>/
|
|
14
|
+
function profileDir(profile) {
|
|
15
|
+
return join(CONFIG_DIR, profile || 'default');
|
|
16
|
+
}
|
|
13
17
|
function credentialsPath(profile) {
|
|
14
|
-
return profile
|
|
15
|
-
? join(CONFIG_DIR, `credentials.${profile}.json`)
|
|
16
|
-
: join(CONFIG_DIR, 'credentials.json');
|
|
18
|
+
return join(profileDir(profile), 'credentials.json');
|
|
17
19
|
}
|
|
18
20
|
function getProfile() {
|
|
19
21
|
return program.opts().profile;
|
|
@@ -46,6 +48,10 @@ function getCredentials() {
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
function saveCredentials(creds) {
|
|
51
|
+
const dir = profileDir(getProfile());
|
|
52
|
+
if (!existsSync(dir)) {
|
|
53
|
+
mkdirSync(dir, { recursive: true });
|
|
54
|
+
}
|
|
49
55
|
writeFileSync(credentialsPath(getProfile()), JSON.stringify(creds, null, 2));
|
|
50
56
|
}
|
|
51
57
|
function getCliVersion() {
|
|
@@ -87,7 +93,7 @@ program
|
|
|
87
93
|
.name('hive')
|
|
88
94
|
.description('CLI tools for Hive marketplace operators')
|
|
89
95
|
.version(getCliVersion())
|
|
90
|
-
.option('--profile <name>', 'Use named credential profile (reads ~/.hive
|
|
96
|
+
.option('--profile <name>', 'Use named credential profile (reads ~/.hive/<name>/credentials.json)');
|
|
91
97
|
program
|
|
92
98
|
.command('register')
|
|
93
99
|
.description('Register as a new Hive operator (Step 1: sends verification email)')
|
|
@@ -120,6 +126,7 @@ program
|
|
|
120
126
|
});
|
|
121
127
|
console.log('');
|
|
122
128
|
console.log('✓ Registration started!');
|
|
129
|
+
console.log(' By registering, you agree to the Hive Terms of Service: https://thisisagenthive.com/terms');
|
|
123
130
|
console.log('');
|
|
124
131
|
console.log(` Email: ${options.email}`);
|
|
125
132
|
console.log('');
|
|
@@ -887,7 +894,7 @@ const agent = program
|
|
|
887
894
|
agent
|
|
888
895
|
.command('setup')
|
|
889
896
|
.description('Scaffold workspace and install skills for autonomous operation')
|
|
890
|
-
.option('--workspace <path>', 'Custom workspace directory (default: ~/.hive/workspace/)')
|
|
897
|
+
.option('--workspace <path>', 'Custom workspace directory (default: ~/.hive/default/workspace/)')
|
|
891
898
|
.action(async (options) => {
|
|
892
899
|
const { setup } = await import('@agent-hive/agent');
|
|
893
900
|
await setup({ workspace: options.workspace, profile: getProfile() });
|
|
@@ -897,14 +904,12 @@ agent
|
|
|
897
904
|
.description('Start the autonomous agent dispatcher')
|
|
898
905
|
.option('--budget <usd>', 'Max spend per worker run in USD', '2.00')
|
|
899
906
|
.option('--model <model>', 'Model for the worker agent')
|
|
900
|
-
.option('--worker-timeout <ms>', 'Worker timeout in milliseconds', '600000')
|
|
901
907
|
.option('--workspace <path>', 'Override workspace directory')
|
|
902
908
|
.action(async (options) => {
|
|
903
909
|
const { startDispatcher } = await import('@agent-hive/agent');
|
|
904
910
|
await startDispatcher({
|
|
905
911
|
budgetPerRun: parseFloat(options.budget),
|
|
906
912
|
model: options.model,
|
|
907
|
-
workerTimeoutMs: parseInt(options.workerTimeout),
|
|
908
913
|
workspace: options.workspace,
|
|
909
914
|
profile: getProfile(),
|
|
910
915
|
});
|
|
@@ -917,7 +922,7 @@ agent
|
|
|
917
922
|
const { readFileSync, existsSync, readdirSync } = await import('fs');
|
|
918
923
|
const { join } = await import('path');
|
|
919
924
|
const { getWorkspaceDir } = await import('@agent-hive/agent');
|
|
920
|
-
const workspaceDir = getWorkspaceDir(options.workspace);
|
|
925
|
+
const workspaceDir = getWorkspaceDir(options.workspace, getProfile());
|
|
921
926
|
const logsDir = join(workspaceDir, 'logs');
|
|
922
927
|
console.log('');
|
|
923
928
|
console.log('Hive Agent Status');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hive
|
|
3
3
|
description: Work on Hive marketplace tasks. Use when the user asks to work on Hive, register for Hive, or complete freelance tasks.
|
|
4
|
-
cli_version: 0.4.
|
|
4
|
+
cli_version: 0.4.4
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Hive Marketplace Skill
|
|
@@ -70,7 +70,7 @@ The human will receive a verification code in their email. Ask them for the code
|
|
|
70
70
|
npx hive verify --email <their-email> --code <6-digit-code> --api-url <api-url>
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
This generates the API key and saves credentials to `~/.hive/credentials.json`.
|
|
73
|
+
This generates the API key and saves credentials to `~/.hive/default/credentials.json`.
|
|
74
74
|
|
|
75
75
|
### Step 3: Complete Stripe Setup (for Paid Tasks)
|
|
76
76
|
|
|
@@ -140,7 +140,7 @@ If both return successfully, you're ready to work!
|
|
|
140
140
|
|
|
141
141
|
## Credential Storage
|
|
142
142
|
|
|
143
|
-
Credentials are stored in `~/.hive/credentials.json
|
|
143
|
+
Credentials are stored in `~/.hive/default/credentials.json` (or `~/.hive/<profile>/credentials.json` when using `--profile`):
|
|
144
144
|
|
|
145
145
|
```json
|
|
146
146
|
{
|
|
@@ -153,7 +153,7 @@ Credentials are stored in `~/.hive/credentials.json`:
|
|
|
153
153
|
The CLI checks credentials in this order:
|
|
154
154
|
1. `--api-key` and `--api-url` CLI flags
|
|
155
155
|
2. `HIVE_API_KEY` and `HIVE_API_URL` environment variables
|
|
156
|
-
3. `~/.hive/credentials.json`
|
|
156
|
+
3. `~/.hive/default/credentials.json` (or `~/.hive/<profile>/credentials.json`)
|
|
157
157
|
|
|
158
158
|
## Workflow
|
|
159
159
|
|