anyhive
v0.0.0-alpha.1
Published
The Anyhive command line interface helps you initialize projects and set up a local development environment.
Readme
Anyhive CLI
The Anyhive command line interface helps you initialize projects and set up a local development environment.
Built with Node.js and commander for robust argument parsing, validation, and helpful usage text.
Requirements
- Node.js 18+
Installation
Install globally (recommended when published):
npm i -g anyhiveFrom this monorepo (for local development):
node packages/cli/bin/anyhive.js --helpGlobal options
--env <sandbox|production>: Select target environment for commands--sandbox: Alias of--env sandbox
Environment resolution priority:
- CLI flags (
--envor--sandbox) - Environment variable
ANYHIVE_MODE - Default:
production
Commands
init
Initialize an Anyhive project configuration.
anyhive init --workspace <id> --token <installToken> [--dir <path>] [--force] [--env sandbox|production]Behavior:
- Creates
anyhive.config.jsonin the target directory - Respects
--envto set the initialmode(e.g.sandboxorproduction) - Errors if a config already exists unless
--forceis provided
verify
Verify your installation (demo output).
anyhive verify [--env sandbox|production]whoami
Display the current user and environment (demo output).
anyhive whoami [--env sandbox|production]sandbox
Create or update a local .env with a sandbox publishable key for local testing.
anyhive sandbox [--dir <path>] [--key <publishableKey>] [--force] [--write-all]Options:
--dir <path>: Directory for the.envfile (default: current directory)--key <publishableKey>: Provide a specific key instead of generating one--force: Overwrite existingANYHIVE_PUBLISHABLE_KEYin.env--write-all: Also upsert the following variables:ANYHIVE_MODE=sandboxANYHIVE_API_BASE_URL=https://sandbox.api.anyhive.devANYHIVE_WORKSPACE_ID=ws_sandbox_demo
Notes:
- Without
--force, an existingANYHIVE_PUBLISHABLE_KEYwill not be overwritten - The command prints a short configuration summary for quick copying
Examples
# Initialize a project in sandbox mode
anyhive init --workspace ws_123 --token it_456 --env sandbox
# Verify against sandbox
anyhive verify --env sandbox
# Create or update a local .env for sandbox testing
anyhive sandbox --dir . --write-all
# Provide your own sandbox key and force overwrite
anyhive sandbox --dir . --key pk_sandbox_custom --forceHelp
anyhive --help
anyhive <command> --helpExit codes
0: Success- Non-zero: An error occurred (missing required options, file conflicts, etc.)
License
ISC
