CLI for scaffolding ContextAI projects and packages
npm install @contextaisdk/cliCLI for scaffolding ContextAI projects and packages.
``bash`
npm install -g @contextaisdk/clior
pnpm add -g @contextaisdk/clior use directly with npx
npx @contextaisdk/cli
Create a new package in the monorepo.
Types:
- provider - LLM provider adapter (e.g., provider-openai)agent
- - Agent/feature packagecomponent
- - React component packagelibrary
- - Utility library
Examples:
`bashCreate a new provider
contextai new provider my-llm
Options:
-
-y, --yes - Skip prompts and use defaults
- -d, --dry-run - Preview files without creating them
- --description - Custom package description$3
Bootstrap a new ContextAI project with monorepo structure.
`bash
contextai init
contextai init --template minimal
`Options:
-
-y, --yes - Skip prompts and use defaults
- -d, --dry-run - Preview files without creating them
- -t, --template - Template to use (minimal, full)$3
Analyze bundle sizes of packages in the monorepo.
`bash
contextai analyze
contextai analyze --filter core
contextai analyze --format json
`Options:
-
-f, --filter - Filter to specific package
- --format - Output format (table, json)
- --detailed - Show detailed breakdownPackage Templates
$3
Creates a fully-typed LLM provider adapter with:
-
LLMProvider interface implementation
- Typed configuration
- Custom error class with error codes
- Test scaffolding with mocks$3
Creates an agent package with:
-
Agent interface implementation
- Typed configuration and results
- Test scaffolding$3
Creates a React component package with:
- Functional component
- Custom hook
- TypeScript props types
- Test scaffolding with React Testing Library
$3
Creates a utility library with:
- Export barrel
- Example utilities
- Test scaffolding
Development
`bash
Build the CLI
pnpm build --filter=@contextaisdk/cliTest locally
node packages/cli/dist/index.cjs --help
node packages/cli/dist/index.cjs new provider testRun tests
pnpm test --filter=@contextaisdk/cli
``MIT