@enactprotocol/cli 1.2.8 → 2.0.0

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.
Files changed (73) hide show
  1. package/README.md +88 -0
  2. package/package.json +34 -38
  3. package/src/commands/auth/index.ts +940 -0
  4. package/src/commands/cache/index.ts +361 -0
  5. package/src/commands/config/README.md +239 -0
  6. package/src/commands/config/index.ts +164 -0
  7. package/src/commands/env/README.md +197 -0
  8. package/src/commands/env/index.ts +392 -0
  9. package/src/commands/exec/README.md +110 -0
  10. package/src/commands/exec/index.ts +195 -0
  11. package/src/commands/get/index.ts +198 -0
  12. package/src/commands/index.ts +30 -0
  13. package/src/commands/inspect/index.ts +264 -0
  14. package/src/commands/install/README.md +146 -0
  15. package/src/commands/install/index.ts +682 -0
  16. package/src/commands/list/README.md +115 -0
  17. package/src/commands/list/index.ts +138 -0
  18. package/src/commands/publish/index.ts +350 -0
  19. package/src/commands/report/index.ts +366 -0
  20. package/src/commands/run/README.md +124 -0
  21. package/src/commands/run/index.ts +686 -0
  22. package/src/commands/search/index.ts +368 -0
  23. package/src/commands/setup/index.ts +274 -0
  24. package/src/commands/sign/index.ts +652 -0
  25. package/src/commands/trust/README.md +214 -0
  26. package/src/commands/trust/index.ts +453 -0
  27. package/src/commands/unyank/index.ts +107 -0
  28. package/src/commands/yank/index.ts +143 -0
  29. package/src/index.ts +96 -0
  30. package/src/types.ts +81 -0
  31. package/src/utils/errors.ts +409 -0
  32. package/src/utils/exit-codes.ts +159 -0
  33. package/src/utils/ignore.ts +147 -0
  34. package/src/utils/index.ts +107 -0
  35. package/src/utils/output.ts +242 -0
  36. package/src/utils/spinner.ts +214 -0
  37. package/tests/commands/auth.test.ts +217 -0
  38. package/tests/commands/cache.test.ts +286 -0
  39. package/tests/commands/config.test.ts +277 -0
  40. package/tests/commands/env.test.ts +293 -0
  41. package/tests/commands/exec.test.ts +112 -0
  42. package/tests/commands/get.test.ts +179 -0
  43. package/tests/commands/inspect.test.ts +201 -0
  44. package/tests/commands/install-integration.test.ts +343 -0
  45. package/tests/commands/install.test.ts +288 -0
  46. package/tests/commands/list.test.ts +160 -0
  47. package/tests/commands/publish.test.ts +186 -0
  48. package/tests/commands/report.test.ts +194 -0
  49. package/tests/commands/run.test.ts +231 -0
  50. package/tests/commands/search.test.ts +131 -0
  51. package/tests/commands/sign.test.ts +164 -0
  52. package/tests/commands/trust.test.ts +236 -0
  53. package/tests/commands/unyank.test.ts +114 -0
  54. package/tests/commands/yank.test.ts +154 -0
  55. package/tests/e2e.test.ts +554 -0
  56. package/tests/fixtures/calculator/enact.yaml +34 -0
  57. package/tests/fixtures/echo-tool/enact.md +31 -0
  58. package/tests/fixtures/env-tool/enact.yaml +19 -0
  59. package/tests/fixtures/greeter/enact.yaml +18 -0
  60. package/tests/fixtures/invalid-tool/enact.yaml +4 -0
  61. package/tests/index.test.ts +8 -0
  62. package/tests/types.test.ts +84 -0
  63. package/tests/utils/errors.test.ts +303 -0
  64. package/tests/utils/exit-codes.test.ts +189 -0
  65. package/tests/utils/ignore.test.ts +461 -0
  66. package/tests/utils/output.test.ts +126 -0
  67. package/tsconfig.json +17 -0
  68. package/tsconfig.tsbuildinfo +1 -0
  69. package/dist/index.js +0 -231410
  70. package/dist/index.js.bak +0 -231409
  71. package/dist/web/static/app.js +0 -663
  72. package/dist/web/static/index.html +0 -117
  73. package/dist/web/static/style.css +0 -291
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @enactprotocol/cli
2
+
3
+ Command-line interface for Enact.
4
+
5
+ ## Overview
6
+
7
+ This package provides:
8
+ - User-facing CLI commands
9
+ - Tool execution (run, exec)
10
+ - Discovery (search, get, list)
11
+ - Management (install, sign, publish)
12
+ - Security (trust, report)
13
+ - Configuration (env, config, cache)
14
+
15
+ ## Status
16
+
17
+ Currently in Phase 1 (scaffolding). Full implementation will be completed in Phase 5.
18
+
19
+ ## Dependencies
20
+
21
+ - `@enactprotocol/shared` - For core logic
22
+ - `commander` - CLI framework
23
+ - `chalk` - Terminal colors
24
+ - `ora` - Spinners and progress indicators
25
+ - `inquirer` - Interactive prompts
26
+
27
+ ## Development
28
+
29
+ ```bash
30
+ # Build
31
+ bun run build
32
+
33
+ # Test
34
+ bun test
35
+
36
+ # Run in development mode
37
+ bun run dev
38
+
39
+ # Type check
40
+ bun run typecheck
41
+ ```
42
+
43
+ ## Usage (Phase 5+)
44
+
45
+ ```bash
46
+ # Execute a tool
47
+ enact run <tool> [inputs...]
48
+
49
+ # Search for tools
50
+ enact search <query>
51
+
52
+ # Install a tool
53
+ enact install <tool>
54
+
55
+ # Manage trust
56
+ enact trust add <identity>
57
+
58
+ # More commands coming in Phase 5...
59
+ ```
60
+
61
+ ## Planned Commands (Phase 5)
62
+
63
+ ### Execution
64
+ - `enact run` - Execute a tool with inputs
65
+ - `enact exec` - Execute from local file
66
+
67
+ ### Discovery
68
+ - `enact search` - Search registry
69
+ - `enact get` - Get tool details
70
+ - `enact list` - List installed tools
71
+
72
+ ### Management
73
+ - `enact install` - Install tool
74
+
75
+ ### Security
76
+ - `enact sign` - Sign tool
77
+ - `enact publish` - Publish to registry
78
+
79
+ ### Trust
80
+ - `enact trust add/remove/list/check` - Manage trust
81
+
82
+ ### Configuration
83
+ - `enact env` - Environment variables
84
+ - `enact config` - CLI configuration
85
+ - `enact cache` - Cache management
86
+
87
+ ### Auth
88
+ - `enact auth login/logout/status` - Authentication
package/package.json CHANGED
@@ -1,55 +1,51 @@
1
1
  {
2
2
  "name": "@enactprotocol/cli",
3
- "version": "1.2.8",
4
- "description": "Official CLI for the Enact Protocol - package, secure, and discover AI tools",
3
+ "version": "2.0.0",
4
+ "description": "Command-line interface for Enact - the npm for AI tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
7
8
  "bin": {
8
9
  "enact": "./dist/index.js"
9
10
  },
10
- "files": [
11
- "dist/**/*",
12
- "README.md",
13
- "LICENSE"
14
- ],
15
- "scripts": {
16
- "build": "bun build ./src/index.ts --outdir ./dist --target node && mkdir -p ./dist/web && cp -r ../shared/src/web/static ./dist/web/ && sed -i.bak '1{/^#!/d;}' ./dist/index.js && echo '#!/usr/bin/env node' | cat - ./dist/index.js > temp && mv temp ./dist/index.js && chmod +x ./dist/index.js",
17
- "dev": "bun run --watch src/index.ts",
18
- "start": "bun ./dist/index.js",
19
- "test": "bun test",
20
- "test:watch": "bun test --watch",
21
- "test:coverage": "bun test --coverage",
22
- "build:binary": "bun build ./src/index.ts --compile --outfile enact",
23
- "build:linux": "bun build ./src/index.ts --compile --target=bun-linux-x64 --outfile ../../dist/enact-linux",
24
- "build:macos": "bun build ./src/index.ts --compile --target=bun-darwin-x64 --outfile ../../dist/enact-macos",
25
- "build:windows": "bun build ./src/index.ts --compile --target=bun-windows-x64 --outfile ../../dist/enact-windows.exe"
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
26
19
  },
27
- "keywords": [
28
- "cli",
29
- "enact",
30
- "enact-protocol",
31
- "ai-tools",
32
- "tool-discovery",
33
- "command-line-tool"
34
- ],
35
- "author": "EnactProtocol",
36
- "license": "MIT",
37
20
  "repository": {
38
21
  "type": "git",
39
- "url": "https://github.com/EnactProtocol/enact-cli.git"
22
+ "url": "https://github.com/EnactProtocol/enact-cli-2.0.git",
23
+ "directory": "packages/cli"
40
24
  },
41
- "engines": {
42
- "node": ">=18.0.0"
25
+ "scripts": {
26
+ "build": "tsc --build",
27
+ "clean": "rm -rf dist",
28
+ "test": "bun test",
29
+ "typecheck": "tsc --noEmit",
30
+ "dev": "bun run src/index.ts",
31
+ "dev:publish": "ENACT_REGISTRY_URL=http://127.0.0.1:54321/functions/v1 bun run dist/index.js publish --skip-auth",
32
+ "dev:search": "ENACT_REGISTRY_URL=http://127.0.0.1:54321/functions/v1 bun run dist/index.js search",
33
+ "dev:get": "ENACT_REGISTRY_URL=http://127.0.0.1:54321/functions/v1 bun run dist/index.js get"
43
34
  },
44
35
  "dependencies": {
45
- "@enactprotocol/shared": "1.2.8",
46
- "@clack/core": "^0.4.2",
47
- "@clack/prompts": "^0.10.1",
36
+ "@clack/prompts": "^0.11.0",
37
+ "@enactprotocol/api": "2.0.0",
38
+ "@enactprotocol/execution": "2.0.0",
39
+ "@enactprotocol/secrets": "2.0.0",
40
+ "@enactprotocol/shared": "2.0.0",
41
+ "commander": "^12.1.0",
48
42
  "picocolors": "^1.1.1"
49
43
  },
50
44
  "devDependencies": {
51
- "@types/node": "^20.12.12",
52
- "bun-types": "latest",
53
- "typescript": "^5.4.5"
54
- }
45
+ "@types/node": "^22.10.1",
46
+ "typescript": "^5.7.2"
47
+ },
48
+ "keywords": ["cli", "enact", "tools"],
49
+ "author": "Enact Protocol",
50
+ "license": "Apache-2.0"
55
51
  }