JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q57985F
  • License BUSL-1.1

Shared CLI framework for cli4ai tools

Package Exports

  • @cli4ai/lib
  • @cli4ai/lib/browser

Readme

@cli4ai/lib

Official @cli4ai package • https://cli4ai.com • Install cli4ai: npm i -g cli4ai

Shared CLI framework used by @cli4ai/* tool packages (env loading, JSON output, consistent errors).

Setup

npm i @cli4ai/lib

Usage

import { cli, output, withErrorHandling, env } from '@cli4ai/lib/cli.ts';

const program = cli('mytool', '1.0.0', 'Example tool');

program
  .command('hello')
  .action(withErrorHandling(async () => {
    const name = env('NAME');
    output({ hello: name });
  }));

program.parse();