A command-line interface for interacting with the bem.ai API - a SaaS platform for extracting structured data from PDFs and images.
git clone https://github.com/stulentsev/bem.git
cd bem
cargo build --releaseThe binary will be available at target/release/bem.
To install globally:
cargo install --path .The CLI requires a bem.ai API token for authentication. You can provide it in two ways:
export BEM_API_TOKEN="your_api_token_here"Create a ~/.bemrc file in your home directory:
echo "BEM_API_TOKEN=your_api_token_here" > ~/.bemrcTo obtain an API token, visit the bem.ai documentation.
The get command automatically detects the resource type from the ID prefix:
# Get an event (IDs starting with evt_)
bem get evt_abc123
# Get a transformation (IDs starting with tr_)
bem get tr_2bxoJPNdSD4LgRT4YVC4gt72hlIRetrieve event details by ID:
bem events get evt_abc123Example output:
{
"eventID": "evt_abc123",
"status": "completed",
...
}Retrieve transformation details by ID:
bem transformations get tr_2bxoJPNdSD4LgRT4YVC4gt72hlIExample output:
{
"transformationID": "tr_2bxoJPNdSD4LgRT4YVC4gt72hlI",
...
}- Events:
https://api.bem.ai/v1-alpha/events/:id - Transformations:
https://api.bem.ai/v1-beta/transformations?transformationIDs=:id
- Rust 1.70 or later
- Cargo
cargo buildcargo testcargo run -- get evt_abc123clap- Command-line argument parsingreqwest- HTTP client for API callsserde/serde_json- JSON serialization/deserializationtokio- Async runtimeanyhow- Error handlingdotenvy- Environment variable loading
For more information about the bem.ai API and available features, visit:
Contributions are welcome! Please feel free to submit a Pull Request.
[Your chosen license here]
For issues related to:
- This CLI tool: Open an issue on GitHub
- The bem.ai API: Contact bem.ai support