Polyfact
polyfact
is a nodejs package aimed at assisting developers in creating project using AI.
The package is split into 2 parts:
- The SDK that can be imported in any nodejs project and provides the basic building blocks for AI tool developement
- The CLI which is a bundle of dev-tools currently under active development, with documentation autogeneration as its functional feature at this stage.
SDK
Installation
To install polyfact into your repository:
npm install polyfact
Get your your polyfact token by signing up with github here: https://app.polyfact.com
Add your Polyfact Token in the POLYFACT_TOKEN
environment variable:
export POLYFACT_TOKEN=
Usage
You can now use Polyfact in your nodejs project:
import { generateWithType } from "polyfact";
import * as t from "io-ts";
(async () => {
const result = await generateWithType("Count from 1 to 5", t.type({ result: t.array(t.number) }));
console.log(result);
})();
{ result: [1, 2, 3, 4, 5] }
CLI
polyfact
uses the following command structure for documentation generation:
npx polyfact docs <folder> [options]
Arguments
<folder>
: This is the path of the folder from which to generate the documentation. This argument is mandatory.
Options
-
-n, --name <doc_name>
: This is the name of the documentation. If not provided, it defaults to 'id'.
-
-d, --deploy <subdomain>
: This option allows you to provide a subdomain to which the generated documentation will be deployed.
-
--doc_id <doc_id>
: If the doc_id has already been generated, you can send it as an argument here.
Examples
npx polyfact docs ./src
npx polyfact docs ./src --name "my-documentation"
npx polyfact docs ./src --deploy my-subdomain
Future Enhancements
polyfact
is planned to support more dev-tools features in the near future. Stay tuned for more enhancements that would aid you with AI features.