An open API service indexing awesome lists of open source software.

https://github.com/usebarekey/cli

Main CLI application for Barekey
https://github.com/usebarekey/cli

Last synced: 9 days ago
JSON representation

Main CLI application for Barekey

Awesome Lists containing this project

README

          

# @barekey/cli

CLI for Barekey login, variable management, pull workflows, and SDK type generation.

## Install

```bash
npm install -g @barekey/cli
```

## Quickstart

```bash
barekey auth login
barekey auth whoami
```

Create `barekey.json`:

```json
{
"organization": "acme",
"project": "web",
"environment": "development"
}
```

Create and read a variable:

```bash
barekey env new DATABASE_URL "postgres://localhost:5432/app" --type string
barekey env get DATABASE_URL
```

Update it:

```bash
barekey env set DATABASE_URL "postgres://localhost:5432/app_v2"
```

Pull local files:

```bash
barekey env pull --out .env.local
barekey env pull --format json --out barekey.local.json
```

Generate SDK types:

```bash
barekey typegen
barekey typegen --watch
```

## Common commands

```bash
barekey env list
barekey env get-many --names DATABASE_URL,REDIS_URL
barekey env new FEATURE_ENABLED true --type boolean
barekey env set PUBLIC_TITLE "Barekey Docs" --visibility public
barekey env set CHECKOUT_FLOW control --ab treatment --chance 0.5
barekey env delete FEATURE_ENABLED --yes
```

## Notes

- `env new` creates with an initial value.
- `env set` is the upsert command.
- `get-many` uses a comma-separated `--names` value.
- Target resolution comes from flags, `barekey.json`, and the stored login org.

## Development

```bash
bun install
bun run build
bun run typecheck
bun test
```