{"_id":"@codeflow-team/cli","_rev":"3-9b48dd00730257e4944c82f7a4e9dad4","name":"@codeflow-team/cli","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@codeflow-team/cli","version":"0.1.0","keywords":["codeflow","cli","codegen","scaffold","workflow","agent","typescript","mcp"],"author":{"name":"Lucas"},"license":"AGPL-3.0-or-later","_id":"@codeflow-team/cli@0.1.0","maintainers":[{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"}],"homepage":"https://github.com/codeflow-team/codeflow/tree/main/packages/cli#readme","bugs":{"url":"https://github.com/codeflow-team/codeflow/issues"},"bin":{"codeflow":"dist/cli.js"},"dist":{"shasum":"3d7ed1dc0387288040b0900ad46514c341d7e259","tarball":"https://registry.npmjs.org/@codeflow-team/cli/-/cli-0.1.0.tgz","fileCount":83,"integrity":"sha512-kB8pkJmZEGFJZiWM2TTnEyGnHfZFIFcYiKlfhRiOJF968nWcJdNvSPA9/0FW9VNrgUxNTCnESjysoS66h2dNLQ==","signatures":[{"sig":"MEYCIQDoisahLI43VSdUGwWIRi3I6gGA4ew+csrQe0gqxSc0+gIhAMC04vIlF8nWYy6kglpkNvrX/fuZhAfZaGnAL18UEceE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codeflow-team%2fcli@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":282524},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/_temp/dist/codeflow-team-cli-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":"^22.18.0 || >=23.6.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"},"_resolved":"/home/runner/work/_temp/dist/codeflow-team-cli-0.1.0.tgz","_integrity":"sha512-kB8pkJmZEGFJZiWM2TTnEyGnHfZFIFcYiKlfhRiOJF968nWcJdNvSPA9/0FW9VNrgUxNTCnESjysoS66h2dNLQ==","repository":{"url":"git+https://github.com/codeflow-team/codeflow.git","type":"git","directory":"packages/cli"},"_npmVersion":"12.0.2","description":"The `codeflow` command — scaffold a flow workspace, generate typed tool/library declarations from codeflow.config.ts, and check flows against the contract.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"@codeflow-team/core":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1788193865285_0.5317771042907022","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@codeflow-team/cli","version":"0.2.0","keywords":["codeflow","cli","codegen","scaffold","workflow","agent","typescript","mcp"],"author":{"name":"Lucas"},"license":"AGPL-3.0-or-later","_id":"@codeflow-team/cli@0.2.0","maintainers":[{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"}],"homepage":"https://github.com/codeflow-team/codeflow/tree/main/packages/cli#readme","bugs":{"url":"https://github.com/codeflow-team/codeflow/issues"},"bin":{"codeflow":"dist/cli.js"},"dist":{"shasum":"227341debb3975b5f494119d4122901f905ef6d7","tarball":"https://registry.npmjs.org/@codeflow-team/cli/-/cli-0.2.0.tgz","fileCount":83,"integrity":"sha512-1A60LdCzw/umi2rb2VALN05IwMYgfNx705cuBsvY49FC78s0yjX8J8NNVjfF7kmt+nZDEo61RyO+H9gNX2sDHA==","signatures":[{"sig":"MEYCIQCmlUVIMP0rWdowD/6JfwxIc1gLQcP0gP7f0FFK2AaqWwIhAKkwbU++UrwW9MlABacDlUruFpxhonH+lakhIo0UREFe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codeflow-team%2fcli@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":282524},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/_temp/dist/codeflow-team-cli-0.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":"^22.18.0 || >=23.6.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"},"_resolved":"/home/runner/work/_temp/dist/codeflow-team-cli-0.2.0.tgz","_integrity":"sha512-1A60LdCzw/umi2rb2VALN05IwMYgfNx705cuBsvY49FC78s0yjX8J8NNVjfF7kmt+nZDEo61RyO+H9gNX2sDHA==","repository":{"url":"git+https://github.com/codeflow-team/codeflow.git","type":"git","directory":"packages/cli"},"_npmVersion":"12.0.2","description":"The `codeflow` command — scaffold a flow workspace, generate typed tool/library declarations from codeflow.config.ts, and check flows against the contract.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"@codeflow-team/core":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.0_1788201248937_0.9899794956445969","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@codeflow-team/cli","version":"0.3.0","description":"The `codeflow` command — scaffold a flow workspace, generate typed tool/library declarations from codeflow.config.ts, and check flows against the contract.","keywords":["codeflow","cli","codegen","scaffold","workflow","agent","typescript","mcp"],"license":"AGPL-3.0-or-later","author":{"name":"Lucas"},"homepage":"https://github.com/codeflow-team/codeflow/tree/main/packages/cli#readme","repository":{"type":"git","url":"git+https://github.com/codeflow-team/codeflow.git","directory":"packages/cli"},"bugs":{"url":"https://github.com/codeflow-team/codeflow/issues"},"type":"module","sideEffects":false,"bin":{"codeflow":"dist/cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":"^22.18.0 || >=23.6.0"},"publishConfig":{"access":"public"},"dependencies":{"@codeflow-team/core":"^0.3.0"},"devDependencies":{"@types/node":"^22.10.2","typescript":"^5.7.2"},"scripts":{"build":"tsc -p tsconfig.build.json","typecheck":"tsc --noEmit","test":"vitest run"},"_id":"@codeflow-team/cli@0.3.0","_integrity":"sha512-Io7v6AjoO+nxXJQUNiHw1j2zA0OxiZZsfO2QfC87BSV1+n/q0ShCuryBPar+blKwQuQnfjoQGmt9YlfZTTJpkA==","_resolved":"/home/runner/work/_temp/dist/codeflow-team-cli-0.3.0.tgz","_from":"file:/home/runner/work/_temp/dist/codeflow-team-cli-0.3.0.tgz","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-Io7v6AjoO+nxXJQUNiHw1j2zA0OxiZZsfO2QfC87BSV1+n/q0ShCuryBPar+blKwQuQnfjoQGmt9YlfZTTJpkA==","shasum":"1048c064cdc1a4a580432f77c04ee3db910229f0","tarball":"https://registry.npmjs.org/@codeflow-team/cli/-/cli-0.3.0.tgz","fileCount":83,"unpackedSize":282524,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codeflow-team%2fcli@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDALbaXb+2KCTRYbBiI1VBdhXTzrbiRKUCWpApTPd0uCgIhAJEAYkh/J4si2bHUtVEiMMA38Y2Oi3Yi7QgbcEkuZsid"}]},"_npmUser":{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"},"directories":{},"maintainers":[{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.3.0_1788356167952_0.04009217571510004"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T16:31:05.042Z","modified":"2026-09-02T13:36:08.457Z","0.1.0":"2026-08-31T16:31:05.482Z","0.2.0":"2026-08-31T18:34:09.107Z","0.3.0":"2026-09-02T13:36:08.082Z"},"bugs":{"url":"https://github.com/codeflow-team/codeflow/issues"},"author":{"name":"Lucas"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/codeflow-team/codeflow/tree/main/packages/cli#readme","keywords":["codeflow","cli","codegen","scaffold","workflow","agent","typescript","mcp"],"repository":{"type":"git","url":"git+https://github.com/codeflow-team/codeflow.git","directory":"packages/cli"},"description":"The `codeflow` command — scaffold a flow workspace, generate typed tool/library declarations from codeflow.config.ts, and check flows against the contract.","maintainers":[{"name":"lucas.pmd","email":"phanminhduong2212@gmail.com"}],"readme":"# `@codeflow-team/cli`\n\nThe Node-only half of CodeFlow. It owns everything that touches the filesystem — the workspace scaffold, the generated type declarations, the function library stored in `lib/`, and a workspace-wide check you can put in CI — so that [`@codeflow-team/core`](../core/README.md) can stay browser-safe.\n\nEvery command is also a plain function, so a host app can run the same generate pass without shelling out.\n\nSee the [root README](../../README.md) for what CodeFlow is.\n\n## Install\n\nPrepared for npm as v0.1.0. Until the first release lands, the binary is `packages/cli/dist/cli.js` after `pnpm build`, and the package is added as a dependency the workspace way:\n\n```jsonc\n\"dependencies\": { \"@codeflow-team/cli\": \"workspace:*\" }\n```\n\nNeeds Node 22.18+ or 23.6+ — `codeflow.config.ts` is loaded with Node's own type-stripping rather than a bundler, so the CLI adds no build dependency to your project.\n\n## Commands\n\n```text\ncodeflow init [dir] [--force]     scaffold codeflow.config.ts, flows/, lib/, tsconfig.json\ncodeflow generate [--agent-md]    regenerate generated/tools.d.ts + generated/lib.d.ts\ncodeflow check [--json]           analyze every flow, report diagnostics, flag stale artifacts\n```\n\nA full round trip, run end to end:\n\n```console\n$ codeflow init myflows\ncodeflow init — /tmp/myflows\n  write package.json\n  write codeflow.config.ts\n  write tsconfig.json\n  write flows/README.md\n  write lib/is-auth-change.ts\n  write lib/index.ts\n\nNext: codeflow generate\n\n$ cd myflows && codeflow generate\ncodeflow generate — codeflow.config.ts\n  registry: 3 tool(s), 1 library function(s)  [registryHash 0b84875efe85]\n    ok  lib/index.ts\n  write generated/tools.d.ts\n  write generated/lib.d.ts\n  write prompts/flow-style.md\n\n$ codeflow check\ncodeflow check — /tmp/myflows/codeflow.config.ts\n  registry: 3 tools, 1 library function  [registryHash 0b84875efe85]\n\nflows/canonical.flow.ts — L2, 7 nodes\n  no diagnostics\n\nlibrary function usage (@flows/lib)\n  isAuthChange  ← flows/canonical.flow.ts\n\nok — 1 flow checked, 0 warnings\n```\n\n`check` exits 1 on any error diagnostic or any generated artifact that no longer matches the registry, which makes it a CI gate. `--json` prints the same result machine-readably. `generate --agent-md` additionally prints the `CLAUDE.md` / `AGENTS.md` section that points a coding agent at the generated files and the flow-style rules.\n\n## The API entry points that matter\n\n| Export | What it is for |\n|---|---|\n| `generate(options)` | The generate pass. Returns which files it wrote and the registry it used. |\n| `check(options)` / `checkToJson` / `formatCheck` | Workspace analysis: per-flow level and diagnostics, stale-artifact detection, and the library usage index. |\n| `init(options)` | The scaffold. |\n| `loadWorkspace` / `findConfig` / `loadConfigFile` / `registryFromConfig` | Read `codeflow.config.ts` and turn it into a `Registry` — the piece to reuse if you want the registry without the CLI. |\n| `FileFunctionLibraryStore` / `createLibraryStore` | The function library over `lib/`. Metadata lives in a header comment inside each function's own file, so there is never a second copy to drift. |\n| `buildUsageIndex` / `findFlowFiles` / `loadFlows` | Which flow uses which library function — the guard behind \"you cannot delete a function three flows still call\". |\n| `defineConfig` | Typed `codeflow.config.ts` authoring. |\n\n```js\nimport { check, formatCheck } from \"@codeflow-team/cli\";\n\nconst result = await check({ cwd: process.cwd() });\nconsole.log(formatCheck(result).join(\"\\n\"));   // formatCheck returns lines\nprocess.exit(result.ok ? 0 : 1);\n```\n\n## Notable behaviour\n\n- The generated `prompts/flow-style.md` is imported from core rather than duplicated here — one source of truth for the rules an AI is given.\n- Renaming a library function rewrites the declaration inside its own file so the workspace still type-checks, but it does **not** rewrite the flows that import it. That is deliberate: the CLI says what it did instead of guessing at call sites.\n- The scaffolded `tsconfig.json` uses `moduleResolution: \"Bundler\"`, because the flow contract imports without file extensions.\n\n## Tests\n\n```bash\npnpm --filter @codeflow-team/cli test   # 63 tests\n```\n\n## License\n\n[GNU AGPL v3 or later](LICENSE).\n","readmeFilename":"README.md"}