@eve-horizon/cli 0.2.12 → 0.2.13
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/index.js +65918 -137
- package/package.json +6 -5
- package/dist/commands/admin.js +0 -81
- package/dist/commands/agents.js +0 -445
- package/dist/commands/api.js +0 -350
- package/dist/commands/auth.js +0 -852
- package/dist/commands/build.js +0 -397
- package/dist/commands/chat.js +0 -55
- package/dist/commands/db.js +0 -204
- package/dist/commands/env.js +0 -812
- package/dist/commands/event.js +0 -273
- package/dist/commands/harness.js +0 -158
- package/dist/commands/init.js +0 -280
- package/dist/commands/integrations.js +0 -73
- package/dist/commands/job.js +0 -2557
- package/dist/commands/manifest.js +0 -86
- package/dist/commands/migrate.js +0 -136
- package/dist/commands/org.js +0 -148
- package/dist/commands/packs.js +0 -197
- package/dist/commands/pipeline.js +0 -629
- package/dist/commands/profile.js +0 -155
- package/dist/commands/project.js +0 -249
- package/dist/commands/release.js +0 -69
- package/dist/commands/secrets.js +0 -218
- package/dist/commands/skills.js +0 -307
- package/dist/commands/supervise.js +0 -60
- package/dist/commands/system.js +0 -649
- package/dist/commands/thread.js +0 -153
- package/dist/commands/workflow.js +0 -337
- package/dist/lib/args.js +0 -57
- package/dist/lib/client.js +0 -116
- package/dist/lib/config.js +0 -49
- package/dist/lib/context.js +0 -187
- package/dist/lib/git.js +0 -158
- package/dist/lib/harness-capabilities.js +0 -74
- package/dist/lib/help.js +0 -1821
- package/dist/lib/logs.js +0 -51
- package/dist/lib/output.js +0 -14
package/dist/commands/init.js
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.handleInit = handleInit;
|
|
37
|
-
const fs = __importStar(require("node:fs"));
|
|
38
|
-
const path = __importStar(require("node:path"));
|
|
39
|
-
const os = __importStar(require("node:os"));
|
|
40
|
-
const node_child_process_1 = require("node:child_process");
|
|
41
|
-
const args_1 = require("../lib/args");
|
|
42
|
-
// ============================================================================
|
|
43
|
-
// Constants
|
|
44
|
-
// ============================================================================
|
|
45
|
-
const DEFAULT_TEMPLATE = 'https://github.com/incept5/eve-horizon-starter';
|
|
46
|
-
const DEFAULT_BRANCH = 'main';
|
|
47
|
-
// ============================================================================
|
|
48
|
-
// Main Handler
|
|
49
|
-
// ============================================================================
|
|
50
|
-
/**
|
|
51
|
-
* eve init [directory] [--template <url>] [--branch <branch>]
|
|
52
|
-
*
|
|
53
|
-
* Initialize a new Eve Horizon project from a template.
|
|
54
|
-
* Downloads the template, strips git history, and sets up a fresh project.
|
|
55
|
-
*/
|
|
56
|
-
async function handleInit(positionals, flags) {
|
|
57
|
-
const targetDir = positionals[0] || '.';
|
|
58
|
-
const template = (0, args_1.getStringFlag)(flags, ['template', 't']) || DEFAULT_TEMPLATE;
|
|
59
|
-
const branch = (0, args_1.getStringFlag)(flags, ['branch', 'b']) || DEFAULT_BRANCH;
|
|
60
|
-
const skipSkills = Boolean(flags['skip-skills']);
|
|
61
|
-
// Resolve target directory
|
|
62
|
-
const resolvedTarget = path.resolve(targetDir);
|
|
63
|
-
const targetName = path.basename(resolvedTarget);
|
|
64
|
-
const isCurrentDir = targetDir === '.';
|
|
65
|
-
// Validate target directory
|
|
66
|
-
if (isCurrentDir) {
|
|
67
|
-
// Current directory must be empty or not exist
|
|
68
|
-
if (fs.existsSync(resolvedTarget)) {
|
|
69
|
-
const entries = fs.readdirSync(resolvedTarget);
|
|
70
|
-
// Allow hidden files like .git, but fail if there's substantial content
|
|
71
|
-
const nonHiddenEntries = entries.filter(e => !e.startsWith('.'));
|
|
72
|
-
if (nonHiddenEntries.length > 0) {
|
|
73
|
-
throw new Error(`Current directory is not empty. Remove existing files or specify a new directory name:\n` +
|
|
74
|
-
` eve init my-project`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
// Named directory must not exist or be empty
|
|
80
|
-
if (fs.existsSync(resolvedTarget)) {
|
|
81
|
-
const entries = fs.readdirSync(resolvedTarget);
|
|
82
|
-
if (entries.length > 0) {
|
|
83
|
-
throw new Error(`Directory '${targetDir}' already exists and is not empty.`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
console.log(`Initializing Eve Horizon project${isCurrentDir ? '' : ` in '${targetName}'`}...`);
|
|
88
|
-
console.log(`Template: ${template}`);
|
|
89
|
-
console.log(`Branch: ${branch}`);
|
|
90
|
-
console.log('');
|
|
91
|
-
// Create temp directory for clone
|
|
92
|
-
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'eve-init-'));
|
|
93
|
-
try {
|
|
94
|
-
// Clone template
|
|
95
|
-
console.log('Downloading template...');
|
|
96
|
-
const cloneResult = (0, node_child_process_1.spawnSync)('git', ['clone', '--depth=1', `--branch=${branch}`, template, tempDir], {
|
|
97
|
-
encoding: 'utf8',
|
|
98
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
99
|
-
});
|
|
100
|
-
if (cloneResult.status !== 0) {
|
|
101
|
-
throw new Error(`Failed to clone template:\n${cloneResult.stderr || cloneResult.stdout}`);
|
|
102
|
-
}
|
|
103
|
-
// Remove .git from cloned template
|
|
104
|
-
const gitDir = path.join(tempDir, '.git');
|
|
105
|
-
if (fs.existsSync(gitDir)) {
|
|
106
|
-
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
107
|
-
}
|
|
108
|
-
// Create target directory if needed
|
|
109
|
-
if (!fs.existsSync(resolvedTarget)) {
|
|
110
|
-
fs.mkdirSync(resolvedTarget, { recursive: true });
|
|
111
|
-
}
|
|
112
|
-
// Copy template contents to target
|
|
113
|
-
console.log('Setting up project...');
|
|
114
|
-
copyDirRecursive(tempDir, resolvedTarget);
|
|
115
|
-
// Initialize git
|
|
116
|
-
console.log('Initializing git repository...');
|
|
117
|
-
(0, node_child_process_1.execSync)('git init', { cwd: resolvedTarget, stdio: 'pipe' });
|
|
118
|
-
(0, node_child_process_1.execSync)('git add -A', { cwd: resolvedTarget, stdio: 'pipe' });
|
|
119
|
-
(0, node_child_process_1.execSync)('git commit -m "Initial commit from eve-horizon-starter"', {
|
|
120
|
-
cwd: resolvedTarget,
|
|
121
|
-
stdio: 'pipe',
|
|
122
|
-
});
|
|
123
|
-
// Install skills
|
|
124
|
-
if (!skipSkills) {
|
|
125
|
-
console.log('');
|
|
126
|
-
console.log('Installing skills...');
|
|
127
|
-
await installSkills(resolvedTarget);
|
|
128
|
-
}
|
|
129
|
-
// Success message
|
|
130
|
-
console.log('');
|
|
131
|
-
console.log('Project initialized successfully!');
|
|
132
|
-
console.log('');
|
|
133
|
-
console.log('Next steps:');
|
|
134
|
-
if (!isCurrentDir) {
|
|
135
|
-
console.log(` 1. cd ${targetName}`);
|
|
136
|
-
console.log(' 2. Start your AI coding agent (e.g., claude, cursor)');
|
|
137
|
-
console.log(' 3. Ask: "Run the eve-new-project-setup skill"');
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
console.log(' 1. Start your AI coding agent (e.g., claude, cursor)');
|
|
141
|
-
console.log(' 2. Ask: "Run the eve-new-project-setup skill"');
|
|
142
|
-
}
|
|
143
|
-
console.log('');
|
|
144
|
-
console.log('The setup skill will:');
|
|
145
|
-
console.log(' - Install the Eve CLI if needed');
|
|
146
|
-
console.log(' - Configure your profile and authentication');
|
|
147
|
-
console.log(' - Set up your project manifest');
|
|
148
|
-
console.log(' - Help you set up your own Git remote');
|
|
149
|
-
}
|
|
150
|
-
finally {
|
|
151
|
-
// Clean up temp directory
|
|
152
|
-
if (fs.existsSync(tempDir)) {
|
|
153
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
// ============================================================================
|
|
158
|
-
// Helper Functions
|
|
159
|
-
// ============================================================================
|
|
160
|
-
/**
|
|
161
|
-
* Recursively copy directory contents
|
|
162
|
-
*/
|
|
163
|
-
function copyDirRecursive(src, dest) {
|
|
164
|
-
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
165
|
-
for (const entry of entries) {
|
|
166
|
-
const srcPath = path.join(src, entry.name);
|
|
167
|
-
const destPath = path.join(dest, entry.name);
|
|
168
|
-
if (entry.isDirectory()) {
|
|
169
|
-
if (!fs.existsSync(destPath)) {
|
|
170
|
-
fs.mkdirSync(destPath, { recursive: true });
|
|
171
|
-
}
|
|
172
|
-
copyDirRecursive(srcPath, destPath);
|
|
173
|
-
}
|
|
174
|
-
else if (entry.isSymbolicLink()) {
|
|
175
|
-
const linkTarget = fs.readlinkSync(srcPath);
|
|
176
|
-
if (!fs.existsSync(destPath)) {
|
|
177
|
-
fs.symlinkSync(linkTarget, destPath);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
fs.copyFileSync(srcPath, destPath);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Install skills from skills.txt
|
|
187
|
-
* This reuses the logic from the skills command
|
|
188
|
-
*/
|
|
189
|
-
async function installSkills(projectRoot) {
|
|
190
|
-
const skillsTxt = path.join(projectRoot, 'skills.txt');
|
|
191
|
-
if (!fs.existsSync(skillsTxt)) {
|
|
192
|
-
console.log('No skills.txt found, skipping skill installation');
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
// Check if skills CLI is available
|
|
196
|
-
const result = (0, node_child_process_1.spawnSync)('which', ['skills'], { encoding: 'utf8' });
|
|
197
|
-
if (result.status !== 0) {
|
|
198
|
-
console.log('skills CLI not found. Skills will be installed when you run:');
|
|
199
|
-
console.log(' npm install -g skills');
|
|
200
|
-
console.log(' eve skills install');
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
const agents = ['claude-code', 'codex', 'gemini-cli'];
|
|
204
|
-
try {
|
|
205
|
-
const content = fs.readFileSync(skillsTxt, 'utf-8');
|
|
206
|
-
const lines = content.split('\n')
|
|
207
|
-
.map(line => line.split('#')[0].trim())
|
|
208
|
-
.filter(line => line.length > 0);
|
|
209
|
-
for (const source of lines) {
|
|
210
|
-
console.log(` Installing: ${source}`);
|
|
211
|
-
for (const agent of agents) {
|
|
212
|
-
try {
|
|
213
|
-
(0, node_child_process_1.execSync)(`skills add ${JSON.stringify(source)} -a ${agent} -y --all`, {
|
|
214
|
-
cwd: projectRoot,
|
|
215
|
-
stdio: 'inherit',
|
|
216
|
-
timeout: 120000,
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
catch {
|
|
220
|
-
console.log(` Warning: Failed to install ${source} for ${agent}`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
// Ensure symlink
|
|
225
|
-
ensureSkillsSymlink(projectRoot);
|
|
226
|
-
// Commit skill changes
|
|
227
|
-
try {
|
|
228
|
-
(0, node_child_process_1.execSync)('git add -A', { cwd: projectRoot, stdio: 'pipe' });
|
|
229
|
-
const hasChanges = (0, node_child_process_1.spawnSync)('git', ['diff', '--cached', '--quiet'], {
|
|
230
|
-
cwd: projectRoot,
|
|
231
|
-
encoding: 'utf8',
|
|
232
|
-
});
|
|
233
|
-
if (hasChanges.status !== 0) {
|
|
234
|
-
(0, node_child_process_1.execSync)('git commit -m "chore: install skills from skills.txt"', {
|
|
235
|
-
cwd: projectRoot,
|
|
236
|
-
stdio: 'pipe',
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
catch {
|
|
241
|
-
// Ignore commit failures
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
catch (err) {
|
|
245
|
-
console.log('Warning: Failed to install some skills');
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Ensure .claude/skills symlink points to .agent/skills
|
|
250
|
-
*/
|
|
251
|
-
function ensureSkillsSymlink(projectRoot) {
|
|
252
|
-
const agentSkills = path.join(projectRoot, '.agent', 'skills');
|
|
253
|
-
const claudeDir = path.join(projectRoot, '.claude');
|
|
254
|
-
const claudeSkills = path.join(claudeDir, 'skills');
|
|
255
|
-
if (!fs.existsSync(agentSkills)) {
|
|
256
|
-
fs.mkdirSync(agentSkills, { recursive: true });
|
|
257
|
-
}
|
|
258
|
-
if (!fs.existsSync(claudeDir)) {
|
|
259
|
-
fs.mkdirSync(claudeDir, { recursive: true });
|
|
260
|
-
}
|
|
261
|
-
if (fs.existsSync(claudeSkills)) {
|
|
262
|
-
const stat = fs.lstatSync(claudeSkills);
|
|
263
|
-
if (stat.isSymbolicLink()) {
|
|
264
|
-
const target = fs.readlinkSync(claudeSkills);
|
|
265
|
-
if (target === '../.agent/skills' || target === agentSkills) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
fs.unlinkSync(claudeSkills);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
try {
|
|
275
|
-
fs.symlinkSync('../.agent/skills', claudeSkills);
|
|
276
|
-
}
|
|
277
|
-
catch {
|
|
278
|
-
// Ignore symlink failures
|
|
279
|
-
}
|
|
280
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleIntegrations = handleIntegrations;
|
|
4
|
-
const args_1 = require("../lib/args");
|
|
5
|
-
const client_1 = require("../lib/client");
|
|
6
|
-
const output_1 = require("../lib/output");
|
|
7
|
-
async function handleIntegrations(subcommand, positionals, flags, context) {
|
|
8
|
-
const json = Boolean(flags.json);
|
|
9
|
-
const orgId = (0, args_1.getStringFlag)(flags, ['org']) ?? context.orgId;
|
|
10
|
-
switch (subcommand) {
|
|
11
|
-
case 'list': {
|
|
12
|
-
if (!orgId) {
|
|
13
|
-
throw new Error('Usage: eve integrations list --org <org_id>');
|
|
14
|
-
}
|
|
15
|
-
const response = await (0, client_1.requestJson)(context, `/orgs/${orgId}/integrations`);
|
|
16
|
-
(0, output_1.outputJson)(response, json);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
case 'slack': {
|
|
20
|
-
const action = positionals[0];
|
|
21
|
-
if (action !== 'connect') {
|
|
22
|
-
throw new Error('Usage: eve integrations slack connect --org <org_id> --team-id <team_id> [--token <token>]');
|
|
23
|
-
}
|
|
24
|
-
if (!orgId) {
|
|
25
|
-
throw new Error('Missing org id. Provide --org or set a profile default.');
|
|
26
|
-
}
|
|
27
|
-
const teamId = (0, args_1.getStringFlag)(flags, ['team-id']);
|
|
28
|
-
if (!teamId) {
|
|
29
|
-
throw new Error('Missing --team-id');
|
|
30
|
-
}
|
|
31
|
-
const token = (0, args_1.getStringFlag)(flags, ['token']);
|
|
32
|
-
const tokensJsonFlag = (0, args_1.getStringFlag)(flags, ['tokens-json']);
|
|
33
|
-
const status = (0, args_1.getStringFlag)(flags, ['status']);
|
|
34
|
-
let tokensJson;
|
|
35
|
-
if (tokensJsonFlag) {
|
|
36
|
-
try {
|
|
37
|
-
const parsed = JSON.parse(tokensJsonFlag);
|
|
38
|
-
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
39
|
-
tokensJson = parsed;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
throw new Error('Invalid --tokens-json (must be JSON object)');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (!tokensJson && token) {
|
|
47
|
-
tokensJson = { access_token: token };
|
|
48
|
-
}
|
|
49
|
-
const body = { team_id: teamId };
|
|
50
|
-
if (tokensJson)
|
|
51
|
-
body.tokens_json = tokensJson;
|
|
52
|
-
if (status)
|
|
53
|
-
body.status = status;
|
|
54
|
-
const response = await (0, client_1.requestJson)(context, `/orgs/${orgId}/integrations/slack/connect`, { method: 'POST', body });
|
|
55
|
-
(0, output_1.outputJson)(response, json, `✓ Slack integration connected: ${response.id}`);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
case 'test': {
|
|
59
|
-
const integrationId = positionals[0];
|
|
60
|
-
if (!integrationId) {
|
|
61
|
-
throw new Error('Usage: eve integrations test <integration_id>');
|
|
62
|
-
}
|
|
63
|
-
if (!orgId) {
|
|
64
|
-
throw new Error('Missing org id. Provide --org or set a profile default.');
|
|
65
|
-
}
|
|
66
|
-
const response = await (0, client_1.requestJson)(context, `/orgs/${orgId}/integrations/${integrationId}/test`, { method: 'POST' });
|
|
67
|
-
(0, output_1.outputJson)(response, json, response.ok ? '✓ Integration test ok' : 'Integration test failed');
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
default:
|
|
71
|
-
throw new Error('Usage: eve integrations <list|slack|test>');
|
|
72
|
-
}
|
|
73
|
-
}
|