create-filegrc 0.3.1 → 0.3.3
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/package.json +1 -1
- package/src/cli.js +19 -0
- package/src/index.js +20 -3
- package/template/AGENTS.md +2 -2
- package/template/README.md +36 -87
- package/template/WORKSPACE.md +1 -1
- package/template/data/AGENTS.md +2 -2
- package/template/docs/filegrc-home.png +0 -0
- package/template/docs/filegrc-social-preview.png +0 -0
- package/template/package.json +1 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -31,6 +31,9 @@ export async function runCli(argv = process.argv.slice(2)) {
|
|
|
31
31
|
`${result.install === "installed" ? "installed" : "installation skipped"}`
|
|
32
32
|
);
|
|
33
33
|
console.log(`Git: ${result.gitMode === "existing-worktree" ? "joined existing worktree" : "initialized new repository"}`);
|
|
34
|
+
if (result.gitDetached) {
|
|
35
|
+
console.log("Warning: detached HEAD detected. Check out a branch before using browser commit, pull, or push.");
|
|
36
|
+
}
|
|
34
37
|
console.log(`Timezone: ${result.values.timezone}`);
|
|
35
38
|
for (const stage of result.stages) {
|
|
36
39
|
console.log(`Stage ${stage.id}: ${stage.status}${stage.status === "created" ? ` (${stage.records} records)` : ""}`);
|
|
@@ -45,12 +48,21 @@ export async function runCli(argv = process.argv.slice(2)) {
|
|
|
45
48
|
console.log(` cd ${shellQuote(result.target)}`);
|
|
46
49
|
if (options.install === false) console.log(" npm install");
|
|
47
50
|
if (!result.setup) console.log(" npx filegrc setup");
|
|
51
|
+
if (result.setup) console.log(" npx filegrc program-path --next --json");
|
|
48
52
|
console.log(" npm run validate");
|
|
49
53
|
console.log(" npm run serve");
|
|
50
54
|
console.log("");
|
|
51
55
|
if (result.setup) {
|
|
52
56
|
console.log(`Service setup: ${result.setup.system.id} (${result.setup.system.status}), target ${result.setup.target.assuranceGoal}.`);
|
|
57
|
+
if (result.setup.draft) {
|
|
58
|
+
console.log("Planned and in scope means selected for scope review, not approved or active.");
|
|
59
|
+
}
|
|
53
60
|
}
|
|
61
|
+
console.log("Immediate human decisions:");
|
|
62
|
+
console.log(result.setup?.target.assuranceGoal && result.setup.target.assuranceGoal !== "none"
|
|
63
|
+
? ` 1. Confirm the selected assurance goal with management: ${assuranceGoalLabel(result.setup.target.assuranceGoal)}.`
|
|
64
|
+
: " 1. Select and confirm the assurance goal.");
|
|
65
|
+
console.log(" 2. Appoint an independent reviewer who is separate from the policy owner.");
|
|
54
66
|
console.log("Review the generated records, then commit the approved baseline.");
|
|
55
67
|
}
|
|
56
68
|
|
|
@@ -58,6 +70,13 @@ function shellQuote(value) {
|
|
|
58
70
|
return `'${String(value).replaceAll("'", "'\\''")}'`;
|
|
59
71
|
}
|
|
60
72
|
|
|
73
|
+
function assuranceGoalLabel(value) {
|
|
74
|
+
if (value === "soc-2-type-1") return "SOC 2 Type 1";
|
|
75
|
+
if (value === "soc-2-type-2") return "SOC 2 Type 2";
|
|
76
|
+
if (value === "readiness") return "Program Readiness";
|
|
77
|
+
return "No assurance goal selected";
|
|
78
|
+
}
|
|
79
|
+
|
|
61
80
|
function parseArgs(argv) {
|
|
62
81
|
let target;
|
|
63
82
|
const options = {};
|
package/src/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export async function createFilegrc(options = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
const joinedExistingWorktree = await isInsideGitWorktree(target);
|
|
52
52
|
if (!joinedExistingWorktree) await run("git", ["init"], target);
|
|
53
|
+
const gitHead = await inspectGitHead(target);
|
|
53
54
|
const setup = options.setup ? await runCombinedSetup(target, options.setup) : null;
|
|
54
55
|
const resourceCounts = setup ? await summarizeResources(target) : initialResourceCounts;
|
|
55
56
|
return {
|
|
@@ -64,7 +65,9 @@ export async function createFilegrc(options = {}) {
|
|
|
64
65
|
resourceCounts,
|
|
65
66
|
setup,
|
|
66
67
|
install: installed ? "installed" : "skipped",
|
|
67
|
-
gitMode: joinedExistingWorktree ? "existing-worktree" : "initialized"
|
|
68
|
+
gitMode: joinedExistingWorktree ? "existing-worktree" : "initialized",
|
|
69
|
+
gitBranch: gitHead.branch,
|
|
70
|
+
gitDetached: gitHead.detached
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -449,13 +452,13 @@ async function runCombinedSetup(target, input) {
|
|
|
449
452
|
async function writeMinimalLockfile(target, name, versionRange) {
|
|
450
453
|
const lock = {
|
|
451
454
|
name,
|
|
452
|
-
version: "0.3.
|
|
455
|
+
version: "0.3.3",
|
|
453
456
|
lockfileVersion: 3,
|
|
454
457
|
requires: true,
|
|
455
458
|
packages: {
|
|
456
459
|
"": {
|
|
457
460
|
name,
|
|
458
|
-
version: "0.3.
|
|
461
|
+
version: "0.3.3",
|
|
459
462
|
dependencies: { filegrc: versionRange }
|
|
460
463
|
}
|
|
461
464
|
}
|
|
@@ -472,6 +475,20 @@ async function isInsideGitWorktree(target) {
|
|
|
472
475
|
}
|
|
473
476
|
}
|
|
474
477
|
|
|
478
|
+
async function inspectGitHead(target) {
|
|
479
|
+
try {
|
|
480
|
+
const { stdout } = await execute("git", ["symbolic-ref", "--quiet", "--short", "HEAD"], { cwd: target });
|
|
481
|
+
return { branch: stdout.trim() || null, detached: false };
|
|
482
|
+
} catch {
|
|
483
|
+
try {
|
|
484
|
+
await execute("git", ["rev-parse", "--verify", "HEAD"], { cwd: target });
|
|
485
|
+
return { branch: null, detached: true };
|
|
486
|
+
} catch {
|
|
487
|
+
return { branch: null, detached: false };
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
475
492
|
async function run(command, args, cwd) {
|
|
476
493
|
try {
|
|
477
494
|
return await execute(command, args, { cwd, maxBuffer: 10_000_000 });
|
package/template/AGENTS.md
CHANGED
|
@@ -12,13 +12,13 @@ Do not guess a resource type, field name, enum value, relationship, or file path
|
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
npx filegrc guide --json
|
|
15
|
-
npx filegrc program-path --json
|
|
15
|
+
npx filegrc program-path --next --json
|
|
16
16
|
npx filegrc guide risk-assessment --json
|
|
17
17
|
npx filegrc list person --json
|
|
18
18
|
npx filegrc program-readiness --summary --json
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
`program-path` gives agents the
|
|
21
|
+
`program-path --next --json` gives agents the current step and first action. Use `--summary` for all six step statuses or `--current` for the current step’s full renderer Instructions, Use, Policy Basis, commands, and next actions. The general guide lists every supported action and record type. A type guide repeats that page guidance and adds timing, required and conditional fields, current relationship candidates, JSON location, and Markdown slots.
|
|
22
22
|
|
|
23
23
|
For a new record, generate a mutation envelope:
|
|
24
24
|
|
package/template/README.md
CHANGED
|
@@ -4,28 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
Run a SOC 2 program as files in Git.
|
|
6
6
|
|
|
7
|
-
filegrc gives
|
|
7
|
+
filegrc gives founder-led engineering teams one place to adopt policies, implement controls, run recurring work, collect evidence, and prepare an audit.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Why it exists
|
|
12
|
-
|
|
13
|
-
SOC 2 work tends to scatter across documents, calendars, tickets, screenshots, and the auditor’s request list. That makes it hard to answer basic questions: What is due? Which policy requires it? What changed during the audit period? Is the evidence complete?
|
|
14
|
-
|
|
15
|
-
filegrc keeps that work connected:
|
|
16
|
-
|
|
17
|
-
- A starter Security program links criteria references, policies, planned controls, owners, and schedules.
|
|
18
|
-
- Work Queue turns policy timing into upcoming, due, and overdue work.
|
|
19
|
-
- Policy Events add the required hiring, departure, vendor, incident, and change tasks to the Work Queue.
|
|
20
|
-
- Program Readiness says whether management can begin a candidate Type 2 evidence period without an audit record.
|
|
21
|
-
- Audit Readiness starts later with the CPA engagement, formal period, fieldwork documents, populations, and evidence delivery.
|
|
22
|
-
- The packet builder produces a scoped, indexed delivery with source files, attachments, history, and checksums.
|
|
23
|
-
|
|
24
|
-
The starter content is a proposal, not a claim of compliance. Review every policy and planned control against how your company actually operates before approving it.
|
|
25
|
-
|
|
26
|
-
## Start a workspace
|
|
27
|
-
|
|
28
|
-
You need Node.js 20 or newer and Git.
|
|
9
|
+
It is open source, MIT licensed, and runs locally.
|
|
29
10
|
|
|
30
11
|
```sh
|
|
31
12
|
npx create-filegrc@latest company-grc
|
|
@@ -34,96 +15,64 @@ npm run validate
|
|
|
34
15
|
npm run serve
|
|
35
16
|
```
|
|
36
17
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Setup asks for the legal organization name, the initial policy owner and their email, a security reporting address, and the program timezone. It initializes Git when needed. The first local run then defines the initial service boundary and an optional program goal. A Type 2 choice records management intent, not an audit engagement. Completing onboarding opens Step 1 so you can add the real reviewers and operators, finish the oversight team, and confirm the criteria, commitments, vendors, and systems before moving on.
|
|
40
|
-
|
|
41
|
-
Open the printed local URL. You can commit locally from Repository without configuring a remote. Add a remote when the team is ready to share the workspace, then the browser can pull with rebase and push reviewed commits.
|
|
42
|
-
|
|
43
|
-
The creation summary reports the resolved engine version, program timezone, starter record counts, install result, and whether the target joined an existing Git worktree. Generated workspaces receive an organization-specific README with their engine version, validation commands, and remaining setup work.
|
|
18
|
+
Requires Node.js 20 or newer and Git.
|
|
44
19
|
|
|
45
20
|
## How it works
|
|
46
21
|
|
|
47
|
-
|
|
48
|
-
2. Review and activate the policies with a separate management reviewer, who is usually internal and may be external.
|
|
49
|
-
3. Tailor the starter controls, add each owner, actual procedure, scope, cadence, evidence source, and implementation date, and confirm any linked Work Queue schedules are enabled. Marking a control implemented starts eligible schedules. Then record any complementary customer or subservice controls.
|
|
50
|
-
4. After confirming the applicable controls and authoritative source Systems, preview the proposed External Evidence drafts with `npx filegrc evidence-test-drafts --preview --json`. Create only the relevant drafts, collect each named artifact, and have another person verify it.
|
|
51
|
-
5. Start the management candidate period, maintain risk assessments and risks, update controls when needed, work the filegrc queue, and preserve dated evidence.
|
|
52
|
-
6. Engage a CPA firm, record the separate firm-agreed period, review filegrc Evidence and External Evidence, prepare fieldwork, and generate the evidence packet.
|
|
22
|
+
The repository is the program. There is no separate application database.
|
|
53
23
|
|
|
54
|
-
|
|
24
|
+
- **JSON** holds records that filegrc validates, filters, and connects.
|
|
25
|
+
- **Markdown** holds policies, procedures, plans, minutes, and narratives.
|
|
26
|
+
- **Git** supplies authors, timestamps, revisions, diffs, and commit messages.
|
|
55
27
|
|
|
56
|
-
|
|
28
|
+
Use the same source through the local web app, a text editor, the CLI, or CI. Browser and CLI actions call the same rules, so engineers and agents see the same validation and readiness results.
|
|
57
29
|
|
|
58
|
-
##
|
|
59
|
-
|
|
60
|
-
Use Overview to follow one six-step path: define scope, approve policies, implement controls, test External Evidence, operate the program, then complete the audit. Steps 1 through 4 and Step 6 open an overview with instructions, record links, progress, and completion status. Step 5 opens Policy Events and the Work Queue because operation is ongoing rather than a one-time checklist. The progress tracker opens the first incomplete step.
|
|
30
|
+
## One path from setup to audit
|
|
61
31
|
|
|
62
32
|

|
|
63
33
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```sh
|
|
71
|
-
npx filegrc guide risk-assessment --json
|
|
72
|
-
npx filegrc program-path --json
|
|
73
|
-
npx filegrc scaffold risk-assessment --title "2026 Annual Risk Assessment"
|
|
74
|
-
npx filegrc list risk --json
|
|
75
|
-
npx filegrc obligations --json
|
|
76
|
-
npx filegrc program-readiness --summary --json
|
|
77
|
-
npx filegrc complete obligation-id completion-record.json
|
|
78
|
-
npx filegrc trigger person-started --occurred-on 2026-07-25 --subject person-id
|
|
79
|
-
npx filegrc complete-action action-item-id completion-record.json --completed-on 2026-07-25
|
|
80
|
-
npx filegrc complete-event obligation-event-id --completed-on 2026-07-25
|
|
81
|
-
npx filegrc search "access review"
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`program-path` reports the same six steps, current status, page order, exact Instructions, Use, Policy Basis, and next actions shown in the renderer. `program-readiness --summary --json` reports compact stage counts and next actions; omit `--summary` when you need every readiness item. `guide` reports that same page guidance for one resource, plus timing, required fields, valid values, relationship candidates, and Markdown locations. `scaffold` produces the same JSON and Markdown mutation shape used by the browser. Read `AGENTS.md` and `data/AGENTS.md` for the full headless workflow.
|
|
34
|
+
1. **Define scope.** Confirm owners, criteria, commitments, vendors, and in-scope systems.
|
|
35
|
+
2. **Approve policies.** Tailor the proposals and record separate owners and reviewers.
|
|
36
|
+
3. **Implement controls.** Add the real procedure, scope, cadence, and evidence source.
|
|
37
|
+
4. **Test evidence collection.** Collect and verify evidence from each authoritative system.
|
|
38
|
+
5. **Operate the program.** Work the queue, trigger Policy Events, maintain risks, and preserve dated evidence.
|
|
39
|
+
6. **Audit.** Record the CPA engagement and agreed period, support fieldwork, and build the packet.
|
|
85
40
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Program Readiness works without an audit ID or CPA firm:
|
|
89
|
-
|
|
90
|
-
```sh
|
|
91
|
-
npx filegrc program-readiness --json
|
|
92
|
-
npx filegrc program-readiness --require-ready
|
|
93
|
-
```
|
|
41
|
+
The Program Overview shows what is done, what is blocked, and what to do next.
|
|
94
42
|
|
|
95
|
-
The
|
|
43
|
+
## The routine work stays connected
|
|
96
44
|
|
|
97
|
-
|
|
45
|
+
- **Work Queue** turns policy schedules and follow-up into upcoming, due, and overdue work.
|
|
46
|
+
- **Policy Events** create the right tasks for hiring, departures, incidents, vendor changes, and other events.
|
|
47
|
+
- **Program Readiness** checks whether management can begin a reliable evidence period.
|
|
48
|
+
- **Audit Readiness** checks the engagement, period, documents, evidence, and Type 2 populations.
|
|
49
|
+
- **Evidence packets** collect the scoped records, attachments, history, indexes, and checksums for delivery.
|
|
98
50
|
|
|
99
|
-
|
|
51
|
+

|
|
100
52
|
|
|
101
|
-
|
|
53
|
+
Starter records connect policies, controls, owners, systems, evidence, and schedules. They are proposals, so review them against how your company actually works before approval.
|
|
102
54
|
|
|
103
|
-
|
|
55
|
+
## Built for engineers and agents
|
|
104
56
|
|
|
105
|
-
|
|
57
|
+
The browser is helpful, but it is not required. An agent can discover the model, inspect valid relationships, create records, complete scheduled work, trigger events, and check the result from the CLI.
|
|
106
58
|
|
|
107
59
|
```sh
|
|
108
|
-
npx filegrc
|
|
60
|
+
npx filegrc program-path --next --json
|
|
61
|
+
npx filegrc guide risk-assessment --json
|
|
62
|
+
npx filegrc obligations --json
|
|
63
|
+
npx filegrc program-readiness --summary --json
|
|
109
64
|
npx filegrc audit-readiness audit-id --json
|
|
110
65
|
npx filegrc evidence-packet --audit audit-id
|
|
111
66
|
```
|
|
112
67
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Early CPA engagement remains available when a customer deadline, unusual scope, or other timing risk needs input before the program reaches Evidence Ready. It is optional, not the default first action.
|
|
116
|
-
|
|
117
|
-
## What belongs elsewhere
|
|
118
|
-
|
|
119
|
-
filegrc does not replace workforce, identity, source-control, deployment, infrastructure, monitoring, endpoint, backup, vulnerability, training, signature, procurement, contract, or vendor-risk systems.
|
|
68
|
+
Read `AGENTS.md` and `data/AGENTS.md` inside a generated workspace for the full headless workflow.
|
|
120
69
|
|
|
121
|
-
|
|
70
|
+
## Clear boundaries
|
|
122
71
|
|
|
123
|
-
|
|
72
|
+
filegrc manages GRC records and audit evidence. Your workforce, identity, source control, infrastructure, monitoring, endpoint, backup, training, signature, procurement, and vendor systems still operate the controls and produce source evidence.
|
|
124
73
|
|
|
125
|
-
|
|
74
|
+
The independent CPA firm still selects samples, tests controls, evaluates exceptions, decides whether evidence is sufficient, and issues the SOC 2 report.
|
|
126
75
|
|
|
127
|
-
|
|
76
|
+
Do not put secrets or personal data that may need erasure into Git. The editable local server has no authentication and binds to loopback by default.
|
|
128
77
|
|
|
129
|
-
|
|
78
|
+
Learn more at [filegrc.com](https://filegrc.com) or [view the source on GitHub](https://github.com/Sunpeak-AI/filegrc).
|
package/template/WORKSPACE.md
CHANGED
|
@@ -20,7 +20,7 @@ Agents and terminal users can inspect the workspace without the browser:
|
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
22
|
npx filegrc guide --json
|
|
23
|
-
npx filegrc program-path --json
|
|
23
|
+
npx filegrc program-path --next --json
|
|
24
24
|
npx filegrc obligations --json
|
|
25
25
|
npx filegrc validate --json
|
|
26
26
|
```
|
package/template/data/AGENTS.md
CHANGED
|
@@ -8,14 +8,14 @@ Treat the installed model as the authority. Do not infer a schema from a nearby
|
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npx filegrc guide --json
|
|
11
|
-
npx filegrc program-path --json
|
|
11
|
+
npx filegrc program-path --next --json
|
|
12
12
|
npx filegrc types --json
|
|
13
13
|
npx filegrc guide RESOURCE_TYPE --json
|
|
14
14
|
npx filegrc list RESOURCE_TYPE --json
|
|
15
15
|
npx filegrc search "TERM" --json
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Use `program-path` to find the current lifecycle step and
|
|
18
|
+
Use `program-path --next --json` to find the current lifecycle step and first action. Use `--summary` for all six step statuses or `--current` for the current step’s full renderer Instructions, Use, Policy Basis, commands, and next actions. Use `guide` before any unfamiliar create or status transition. It repeats the page guidance and reports required fields, fields required by a status, enum values, relationship types and candidates, Markdown slots, timing, and exact paths. Use `describe` only when you need the raw model definition.
|
|
19
19
|
|
|
20
20
|
## Choose the right record
|
|
21
21
|
|
|
Binary file
|
|
Binary file
|