Skip to content

Commit 6958d51

Browse files
authored
Merge pull request #236 from PaulJPhilp/codex/ep-cli-pre-release-hardening
feat(ep-cli): harden public surface and API-backed pattern reads
2 parents 1d43b00 + 3f4094e commit 6958d51

20 files changed

Lines changed: 649 additions & 991 deletions

File tree

packages/ep-cli/README.md

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ Search, browse, and install Effect-TS patterns directly from your terminal. Buil
1111
## Installation
1212

1313
```bash
14-
# npm
15-
npm install -g @effect-patterns/ep-cli
16-
1714
# bun
1815
bun add -g @effect-patterns/ep-cli
19-
20-
# pnpm
21-
pnpm add -g @effect-patterns/ep-cli
2216
```
2317

18+
Requires Bun runtime.
19+
2420
## Commands
2521

2622
### Pattern Discovery
@@ -57,13 +53,6 @@ ep install list --installed
5753

5854
Supported tools: `agents`, `cursor`, `vscode`, `windsurf`
5955

60-
### Pattern Authoring
61-
62-
```bash
63-
# Scaffold a new pattern (interactive wizard)
64-
ep pattern new
65-
```
66-
6756
### Skills Management
6857

6958
Manage and validate Claude Skills built from patterns.
@@ -82,40 +71,17 @@ ep skills validate
8271
ep skills stats
8372
```
8473

85-
### Release Management
86-
87-
```bash
88-
# Preview next release version and changelog
89-
ep release preview
90-
91-
# Create a release (version bump, changelog, tag, push)
92-
ep release create
93-
```
94-
95-
### Admin / Publishing Pipeline
96-
97-
```bash
98-
# Lint patterns for Effect-TS best practices
99-
ep admin lint
100-
ep admin lint --fix
74+
## Maintainer Commands
10175

102-
# Validate pattern files
103-
ep admin validate -v
104-
105-
# Run example tests
106-
ep admin test
107-
108-
# Generate documentation
109-
ep admin generate
110-
111-
# Run the full publishing pipeline (test -> validate -> generate -> ingest)
112-
ep admin pipeline
113-
```
76+
Maintainer workflows (release, pattern authoring, publishing/admin commands) live in `@effect-patterns/ep-admin`.
11477

11578
## Environment Variables
11679

11780
| Variable | Description | Default |
11881
|----------|-------------|---------|
82+
| `PATTERN_API_KEY` | API key for hosted Effect Patterns API (`x-api-key` header) | - |
83+
| `EFFECT_PATTERNS_API_URL` | Base URL for Effect Patterns API | `https://effect-patterns-mcp.vercel.app` |
84+
| `EP_API_TIMEOUT_MS` | HTTP timeout for API requests (milliseconds) | `10000` |
11985
| `LOG_LEVEL` | Set log level (`debug`, `info`, `warn`, `error`) | `info` |
12086
| `DEBUG` | Enable debug logging | - |
12187
| `VERBOSE` | Enable verbose logging | - |

packages/ep-cli/package.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,13 @@
1717
},
1818
"dependencies": {
1919
"@effect-patterns/ep-shared-services": "workspace:*",
20-
"@effect-patterns/pipeline-state": "workspace:*",
2120
"@effect-patterns/toolkit": "workspace:*",
22-
"@effect/cli": "^0.73.0",
23-
"@effect/platform": "^0.94.1",
24-
"@effect/platform-node": "^0.104.0",
25-
"conventional-commits-parser": "^6.2.1",
26-
"conventional-recommended-bump": "^11.2.0",
27-
"dotenv": "^17.2.3",
28-
"effect": "^3.19.14",
21+
"@effect/cli": "0.73.2",
22+
"@effect/platform": "0.94.4",
23+
"@effect/platform-node": "0.104.1",
24+
"effect": "^3.19.16",
2925
"effect-cli-tui": "^2.2.0",
30-
"effect-env": "^0.4.1",
31-
"glob": "^13.0.1",
32-
"js-yaml": "^4.1.1",
33-
"liquidjs": "^10.24.0",
34-
"ora": "^9.0.0",
35-
"semver": "^7.7.3",
36-
"yaml": "^2.8.2"
26+
"effect-env": "^0.4.1"
3727
},
3828
"devDependencies": {
3929
"tsx": "^4.21.0",
@@ -57,7 +47,7 @@
5747
},
5848
"homepage": "https://github.com/PaulJPhilp/Effect-Patterns#readme",
5949
"engines": {
60-
"node": ">=18.0.0"
50+
"bun": ">=1.0.0"
6151
},
6252
"keywords": [
6353
"effect",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Effect, Exit } from "effect";
2+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
3+
import { runCli } from "../index.js";
4+
5+
const run = (argv: ReadonlyArray<string>) => Effect.runPromiseExit(runCli(argv));
6+
7+
describe("ep-cli command surface", () => {
8+
beforeEach(() => {
9+
vi.spyOn(console, "log").mockImplementation(() => undefined);
10+
vi.spyOn(console, "error").mockImplementation(() => undefined);
11+
vi.spyOn(console, "warn").mockImplementation(() => undefined);
12+
});
13+
14+
afterEach(() => {
15+
vi.restoreAllMocks();
16+
});
17+
18+
it("runs root help successfully", async () => {
19+
const exit = await run(["bun", "ep", "--help"]);
20+
expect(Exit.isSuccess(exit)).toBe(true);
21+
});
22+
23+
it("exposes only public end-user commands", async () => {
24+
const expectedCommands = ["search", "list", "show", "install", "skills"];
25+
26+
for (const command of expectedCommands) {
27+
const exit = await run(["bun", "ep", command, "--help"]);
28+
expect(Exit.isSuccess(exit)).toBe(true);
29+
}
30+
});
31+
32+
it("rejects maintainer-only commands", async () => {
33+
const removedCommands = ["admin", "pattern", "release"];
34+
35+
for (const command of removedCommands) {
36+
const exit = await run(["bun", "ep", command]);
37+
expect(Exit.isFailure(exit)).toBe(true);
38+
}
39+
});
40+
});

packages/ep-cli/src/commands/admin-commands.ts

Lines changed: 0 additions & 170 deletions
This file was deleted.

packages/ep-cli/src/commands/pattern-commands.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)