eitri-cli 1.51.0 → 1.52.0-beta.1

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/CLAUDE.md ADDED
@@ -0,0 +1,71 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Setup
6
+
7
+ Prerequisites: Node.js >= 16, Rust and Cargo installed.
8
+
9
+ ```bash
10
+ # Root dependencies
11
+ npm i
12
+
13
+ # Build the Rust native module (required before running)
14
+ cd eitri-cli-v2 && npm i && npm run build && cd ..
15
+ ```
16
+
17
+ ## Common Commands
18
+
19
+ ```bash
20
+ # Run tests
21
+ npm test # or: npm run test-eitri
22
+
23
+ # Lint with auto-fix
24
+ npm run linter
25
+
26
+ # Install and run locally
27
+ ./install-dev.sh # Linux/MacOS
28
+ ./install-dev.bat # Windows
29
+ eitri <command>
30
+ ```
31
+
32
+ Jest test timeout is 100 seconds. Run a single test file with:
33
+ ```bash
34
+ NODE_APP_INSTANCE=eitri npx jest --detectOpenHandles path/to/test.js
35
+ ```
36
+
37
+ ## Architecture
38
+
39
+ This is a **hybrid Node.js + Rust CLI** (the `eitri` binary) for developing Eitri-Apps on the Eitri mobile platform.
40
+
41
+ ### Entry Flow
42
+
43
+ 1. `index-eitri.js` (bin entry) — sets `NODE_APP_INSTANCE=eitri`, generates a UUID session ID, calls `index.js`
44
+ 2. `index.js` — Commander.js v9 CLI parser; loads config from `config/` via `NODE_CONFIG_DIR`; delegates to Rust or JS handlers
45
+ 3. **Rust layer**: `eitri-cli-v2/` — NAPI-RS native bindings compiled to platform-specific `.node` files. Most active commands live here.
46
+ 4. **JS layer**: `src/modules/` — legacy commands still in JavaScript
47
+
48
+ ### Command Routing
49
+
50
+ Commands implemented in Rust (`eitri-cli-v2/src/commands/`), called via NAPI bindings:
51
+ - `login`, `create`, `start`, `push-version`, `clean`, `test`, `publish`, `doctor`, `libs`, `gpt`, `self-update`
52
+
53
+ Commands still in JavaScript (`src/modules/`):
54
+ - `vegvisir` / `workspace` — workspace management (list, use, create, current, clean)
55
+ - `app` — multi-app orchestration (start, logs, clean, create, checkout, snapshot)
56
+ - `agents` — AI agent environment setup (LLM env vars)
57
+
58
+ Pre-command middleware (in `index.js`) runs connection checks and update checks before most commands, skipping them for `version`, `-v`, and `self-update`.
59
+
60
+ ### Configuration
61
+
62
+ Environment configs in `config/` use the `node-config` pattern, selected by `NODE_APP_INSTANCE` (always `eitri`) and `NODE_CONFIG_DIR`. Files: `default-eitri.js`, `dev.js`, `prod-eitri.js`, etc.
63
+
64
+ ### Release Workflow
65
+
66
+ Uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) — required for automated versioning via semantic-release.
67
+
68
+ - Branch from `beta` → PR to `beta` → merging publishes a `beta` NPM prerelease
69
+ - PR from `beta` → `master` → merging publishes a stable NPM release
70
+
71
+ Allowed commit types: `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`
@@ -96,4 +96,5 @@ export declare namespace workspace {
96
96
  }
97
97
  export declare namespace agents {
98
98
  export function setup(args: SetupVariablesArgs): Promise<void>
99
+ export function generateRag(): Promise<void>
99
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.51.0",
3
+ "version": "1.52.0-beta.1",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -2,23 +2,32 @@ const commander = require("commander");
2
2
  const eitriCLIV2 = require("../../../eitri-cli-v2/index.js");
3
3
 
4
4
  module.exports = function AgentsCommand() {
5
+ const agentsCommand = commander
6
+ .command("agents")
7
+ .description("Gerencia os agentes de IA do Eitri-App");
5
8
 
6
- const agentsCommand = commander
7
- .command("agents")
8
- .description(
9
- "Gerencia os agentes de IA do Eitri-App"
10
- );
9
+ agentsCommand
10
+ .command("setup")
11
+ .description(
12
+ "Faz o setup das variáveis de ambiente, seja do Workspace ou de Produção",
13
+ )
14
+ .option(
15
+ "-e, --env <env>",
16
+ "Ambiente de produção ou workspace. Default: workspace. Options: workspace, production",
17
+ )
18
+ .option("-l, --llm <llm>", "Nome do LLM")
19
+ .option("-k, --api-key <api-key>", "Chave de API do LLM")
20
+ .option("-m, --model <model>", "Modelo do LLM")
21
+ .action(async (cmdObj) => {
22
+ await eitriCLIV2.agents.setup(cmdObj);
23
+ });
11
24
 
12
- agentsCommand
13
- .command("setup")
14
- .description("Faz o setup das variáveis de ambiente, seja do Workspace ou de Produção")
15
- .option("-e, --env <env>", "Ambiente de produção ou workspace. Default: workspace. Options: workspace, production")
16
- .option("-l, --llm <llm>", "Nome do LLM")
17
- .option("-k, --api-key <api-key>", "Chave de API do LLM")
18
- .option("-m, --model <model>", "Modelo do LLM")
19
- .action(async (cmdObj) => {
20
- await eitriCLIV2.agents.setup(cmdObj)
21
- });
25
+ agentsCommand
26
+ .command("generate:rag")
27
+ .description("Gera os arquivos necessários para o RAG")
28
+ .action(async () => {
29
+ await eitriCLIV2.agents.generateRag();
30
+ });
22
31
 
23
- return agentsCommand
24
- }
32
+ return agentsCommand;
33
+ };