Skip to content

bindoffice/bind-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bind-cli

Go Version

中文版 | English

BindOffice / Bind Meet command-line client. Configure your BindOffice base URL and API key, then call documented REST endpoints (/api/...) or use the built-in shortcuts (mail, drive, calendar, etc.).

Install · Auth · Commands · Security

Why bind-cli?

  • Fast API access: a generic api command to call any /api/... endpoint
  • Shortcut commands: curated subcommands for common domains (mail, drive, calendar, …)
  • Secure-by-default credential storage: stores API key in OS keyring by default (fallback supported)
  • Automation-friendly: JSON output, --output for binary-safe downloads, shell completion

Features

Domain Commands
Mail mail (list/detail/search/send/labels/flags/…)
Drive drive
Docs doc
Calendar calendar
Chat chat
Contacts contacts
Kanban kanban
Sheets sheets
Slides slides
Notes note
Meetings meet
Search search

Installation & Quick Start

Requirements

  • Go v1.23+
  • A BindOffice instance URL and API key

Install

go install github.com/bindoffice/bind-cli@latest

Or build from source:

git clone https://github.com/bindoffice/bind-cli.git
cd bind-cli
go build -o bind-cli .

Configure & Verify

# 1) Set base URL
bind-cli config set base-url https://office.example.com

# 2) Set API key (stored in OS keyring by default)
bind-cli config set api-key YOUR_KEY

# 3) Verify
bind-cli doctor

Authentication & Configuration

bind-cli uses Basic auth with username api and your API key:

  • Authorization: Basic base64("api:"+API_KEY)

Config commands

# Show effective config (secrets masked)
bind-cli config show

# Print config path (default: ~/.bind-cli/config.json)
bind-cli config path

# Store API key in config file instead of keyring (less secure)
bind-cli config set api-key --file YOUR_KEY

# Clear stored key from both keyring and config
bind-cli config unset api-key

Auth commands (interactive)

bind-cli auth login
bind-cli auth status
bind-cli auth logout

Environment variables

These override file/keyring values:

  • BIND_CLI_BASE_URL: override base URL
  • BIND_API_BASE: alias for base URL
  • BIND_CLI_API_KEY: override API key
  • BIND_CLI_CONFIG_DIR: override config directory (default: ~/.bind-cli)

Commands

Generic API calls

Call any BindOffice endpoint directly:

bind-cli api GET /api/mail/list --params '{"label":"inbox","page":1,"page_count":20}'
bind-cli api GET /api/mail/detail/1
bind-cli api POST /api/mail/send --data '{"to":"a@b.com","subject":"Hi","text":"Hello"}'

Flags you will commonly use:

--format json|pretty
--params '{}'     # JSON object -> query string
--data '{}'       # raw JSON request body
--output file     # write response body to file (binary-safe)
--dry-run         # print URL without sending
--insecure        # skip TLS verify (not recommended)

Shortcuts (example: mail)

bind-cli mail list --label inbox
bind-cli mail detail 123
bind-cli mail search --keyword "invoice"
bind-cli mail send --to "a@b.com" --subject "Hi" --body "Hello"

Shell completion

# zsh
source <(bind-cli completion zsh)

# bash
source <(bind-cli completion bash)

Security & Risk Warnings (Read Before Use)

This tool can perform actions on your BindOffice instance with your API key. Treat the key like a password:

  • Do not paste your API key into chats/issues/logs.
  • Prefer storing it in the OS keyring (default).
  • Avoid --insecure unless you fully understand the risk.

Releases

No releases published

Packages

 
 
 

Contributors

Languages