@flexiberry/cli
v0.1.4
Published
The official CLI shell for the FlexiBerry API Testing Framework, enabling keyboard-driven interactive creation, parsing, validation, and execution of Berry DSL scripts.
Maintainers
Readme
@flexiberry/cli
The official zero-dependency CLI shell for the FlexiBerry API Testing Framework, bringing keyboard-driven interactive creation, parsing, validation, and execution of .berry DSL scripts straight to your terminal.
@flexiberry/cli eliminates the need for heavy API clients and constant context switching. It features a rich terminal-based wizard to generate tasks, steps, endpoints, and environment variables interactively, converts cURL and Swagger definitions into Berry DSL, and executes scripts locally with live execution metrics powered by @flexiberry/berrycore.
✨ What is FlexiBerry CLI?
The FlexiBerry CLI brings the power of the FlexiBerry API Testing Framework directly into your terminal. It offers a fully interactive, keyboard-driven menu system that allows you to effortlessly design, test, and manage .berry domain-specific language files.
No context switching, no heavy browsers—just pure, frictionless API engineering.
⚡ Features
- Interactive Wizards: Generate
Task,Step,Api, andEnvblocks interactively—no need to memorize syntax. - cURL & Swagger Imports: Instantly parse complex cURL commands or OpenAPI/Postman schemas straight into
.berryDSL. - Local AST Engine: Powered natively by
@flexiberry/berrycoreto perform real-time parsing, formatting, and validation. - Stateful Execution: The CLI dynamically remembers your working directory and recent files to speed up your workflow.
- Zero Third-Party Clutter: Designed to be extremely lightweight and lightning-fast.
📦 Installation
Install the CLI globally via NPM to make the flexiberry command accessible anywhere:
npm install -g @flexiberry/cli🚀 Quick Start
The quickest way to get started is by launching the interactive wizard! Just run:
flexiberry cliThis will launch a rich, terminal UI guiding you through creating files, running tests, and managing your API suites.
🛠️ CLI Commands
If you prefer passing arguments directly, the CLI supports a robust set of standard commands.
flexiberry create
Create a new .berry script with an optional template.
flexiberry create my-test.berryFlags:
-f, --force: Overwrite if the file already exists-s, --secret: Creates a secured.berrytemplate
flexiberry select
Sets your active/target script file for the current session.
flexiberry select ./my-test.berryflexiberry add
Programmatically add elements like APIs, Tasks, Steps, or Environments to your active .berry script.
# Add an API from a raw cURL command
flexiberry add api LoginEndpoint -c "curl -X POST https://api.example.com/login"
# Add a new Task block interactively
flexiberry add task "User Onboarding Flow"flexiberry run
Execute your script locally using the berrycore interpreter.
flexiberry run my-test.berryData Iteration Options: If your script contains an
Inputstatement linking to external data (CSV/JSON), the CLI provides flexible execution options:
- Interactive Prompt: By default, you'll be asked whether to run All iterations or a Custom range.
- CLI Flags:
--iter <all|custom>: Set the iteration mode directly.--start <index>: 1-based index to start from (requires--iter custom).--end <index>: 1-based index to end at (requires--iter custom).Example:
flexiberry run script.berry --iter custom --start 1 --end 10
🤝 Contributing & Source
The CLI is part of the broader FlexiBerry monorepo. We warmly welcome contributions!
- Fork the main repository.
- Ask questions or share feedback in GitHub Discussions.
- Read our contribution guidelines.
- Submit a PR!
📄 License
This project is licensed under the MIT License.
