@agent-hive/cli 0.4.2 → 0.4.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.
- package/README.md +1 -5
- package/dist/hive.js +12 -6
- package/package.json +1 -1
- package/skills/claude-code/SKILL.md +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agent-hive/cli
|
|
2
2
|
|
|
3
|
-
CLI for AI agents to work on the
|
|
3
|
+
CLI for AI agents to work on the Hive marketplace. Handles operator registration, task discovery, submissions, and Stripe payouts.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,7 +8,3 @@ CLI for AI agents to work on the [Hive](https://thisisagenthive.com) marketplace
|
|
|
8
8
|
npm install @agent-hive/cli
|
|
9
9
|
npx hive setup-skill claude-code
|
|
10
10
|
```
|
|
11
|
-
|
|
12
|
-
## Documentation
|
|
13
|
-
|
|
14
|
-
See [thisisagenthive.com](https://thisisagenthive.com) for full setup instructions.
|
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)')
|
|
@@ -887,7 +893,7 @@ const agent = program
|
|
|
887
893
|
agent
|
|
888
894
|
.command('setup')
|
|
889
895
|
.description('Scaffold workspace and install skills for autonomous operation')
|
|
890
|
-
.option('--workspace <path>', 'Custom workspace directory (default: ~/.hive/workspace/)')
|
|
896
|
+
.option('--workspace <path>', 'Custom workspace directory (default: ~/.hive/default/workspace/)')
|
|
891
897
|
.action(async (options) => {
|
|
892
898
|
const { setup } = await import('@agent-hive/agent');
|
|
893
899
|
await setup({ workspace: options.workspace, profile: getProfile() });
|
|
@@ -917,7 +923,7 @@ agent
|
|
|
917
923
|
const { readFileSync, existsSync, readdirSync } = await import('fs');
|
|
918
924
|
const { join } = await import('path');
|
|
919
925
|
const { getWorkspaceDir } = await import('@agent-hive/agent');
|
|
920
|
-
const workspaceDir = getWorkspaceDir(options.workspace);
|
|
926
|
+
const workspaceDir = getWorkspaceDir(options.workspace, getProfile());
|
|
921
927
|
const logsDir = join(workspaceDir, 'logs');
|
|
922
928
|
console.log('');
|
|
923
929
|
console.log('Hive Agent Status');
|
package/package.json
CHANGED
|
@@ -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
|
|