npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@docufin/cli

v0.0.2

Published

The Docufin CLI lets you scaffold, validate, compile, and deploy pipelines from your local workspace. It is built for deterministic artifacts and CI-friendly output so you can ship workflows with confidence.

Readme

Docufin CLI

The Docufin CLI lets you scaffold, validate, compile, and deploy pipelines from your local workspace. It is built for deterministic artifacts and CI-friendly output so you can ship workflows with confidence.

Requirements

  • Bun 1.3 or later installed locally
  • A Docufin project id and API token when deploying

Running the CLI

The CLI is invoked as npx @docufin/cli. From a source checkout you can run it with Bun (for example bun run packages/@docufin/cli/src/index.tsx --help) until the packaged build is published. All commands share a consistent shape:

npx @docufin/cli [global options] <command> [command options]

Global options

  • --project <id>: Docufin project id (env: DOCUFIN_PROJECT)
  • --token <token>: API token (env: DOCUFIN_TOKEN)
  • --api <url>: API base URL (env: DOCUFIN_API, defaults to compiled value)
  • --json: emit a single JSON object to stdout (success or error)
  • --quiet: suppress non-essential logs (errors still go to stderr)
  • --cwd <path>: run as if invoked from another directory

Precedence: flags override environment variables, which override any workspace config file (workspace config lands after the MVP).

Commands

npx @docufin/cli pipelines new <name>

Scaffold a pipeline folder at ./pipelines/<name>/. Valid names must be workflow export identifiers (for example, DemoOcrPipeline).

Creates:

  • pipeline.yaml
  • src/index.ts
  • README.md inside the pipeline
  • optional samples/

Exit codes: 0 on success, 1 if the name is invalid or the path already exists.

Example

npx @docufin/cli pipelines new invoice_ingest

npx @docufin/cli pipelines validate <name>

Validate a pipeline locally without compiling. The <name> may be a path; otherwise ./pipelines/<name> is used.

Checks:

  • pipeline.yaml (or .json) exists and matches the schema
  • Entrypoint exists
  • References to local files resolve
  • Pipeline name matches the manifest (may warn)

Outputs:

  • Human mode: list of checks and readable errors
  • JSON mode: { ok, pipelinePath, errors: [{ code, message, file?, line?, col? }] }

Exit codes: 0 when valid, 1 when validation fails.

Example

npx @docufin/cli pipelines validate invoice_ingest

npx @docufin/cli pipelines compile <name> --out <dir>

Create a deterministic build artifact after running validation. --out is required.

Output structure:

<out>/
  manifest.json
  bundle/
    index.js
  source.zip
  artifact.zip
  artifact.sha256
  build-meta.json

Determinism guarantees:

  • Stable ordering inside zip files
  • Normalized timestamps (no local clock leakage)
  • No absolute paths inside artifacts
  • artifact.sha256 derived from artifact bytes

Exit codes: 0 on success, 1 on validation or build errors.

Example

npx @docufin/cli pipelines compile invoice_ingest --out .docufin/build/invoice_ingest

npx @docufin/cli pipelines deploy <name> [--message <msg>] [--out <dir>]

End-to-end deployment: validate → compile → package → upload → create revision.

Config requirements: --token and --project (or DOCUFIN_TOKEN / DOCUFIN_PROJECT) must be present.

Behavior:

  1. Resolve config and pipeline path
  2. Validate pipeline
  3. Compile deterministic artifact
  4. Upload artifact
  5. Create a new revision
  6. Print deployment result

Options:

  • --message <msg>: release note for the revision
  • --out <dir>: reuse a build directory (defaults to .docufin/build/... next to the pipeline config if omitted)
  • --json: print only the final JSON object (errors still go to stderr)

Exit codes:

  • 0 success
  • 1 config or validation error
  • 2 network error (timeouts, DNS)
  • 3 API/server error (HTTP 4xx/5xx)

JSON success shape:

{
  "ok": true,
  "pipeline": "invoice_ingest",
  "revisionId": "rev_123",
  "artifactSha256": "…",
  "project": "proj_abc"
}

Example

DOCUFIN_TOKEN=token DOCUFIN_PROJECT=proj_123 \
npx @docufin/cli pipelines deploy invoice_ingest --message "CI deploy" --json

npx @docufin/cli evals new <name> --path <dir>

Upload an eval dataset from a local folder. The folder must include a ground-truth/ directory and an inputs/ directory (case-insensitive).

Naming rules:

  • Input and ground truth file names must match (ignoring extensions).
  • Use a numeric suffix (.x) to represent multiple inputs or outputs for the same base file name.

Example

npx @docufin/cli evals new demo_eval --path deploy/compose/demo-data

npx @docufin/cli uploads upload <paths..>

Upload files or folders to the raw bucket (docufin-raw). Directories are uploaded recursively with their folder structure preserved from the specified folder. Use --prefix to target a path inside the bucket.

Examples

npx @docufin/cli uploads upload ./docs --prefix invoices/2024
npx @docufin/cli uploads upload ./contract.pdf ./receipt.pdf --prefix incoming

Typical workflow

  1. Scaffold: npx @docufin/cli pipelines new my_pipeline
  2. Develop and run local checks: npx @docufin/cli pipelines validate my_pipeline
  3. Produce a deterministic artifact: npx @docufin/cli pipelines compile my_pipeline --out .docufin/build/my_pipeline
  4. Deploy from CI or local: npx @docufin/cli pipelines deploy my_pipeline --message "Release notes"