Skip to content

Commit 62ece8b

Browse files
committed
fix: update frai-core dependency and add missing package files
1 parent ce9498f commit 62ece8b

File tree

4 files changed

+198
-3
lines changed

4 files changed

+198
-3
lines changed

packages/frai-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"commander": "^11.1.0",
1919
"dotenv": "^16.5.0",
20-
"frai-core": "workspace:*",
20+
"frai-core": "^0.0.1",
2121
"inquirer": "^8.2.6",
2222
"node-fetch": "^3.3.2"
2323
},

packages/frai-core/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 FRAI Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/frai-core/README.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<div align="center">
2+
3+
<pre>
4+
5+
███████████ ███████████ █████████ █████
6+
░░███░░░░░░█░░███░░░░░███ ███░░░░░███ ░░███
7+
░███ █ ░ ░███ ░███ ░███ ░███ ░███
8+
░███████ ░██████████ ░███████████ ░███
9+
░███░░░█ ░███░░░░░███ ░███░░░░░███ ░███
10+
░███ ░ ░███ ░███ ░███ ░███ ░███
11+
█████ █████ █████ █████ █████ █████
12+
░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
13+
14+
</pre>
15+
16+
</div>
17+
18+
19+
# FRAI · Framework of Responsible Artificial Intelligence
20+
21+
![npm version](https://img.shields.io/npm/v/frai)
22+
23+
FRAI (Framework of Responsible Artificial Intelligence) is an open-source toolkit that helps any team — from solo developers to compliance officers — ship AI features responsibly. It walks you through quick questions, scans your code, and generates documentation you can actually hand to stakeholders: implementation checklists, model cards, risk files, evaluation reports, and policy-aware RAG indexes.
24+
25+
Think of FRAI as a safety net for AI launches: it collects the right facts, highlights blind spots, and keeps evidence tidy so production reviews stop feeling like guesswork.
26+
27+
## 🚀 Getting Started
28+
29+
**1. Install FRAI globally:**
30+
```bash
31+
npm install -g frai
32+
```
33+
34+
**2. Set up your OpenAI API key (required for AI-powered tips):**
35+
```bash
36+
frai --setup
37+
```
38+
You only need to do this once per machine or project. Your key is stored securely and never shared.
39+
40+
**3. Run FRAI in your project:**
41+
```bash
42+
frai
43+
```
44+
45+
> **Tip:** `frai` is available globally after installing the published npm package. If you're working from a local clone, follow the steps in [Local Development](#-local-development) to run the CLI from source.
46+
47+
---
48+
49+
## 🛠️ CLI Commands & Features
50+
51+
| Command | Description |
52+
|------------------------|-------------|
53+
| `frai` | Interactive mode for documenting an AI feature (8-question progressive system) |
54+
| `frai --scan` | Scan codebase for AI/ML code and generate docs |
55+
| `frai --setup` | Set up your OpenAI API key (local/global) |
56+
| `frai --ci` | Run in CI mode (non-interactive) |
57+
| `frai --help`, `-h` | Show help and usage info |
58+
| `frai --version`, `-v` | Show current version |
59+
| `frai --update` | Check for new versions of FRAI |
60+
| `frai --list-docs` | List generated documentation files |
61+
| `frai --clean` | Remove generated documentation files |
62+
| `frai --export-pdf` | Export documentation markdown files as PDFs |
63+
| `frai --show-config` | Show API key config status |
64+
| `frai --key=API_KEY` | Provide OpenAI API key directly (one-off use) |
65+
| `frai --global` | Use with --setup to save API key globally |
66+
| `frai rag index` | Index compliance docs into a local vector store |
67+
| `frai eval` | Run baseline evaluation metrics and write reports |
68+
69+
### RAG Indexing
70+
71+
```bash
72+
frai rag index --input docs/policies --output .frai/compliance-index.json --chunk-size 400
73+
```
74+
- Scans `.md`, `.txt`, `.json`, `.yaml` files recursively.
75+
- Generates a lightweight JSON vector store consumable by SDKs and future connectors.
76+
77+
### Evaluation Harness
78+
79+
```bash
80+
frai eval --outputs runs/outputs.json --references runs/golden.json --report reports/eval --format markdown
81+
```
82+
- Runs baseline metrics (exact match, toxicity keyword scan, length variance).
83+
- Produces JSON and/or Markdown summaries for CI and governance reviews.
84+
85+
**Docs generated:**
86+
- `checklist.md` — Implementation checklist
87+
- `model_card.md` — Model card
88+
- `risk_file.md` — Risk & compliance
89+
90+
---
91+
92+
## 💡 Features
93+
- **Progressive 8-question system**: Context-aware, fast, and actionable
94+
- **AI-powered recommendations**: Get tailored tips for responsible AI
95+
- **Comprehensive documentation**: Checklist, model card, and risk file
96+
- **PDF export**: Convert docs to PDF with one command
97+
- **Codebase scanning**: Detects AI/ML code and generates relevant docs
98+
- **Easy setup**: One-time API key configuration
99+
- **Compliance-aware RAG**: Build vector stores from policies for knowledge-grounded guardrails
100+
- **Evaluation harness**: Run baseline metrics and capture auditable reports
101+
102+
### Monorepo Layout
103+
104+
```
105+
frai/
106+
├─ packages/
107+
│ ├─ frai-cli/ # CLI entry point and command wiring
108+
│ └─ frai-core/ # Reusable services (config, questionnaire, documents, scanners, RAG, eval)
109+
├─ docs/ # Roadmaps, design notes, and feature backlogs
110+
└─ examples/ # Sample AI projects used in tests and demos
111+
```
112+
113+
---
114+
115+
## 🔑 API Key Setup
116+
FRAI requires an OpenAI API key for generating AI-powered tips and documentation. Run:
117+
```bash
118+
frai --setup
119+
```
120+
If you skip this step, FRAI will prompt you to set up your key on first use.
121+
122+
---
123+
124+
## 🧑‍💻 Local Development
125+
126+
Run FRAI directly from this repository without publishing:
127+
128+
```bash
129+
pnpm install
130+
pnpm --filter frai run build
131+
node packages/frai-cli/dist/index.js --help
132+
```
133+
134+
### Configure an OpenAI key from source
135+
136+
- Interactive CLI:
137+
```bash
138+
node packages/frai-cli/dist/index.js --setup YOUR_KEY
139+
```
140+
- Manual `.env`:
141+
```
142+
OPENAI_API_KEY=YOUR_KEY
143+
```
144+
145+
To test the global binary locally (without npm publishing), install the workspace package:
146+
147+
```bash
148+
pnpm install --global ./packages/frai-cli
149+
# then:
150+
frai --setup
151+
```
152+
153+
---
154+
155+
## 📖 Learn More
156+
- [GitHub Repository](https://github.com/sebastianbuzdugan/frai)
157+
- [NPM Package](https://www.npmjs.com/package/frai)
158+
- [AI Feature Backlog](docs/ai_feature_backlog.md)
159+
- [Evaluation Harness Design](docs/eval_harness_design.md)
160+
161+
---
162+
163+
*Generated by FRAI - Responsible AI in Minutes*

packages/frai-core/package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
"exports": {
88
".": "./src/index.js"
99
},
10+
"files": [
11+
"README.md",
12+
"LICENSE",
13+
"src/"
14+
],
1015
"scripts": {
11-
"build": "echo \"TODO: build step\"",
16+
"build": "echo \"No build step needed - ES modules\"",
1217
"lint": "eslint .",
1318
"test": "vitest"
1419
},
@@ -21,5 +26,11 @@
2126
"responsible-ai",
2227
"governance"
2328
],
24-
"license": "MIT"
29+
"author": "Sebastian Buzdugan",
30+
"license": "MIT",
31+
"repository": {
32+
"type": "git",
33+
"url": "git+https://github.com/sebastianbuzdugan/frai.git"
34+
},
35+
"homepage": "https://github.com/sebastianbuzdugan/frai#readme"
2536
}

0 commit comments

Comments
 (0)