bkper 4.12.14 → 4.12.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
- [bkper.yaml reference]: #bkperyaml-reference
2
1
  [Developer Docs]: https://bkper.com/docs
3
2
  [App Template]: https://github.com/bkper/bkper-app-template
4
3
  [Pi]: https://pi.dev/
@@ -76,8 +75,6 @@ bkper transaction create -b <bookId> --description "Office supplies 123.78"
76
75
  ```
77
76
 
78
77
  > Run `bkper --help` or `bkper <command> --help` for built-in documentation on any command.
79
- >
80
- > To build and deploy Bkper Apps, see [App Management](#app-management).
81
78
 
82
79
  ### Access Token
83
80
 
@@ -93,6 +90,8 @@ curl -s -H "Authorization: Bearer $TOKEN" \
93
90
  https://api.bkper.app/v5/books | jq '.items[].name'
94
91
  ```
95
92
 
93
+ ---
94
+
96
95
  ## Interactive Mode (powered by Pi)
97
96
 
98
97
  Run `bkper agent` to start the embedded Bkper Agent TUI. Running `bkper` with no arguments shows CLI help.
@@ -134,794 +133,35 @@ https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent#cli-referenc
134
133
 
135
134
  Pi-specific extensions are loaded from Pi extension folders (for example `.pi/extensions` and `~/.pi/agent/extensions`).
136
135
 
137
- <!-- Suggested showcase media: add a short terminal GIF here (bkper agent -> "Bkper Agent ready." -> one prompt). -->
138
-
139
136
  ---
140
137
 
141
138
  ## Data Management
142
139
 
143
- **Interact with books, accounts, transactions, and balances.**
144
-
145
- All data commands that operate within a book use `-b, --book <bookId>` to specify the book context.
146
-
147
- ### Books
148
-
149
- Create and manage financial books with locale-specific settings.
140
+ Manage books, accounts, transactions, and balances.
150
141
 
151
142
  ```bash
152
- # List all books
153
143
  bkper book list
154
-
155
- # Get book details
156
- bkper book get abc123
157
-
158
- # Create a book with Brazilian settings
159
- bkper book create --name "My Company" --fraction-digits 2 \
160
- --date-pattern "dd/MM/yyyy" --decimal-separator COMMA \
161
- --time-zone "America/Sao_Paulo"
162
-
163
- # Create a book with custom properties
164
- bkper book create --name "Project X" -p "code=PX001" -p "department=Engineering"
165
-
166
- # Update a book
167
- bkper book update abc123 --lock-date 2024-12-31
168
- ```
169
-
170
- <details>
171
- <summary>Command reference</summary>
172
-
173
- - `book list` - List all books
174
- - `-q, --query <query>` - Search query
175
- - `book get <bookId>` - Get a book's details
176
- - `book create` - Create a new book
177
- - `--name <name>` - Book name (required)
178
- - `--fraction-digits <digits>` - Number of decimal places (`0`-`8`)
179
- - `--date-pattern <pattern>` - Date format pattern (`dd/MM/yyyy`, `MM/dd/yyyy`, or `yyyy/MM/dd`)
180
- - `--decimal-separator <separator>` - Decimal separator (`DOT` or `COMMA`)
181
- - `--time-zone <timezone>` - IANA time zone (e.g. `America/New_York`, `UTC`)
182
- - `--period <period>` - Period (`MONTH`, `QUARTER`, or `YEAR`)
183
- - `-p, --property <key=value>` - Set a property (repeatable)
184
- - `book update <bookId>` - Update a book
185
- - `--name <name>` - Book name
186
- - `--fraction-digits <digits>` - Number of decimal places (`0`-`8`)
187
- - `--date-pattern <pattern>` - Date format pattern (`dd/MM/yyyy`, `MM/dd/yyyy`, or `yyyy/MM/dd`)
188
- - `--decimal-separator <separator>` - Decimal separator (`DOT` or `COMMA`)
189
- - `--time-zone <timezone>` - IANA time zone identifier (e.g. `America/New_York`, `Europe/London`, `UTC`)
190
- - `--lock-date <date>` - Lock date in ISO format (`yyyy-MM-dd`, e.g. `2024-01-31`)
191
- - `--closing-date <date>` - Closing date in ISO format (`yyyy-MM-dd`)
192
- - `--period <period>` - Period (`MONTH`, `QUARTER`, or `YEAR`)
193
- - `-p, --property <key=value>` - Set a property (repeatable, e.g. `-p code=1010 -p branch=NYC`; empty value deletes the property)
194
-
195
- </details>
196
-
197
- ### Accounts
198
-
199
- Manage your chart of accounts within a book.
200
-
201
- ```bash
202
- # List all accounts
203
- bkper account list -b abc123
204
-
205
- # Get an account by name
206
- bkper account get "Bank Account" -b abc123
207
-
208
- # Create an asset account
209
- bkper account create -b abc123 --name "Bank Account" --type ASSET --groups "Current Assets"
210
-
211
- # Update an account
212
- bkper account update "Bank Account" -b abc123 --type LIABILITY
213
-
214
- # Archive an account
215
- bkper account update "Old Account" -b abc123 --archived true
216
-
217
- # Delete an account
218
- bkper account delete "Old Account" -b abc123
219
- ```
220
-
221
- <details>
222
- <summary>Command reference</summary>
223
-
224
- - `account list -b <bookId>` - List accounts in a book
225
- - `account get <nameOrId> -b <bookId>` - Get an account
226
- - `account create -b <bookId>` - Create a new account
227
- - `--name <name>` - Account name (required)
228
- - `--type <type>` - Account type (`ASSET`, `LIABILITY`, `INCOMING`, `OUTGOING`)
229
- - `--description <description>` - Account description
230
- - `--groups <groups>` - Comma-separated group names
231
- - `-p, --property <key=value>` - Set a property (repeatable)
232
- - `account update <nameOrId> -b <bookId>` - Update an account
233
- - `--name <name>` - Account name
234
- - `--type <type>` - Account type (`ASSET`, `LIABILITY`, `INCOMING`, `OUTGOING`)
235
- - `--archived <true|false>` - Archive status
236
- - `-p, --property <key=value>` - Set a property (repeatable, merges with existing)
237
- - `account delete <nameOrId> -b <bookId>` - Delete an account
238
-
239
- </details>
240
-
241
- ### Groups
242
-
243
- Organize accounts into hierarchical groups for structured reporting.
244
-
245
- ```bash
246
- # List all groups (shows hierarchy)
247
- bkper group list -b abc123
248
-
249
- # Create a group
250
- bkper group create -b abc123 --name "Current Assets"
251
-
252
- # Create a child group
253
- bkper group create -b abc123 --name "Cash" --parent "Current Assets"
254
-
255
- # Update a group
256
- bkper group update "Cash" -b abc123 --hidden true
257
-
258
- # Delete a group
259
- bkper group delete "Cash" -b abc123
144
+ bkper account list -b <bookId>
145
+ bkper transaction list -b <bookId> -q 'on:2025' --format csv
146
+ bkper balance list -b <bookId> -q 'on:2025-12-31' --format csv
260
147
  ```
261
148
 
262
- ### Book setup guidance (important)
263
-
264
- When setting up a full Book or starter chart of accounts, prefer a hierarchical group structure by default.
265
-
266
- Create top-level groups first, then child groups with `--parent`, then accounts with `--groups`.
267
-
268
- Verify the resulting group hierarchy and account memberships before reporting success.
269
-
270
- Avoid using the same name for a Group and an Account in the same Book.
271
-
272
- <details>
273
- <summary>Command reference</summary>
274
-
275
- - `group list -b <bookId>` - List groups in a book
276
- - `group get <nameOrId> -b <bookId>` - Get a group
277
- - `group create -b <bookId>` - Create a new group
278
- - `--name <name>` - Group name (required)
279
- - `--parent <parent>` - Parent group name or ID
280
- - `--hidden` - Hide the group
281
- - `-p, --property <key=value>` - Set a property (repeatable)
282
- - `group update <nameOrId> -b <bookId>` - Update a group
283
- - `--name <name>` - Group name
284
- - `--hidden <true|false>` - Hide status
285
- - `-p, --property <key=value>` - Set a property (repeatable, merges with existing)
286
- - `group delete <nameOrId> -b <bookId>` - Delete a group
287
-
288
- </details>
289
-
290
- ### Transactions
291
-
292
- Record, query, and manage financial transactions.
293
-
294
- ```bash
295
- # Create a draft transaction
296
- bkper transaction create -b abc123 --description "Office supplies"
297
-
298
- # Create a complete transaction
299
- bkper transaction create -b abc123 --date 2025-01-15 --amount 100.50 \
300
- --from "Bank Account" --to "Office Supplies" --description "Printer paper"
301
-
302
- # List transactions for a full year (on:YYYY)
303
- bkper transaction list -b abc123 -q 'on:2025'
304
-
305
- # List transactions for a month (on:YYYY-MM)
306
- bkper transaction list -b abc123 -q 'on:2025-01'
307
-
308
- # List with custom properties included
309
- bkper transaction list -b abc123 -q 'account:Sales' -p
310
-
311
- # Update a transaction
312
- bkper transaction update tx_456 -b abc123 --amount 120.00 --description "Printer paper (corrected)"
313
-
314
- # Post a draft transaction
315
- bkper transaction post tx_456 -b abc123
316
-
317
- # Check (reconcile) a transaction
318
- bkper transaction check tx_456 -b abc123
319
-
320
- # Trash a transaction
321
- bkper transaction trash tx_456 -b abc123
322
-
323
- # Merge two duplicate transactions
324
- bkper transaction merge tx_123 tx_456 -b abc123
325
- ```
326
-
327
- <details>
328
- <summary>Command reference</summary>
329
-
330
- - `transaction list -b <bookId> -q <query>` - List transactions matching a query (auto-paginates through all results)
331
- - `-p, --properties` - Include custom properties in the output
332
- - `transaction create -b <bookId>` - Create a transaction
333
- - `--date <date>` - Transaction date
334
- - `--amount <amount>` - Transaction amount
335
- - `--description <description>` - Transaction description
336
- - `--from <from>` - Credit account (source)
337
- - `--to <to>` - Debit account (destination)
338
- - `--url <url>` - URL (repeatable)
339
- - `--remote-id <remoteId>` - Remote ID (repeatable)
340
- - `-p, --property <key=value>` - Set a property (repeatable, empty value deletes)
341
- - `transaction update [transactionId] -b <bookId>` - Update a transaction (or batch update via stdin)
342
- - `--date <date>` - Transaction date
343
- - `--amount <amount>` - Transaction amount
344
- - `--description <description>` - Transaction description
345
- - `--from <from>` - Credit account (source)
346
- - `--to <to>` - Debit account (destination)
347
- - `--url <url>` - URL (repeatable, replaces all)
348
- - `--update-checked` - Also update checked transactions
349
- - `-p, --property <key=value>` - Set a property (repeatable, empty value deletes)
350
- - `transaction post <id> -b <bookId>` - Post a draft transaction
351
- - `transaction check <id> -b <bookId>` - Check a transaction
352
- - `transaction trash <id> -b <bookId>` - Trash a transaction
353
- - `transaction merge <id1> <id2> -b <bookId>` - Merge two transactions
354
-
355
- </details>
356
-
357
- ### Balances
358
-
359
- Query account balances and group totals.
360
-
361
- ```bash
362
- # List balances for a specific date (point-in-time)
363
- bkper balance list -b abc123 -q 'on:2025-12-31'
364
-
365
- # Monthly balance evolution of one account during 2025
366
- bkper balance list -b abc123 -q "account:'<accountName>' after:2025-01-01 before:2026-01-01 by:m" --expanded 2
367
- ```
368
-
369
- <details>
370
- <summary>Command reference</summary>
371
-
372
- - `balance list -b <bookId> -q <query>` - List balances
373
- - `--expanded <level>` - Expand groups to specified depth (`0`+)
374
-
375
- </details>
376
-
377
- ### Query semantics (transactions and balances)
378
-
379
- Use the same query language across Bkper web app, CLI, and Google Sheets integrations.
380
-
381
- - `on:` supports different granularities:
382
- - `on:2025` → full year
383
- - `on:2025-01` → full month
384
- - `on:2025-01-31` → specific day
385
- - `after:` is **inclusive** and `before:` is **exclusive**.
386
- - Full year 2025: `after:2025-01-01 before:2026-01-01`
387
- - In shell commands, wrap queries with Bkper date variables (`$d`, `$m`, `$y`) in single quotes to avoid shell expansion.
388
- - Example: `bkper transaction list -b abc123 -q 'after:$m-3 before:$m+1'`
389
- - If the query already needs single quotes inside (for example, `account:'Brex Cash'`), keep double quotes and escape `$`: `-q "account:'Brex Cash' after:\$m-3 before:\$m+1"`
390
- - For point-in-time statements (typically permanent accounts `ASSET`/`LIABILITY`), prefer `on:` or `before:`.
391
- - For activity statements over a period (typically non-permanent accounts `INCOMING`/`OUTGOING`), prefer `after:` + `before:`.
392
- - For statement-level analysis, prefer filtering by the report root group. Root names vary by book.
393
-
394
- ```bash
395
- # Balance Sheet snapshot (point-in-time)
396
- bkper balance list -b abc123 -q "group:'<balanceSheetRootGroup>' before:2026-01-01"
397
-
398
- # P&L activity over 2025
399
- bkper balance list -b abc123 -q "group:'<profitAndLossRootGroup>' after:2025-01-01 before:2026-01-01"
400
- ```
401
-
402
- ### Collections
403
-
404
- Organize books into collections.
405
-
406
- ```bash
407
- # Create a collection
408
- bkper collection create --name "My Collection"
409
-
410
- # Add books to a collection
411
- bkper collection add-book col_789 -b abc123 -b def456
412
-
413
- # List all collections
414
- bkper collection list
415
-
416
- # Remove a book from a collection
417
- bkper collection remove-book col_789 -b abc123
418
-
419
- # Delete a collection
420
- bkper collection delete col_789
421
- ```
422
-
423
- <details>
424
- <summary>Command reference</summary>
425
-
426
- - `collection list` - List all collections
427
- - `collection get <collectionId>` - Get a collection
428
- - `collection create` - Create a new collection
429
- - `--name <name>` - Collection name (required)
430
- - `collection update <collectionId>` - Update a collection
431
- - `--name <name>` - Collection name
432
- - `collection delete <collectionId>` - Delete a collection
433
- - `collection add-book <collectionId>` - Add books to a collection
434
- - `-b, --book <bookId>` - Book ID (repeatable)
435
- - `collection remove-book <collectionId>` - Remove books from a collection
436
- - `-b, --book <bookId>` - Book ID (repeatable)
437
-
438
- </details>
149
+ [Full Data Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/data-management.md)
439
150
 
440
- ### Output Format
441
-
442
- All commands support three output formats via the `--format` global flag:
443
-
444
- | Format | Flag | Best for |
445
- | ------ | -------------------------- | ------------------------------------------- |
446
- | Table | `--format table` (default) | Human reading in the terminal |
447
- | JSON | `--format json` | Programmatic access, single-item detail |
448
- | CSV | `--format csv` | LLM consumption, spreadsheets, list reports |
449
-
450
- ```bash
451
- # Table output (default)
452
- bkper account list -b abc123
453
-
454
- # JSON output
455
- bkper account list -b abc123 --format json
456
-
457
- # CSV output -- raw data, no truncation, RFC 4180
458
- bkper account list -b abc123 --format csv
459
- ```
460
-
461
- **CSV output details:**
462
-
463
- - **RFC 4180 compliant** -- proper quoting, CRLF line endings, no truncation
464
- - **All metadata included** -- IDs, properties, hidden properties, URLs, and timestamps are enabled
465
- - **Raw values** -- dates stay in ISO format, numbers are unformatted (no locale formatting)
466
- - **Single-item commands** (e.g. `account get`, `transaction create`) fall back to JSON since CSV adds no value for non-tabular data
467
-
468
- **LLM-first output guidance (important):**
469
-
470
- When command output will be loaded into an LLM context (chat, prompt, memory, or agent reasoning), prefer:
471
-
472
- - **`--format csv` for list commands** (`balance list`, `transaction list`, `account list`, etc.).
473
- - **`--format json` for single-item commands** (`get`, `create`, `update`) and CLI-to-CLI pipelines.
474
-
475
- CSV is significantly more token-efficient than JSON for tabular data, and for wide balance outputs it can reduce token usage by up to **95%**.
476
-
477
- **Quick rule:**
478
-
479
- - **LLM consumption of lists/reports** → CSV
480
- - **Programmatic processing / pipelines** → JSON
481
- - **Human terminal reading** → Table
482
-
483
- ### Batch Operations & Piping
484
-
485
- Write commands (`account create`, `transaction create`) accept JSON data piped via stdin for batch operations. The `transaction update` command also accepts stdin for batch updates. The input format follows the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts) exactly -- a single JSON object or an array of objects.
486
-
487
- ```bash
488
- # Create transactions
489
- echo '[{
490
- "date": "2025-01-15",
491
- "amount": "100.50",
492
- "creditAccount": {"name": "Bank Account"},
493
- "debitAccount": {"name": "Office Supplies"},
494
- "description": "Printer paper",
495
- "properties": {"invoice": "INV-001"}
496
- }]' | bkper transaction create -b abc123
497
-
498
- # Create accounts
499
- echo '[{"name":"Cash","type":"ASSET"},{"name":"Revenue","type":"INCOMING"}]' | \
500
- bkper account create -b abc123
501
-
502
- # Pipe from a script
503
- python export_bank.py | bkper transaction create -b abc123
504
- ```
505
-
506
- The input follows the exact `bkper.Transaction` or `bkper.Account` type from the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts). Custom properties go inside the `properties` object.
507
-
508
- Groups are created explicitly with `bkper group create --name` and optional `--parent` so hierarchy stays deterministic during setup.
509
-
510
- The `--property` CLI flag can override or delete properties from the stdin payload:
511
-
512
- ```bash
513
- echo '[{"name":"Cash","type":"ASSET"}]' | \
514
- bkper account create -b abc123 -p "region=LATAM"
515
- ```
516
-
517
- **Batch output:** results are output as a flat JSON array, matching the same format as list commands:
518
-
519
- ```bash
520
- bkper account create -b abc123 < accounts.json
521
- # Output: [{"id":"acc-abc","name":"Cash",...}, {"id":"acc-def","name":"Revenue",...}]
522
- ```
523
-
524
- **Piping between commands:**
525
-
526
- For resources that support stdin creation, JSON output can be piped directly into create or update commands:
527
-
528
- ```bash
529
- # Copy all accounts from one book to another
530
- bkper account list -b $BOOK_A --format json | bkper account create -b $BOOK_B
531
-
532
- # Copy transactions matching a query
533
- bkper transaction list -b $BOOK_A -q 'after:2025-01-01' --format json | \
534
- bkper transaction create -b $BOOK_B
535
-
536
- # Clone accounts, then transactions
537
- bkper account list -b $SOURCE --format json | bkper account create -b $DEST
538
- bkper transaction list -b $SOURCE -q 'after:2025-01-01' --format json | \
539
- bkper transaction create -b $DEST
540
-
541
- # Batch update: list transactions, modify, and pipe back to update
542
- bkper transaction list -b $BOOK -q 'after:2025-01-01' --format json | \
543
- jq '[.[] | .description = "Updated: " + .description]' | \
544
- bkper transaction update -b $BOOK
545
-
546
- # Batch update: add a property to all matching transactions
547
- bkper transaction list -b $BOOK -q 'account:Expenses' --format json | \
548
- bkper transaction update -b $BOOK -p "reviewed=true"
549
-
550
- # Batch update checked transactions
551
- bkper transaction list -b $BOOK -q 'is:checked after:2025-01-01' --format json | \
552
- bkper transaction update -b $BOOK --update-checked -p "migrated=true"
553
- ```
554
-
555
- <details>
556
- <summary>Writable fields reference</summary>
557
-
558
- Only the fields below are meaningful when creating or updating resources via stdin. For batch updates, items must include an `id` field. Other read-only fields (`createdAt`, `updatedAt`, etc.) are ignored.
559
-
560
- **Transaction** (`bkper.Transaction`)
561
-
562
- | Field | Type | Notes |
563
- | --------------- | ---------------------------------- | --------------------------------------------- |
564
- | `id` | `string` | Required for batch updates, ignored on create |
565
- | `date` | `string` | ISO format `yyyy-MM-dd` |
566
- | `amount` | `string` | Decimal format `####.##` (string, not number) |
567
- | `creditAccount` | `{"name":"..."}` or `{"id":"..."}` | Reference to an existing account |
568
- | `debitAccount` | `{"name":"..."}` or `{"id":"..."}` | Reference to an existing account |
569
- | `description` | `string` | Free-text description |
570
- | `urls` | `string[]` | Attached URLs (e.g. receipts) |
571
- | `remoteIds` | `string[]` | External IDs to prevent duplicates |
572
- | `properties` | `{"key": "value", ...}` | Custom key/value properties |
573
-
574
- **Account** (`bkper.Account`)
575
-
576
- | Field | Type | Notes |
577
- | ------------ | ----------------------- | -------------------------------------------------- |
578
- | `name` | `string` | Account name (required) |
579
- | `type` | `string` | `ASSET`, `LIABILITY`, `INCOMING`, or `OUTGOING` |
580
- | `credit` | `boolean` | Credit nature (`true`) or debit (`false`) |
581
- | `archived` | `boolean` | Archive the account on creation |
582
- | `permanent` | `boolean` | Permanent accounts (e.g. bank accounts, customers) |
583
- | `groups` | `[{"name":"..."}, ...]` | Groups to assign by name or id |
584
- | `properties` | `{"key": "value", ...}` | Custom key/value properties |
585
-
586
- </details>
587
151
 
588
152
  ---
589
153
 
590
154
  ## App Management
591
155
 
592
- **Build, deploy, and manage Bkper apps.**
593
-
594
- ### Development Workflow
156
+ Build, deploy, and manage Bkper apps.
595
157
 
596
158
  ```bash
597
- # Scaffold a new app from the template
598
159
  bkper app init my-app
599
-
600
- # Start the worker runtime (Miniflare + tunnel + file watching)
601
- # In your project, use "npm run dev" to run both Vite and workers concurrently
602
160
  bkper app dev
603
-
604
- # Build worker bundles (web server + events handler)
605
- # In your project, use "npm run build" to build both client (Vite) and workers
606
- bkper app build
607
-
608
- # Sync configuration and deploy to production
609
161
  bkper app sync && bkper app deploy
610
-
611
- # Deploy to development environment
612
- bkper app deploy --preview
613
-
614
- # Deploy only the events handler
615
- bkper app deploy --events
616
-
617
- # Check deployment status
618
- bkper app status
619
162
  ```
620
163
 
621
- > **Note:** `bkper app dev` runs the worker runtime only — Miniflare, file watching, and the Cloudflare tunnel. The Vite client dev server is configured in the project's `vite.config.ts` and run separately. The project template composes both via `npm run dev` using `concurrently`.
622
-
623
- ### Install Apps on Books
624
-
625
- ```bash
626
- # Install an app on a book
627
- bkper app install my-app -b abc123
628
-
629
- # Uninstall an app from a book
630
- bkper app uninstall my-app -b abc123
631
- ```
632
-
633
- ### Secrets
634
-
635
- ```bash
636
- # Store a secret (prompts for value)
637
- bkper app secrets put API_KEY
638
-
639
- # List all secrets
640
- bkper app secrets list
641
-
642
- # Delete a secret
643
- bkper app secrets delete API_KEY
644
- ```
645
-
646
- ### Configuration
647
-
648
- Apps are configured via a `bkper.yaml` file in the project root. See the complete **[bkper.yaml reference]** below.
649
-
650
- <details>
651
- <summary>bkper.yaml reference</summary>
652
-
653
- ```yaml
654
- # =============================================================================
655
- # bkper.yaml Reference
656
- # =============================================================================
657
- # This file documents all available configuration options for Bkper Apps.
658
- # Copy the fields you need to your app's bkper.yaml file.
659
- #
660
- # For a minimal working template, see:
661
- # https://github.com/bkper/bkper-app-template
662
- # =============================================================================
663
-
664
- # -----------------------------------------------------------------------------
665
- # APP IDENTITY
666
- # -----------------------------------------------------------------------------
667
- # The app id is permanent and cannot be changed after creation.
668
- # Use lowercase letters, numbers, and hyphens only.
669
- id: my-app
670
-
671
- # Display name shown in the Bkper UI
672
- name: My App
673
-
674
- # Brief description of what the app does
675
- description: A Bkper app that does something useful
676
-
677
- # -----------------------------------------------------------------------------
678
- # BRANDING
679
- # -----------------------------------------------------------------------------
680
- # App logo for light mode (SVG recommended, PNG/JPG supported)
681
- logoUrl: https://example.com/logo.svg
682
-
683
- # App logo for dark mode (required for proper theming)
684
- logoUrlDark: https://example.com/logo-dark.svg
685
-
686
- # App website or documentation URL
687
- website: https://example.com
688
-
689
- # -----------------------------------------------------------------------------
690
- # OWNERSHIP
691
- # -----------------------------------------------------------------------------
692
- # Developer/company name
693
- ownerName: Your Name
694
-
695
- # Owner's logo/avatar URL
696
- ownerLogoUrl: https://example.com/owner-logo.png
697
-
698
- # Owner's website
699
- ownerWebsite: https://yoursite.com
700
-
701
- # Source code repository URL
702
- repoUrl: https://github.com/you/my-app
703
-
704
- # Whether the repository is private
705
- repoPrivate: true
706
-
707
- # Mark as deprecated (hides from app listings, existing installs continue working)
708
- deprecated: false
709
-
710
- # -----------------------------------------------------------------------------
711
- # ACCESS CONTROL
712
- # -----------------------------------------------------------------------------
713
- # Who can update the app configuration and deploy new versions.
714
- # Comma-separated list of Bkper usernames (not emails).
715
- # Supports domain wildcards for registered custom domains: *@yourdomain.com
716
- developers: victor, aldo, *@bkper.com
717
-
718
- # Who can install and use the app.
719
- # Same format as developers. Leave empty for public apps.
720
- users: maria, *@acme.com
721
-
722
- # -----------------------------------------------------------------------------
723
- # MENU INTEGRATION (optional)
724
- # -----------------------------------------------------------------------------
725
- # When configured, adds a menu item to Bkper's "More" menu.
726
- # Clicking opens a popup with the specified URL.
727
-
728
- # Production menu URL (supports variable substitution)
729
- menuUrl: https://${id}.bkper.app?bookId=${book.id}
730
-
731
- # Development menu URL (used when developer runs the app)
732
- menuUrlDev: http://localhost:8787?bookId=${book.id}
733
-
734
- # Custom menu text (defaults to app name if not specified)
735
- menuText: Open My App
736
-
737
- # Popup dimensions in pixels
738
- menuPopupWidth: 500
739
- menuPopupHeight: 300
740
-
741
- # -----------------------------------------------------------------------------
742
- # Menu URL Variables
743
- # -----------------------------------------------------------------------------
744
- # The following variables can be used in menuUrl and menuUrlDev:
745
- #
746
- # ${book.id} - Current book ID
747
- # ${book.properties.xxx} - Book property value (replace xxx with property key)
748
- # ${account.id} - Selected account ID (in account context)
749
- # ${account.properties.xxx} - Account property value
750
- # ${group.id} - Selected group ID (in group context)
751
- # ${group.properties.xxx} - Group property value
752
- # ${transactions.ids} - Comma-separated selected transaction IDs
753
- # ${transactions.query} - Current search query
754
- # -----------------------------------------------------------------------------
755
-
756
- # -----------------------------------------------------------------------------
757
- # EVENT HANDLING (optional)
758
- # -----------------------------------------------------------------------------
759
- # When configured, Bkper calls your webhook URL when subscribed events occur.
760
-
761
- # Production webhook URL
762
- webhookUrl: https://${id}.bkper.app/events
763
-
764
- # Development webhook URL (auto-updated by bkper app dev)
765
- webhookUrlDev: https://<random>.trycloudflare.com/events
766
-
767
- # API version for event payloads
768
- apiVersion: v5
769
-
770
- # Events to subscribe to (remove events you don't need)
771
- events:
772
- # Transaction
773
- - TRANSACTION_CREATED
774
- - TRANSACTION_POSTED
775
- - TRANSACTION_CHECKED
776
- - TRANSACTION_UNCHECKED
777
- - TRANSACTION_UPDATED
778
- - TRANSACTION_DELETED
779
- - TRANSACTION_RESTORED
780
- # Account
781
- - ACCOUNT_CREATED
782
- - ACCOUNT_UPDATED
783
- - ACCOUNT_DELETED
784
- # Group
785
- - GROUP_CREATED
786
- - GROUP_UPDATED
787
- - GROUP_DELETED
788
- # File
789
- - FILE_CREATED
790
- - FILE_UPDATED
791
- # Query
792
- - QUERY_CREATED
793
- - QUERY_UPDATED
794
- - QUERY_DELETED
795
- # Comment
796
- - COMMENT_CREATED
797
- - COMMENT_DELETED
798
- # Collaborator
799
- - COLLABORATOR_ADDED
800
- - COLLABORATOR_UPDATED
801
- - COLLABORATOR_REMOVED
802
- # Integration
803
- - INTEGRATION_CREATED
804
- - INTEGRATION_UPDATED
805
- - INTEGRATION_DELETED
806
- # Book
807
- - BOOK_CREATED
808
- - BOOK_UPDATED
809
- - BOOK_DELETED
810
- - BOOK_AUDITED
811
-
812
- # -----------------------------------------------------------------------------
813
- # FILE PATTERNS (optional)
814
- # -----------------------------------------------------------------------------
815
- # For file processing apps. When a file matching these patterns is uploaded,
816
- # a FILE_CREATED event is triggered with the file content.
817
- filePatterns:
818
- - '*.ofx'
819
- - '*.csv'
820
-
821
- # -----------------------------------------------------------------------------
822
- # PROPERTIES SCHEMA (optional)
823
- # -----------------------------------------------------------------------------
824
- # Defines autocomplete suggestions for custom properties in the Bkper UI.
825
- # Helps users discover and use the correct property keys/values for your app.
826
- propertiesSchema:
827
- book:
828
- keys:
829
- - my_app_enabled
830
- - my_app_config
831
- values:
832
- - 'true'
833
- - 'false'
834
- group:
835
- keys:
836
- - my_app_category
837
- values:
838
- - category_a
839
- - category_b
840
- account:
841
- keys:
842
- - my_app_sync_id
843
- transaction:
844
- keys:
845
- - my_app_reference
846
-
847
- # -----------------------------------------------------------------------------
848
- # DEPLOYMENT CONFIGURATION (optional)
849
- # -----------------------------------------------------------------------------
850
- # For apps deployed to Bkper's Workers for Platforms infrastructure.
851
- deployment:
852
- # Web handler (serves UI and API)
853
- web:
854
- bundle: packages/web/server/dist
855
- # assets: packages/web/client/dist # Static assets (when supported)
856
-
857
- # Events handler (processes webhooks)
858
- events:
859
- bundle: packages/events/dist
860
-
861
- # Platform services available to your app (one per type, auto-provisioned)
862
- # See: https://developers.cloudflare.com/kv/
863
- services:
864
- - KV # Key-value storage
865
- ```
866
-
867
- </details>
868
-
869
- **Environment variables:**
870
-
871
- - `BKPER_API_KEY` -- Optional. If not set, uses the Bkper API proxy with a managed API key. Set it for direct API access with your own quotas. Follow [these steps](https://bkper.com/docs/#rest-api-enabling) to enable.
872
-
873
- <details>
874
- <summary>Command reference</summary>
875
-
876
- #### Authentication
877
-
878
- - `auth login` - Authenticate with Bkper, storing credentials locally
879
- - `auth logout` - Revoke the stored refresh token and clear local credentials
880
- - `auth token` - Print the current OAuth access token to stdout (requires prior login)
881
-
882
- #### Agent
883
-
884
- - `agent` - Start the interactive Bkper Agent
885
- - `agent <pi-args...>` - Run Pi CLI with Bkper defaults (system prompt/resources)
886
-
887
- #### App Lifecycle
888
-
889
- - `app init <name>` - Scaffold a new app from the template
890
- - `app list` - List all apps you have access to
891
- - `app sync` - Sync [bkper.yaml][bkper.yaml reference] configuration (URLs, description) to Bkper API
892
- - `app build` - Build worker bundles for deployment
893
- - `app deploy` - Deploy built artifacts to Cloudflare Workers for Platforms
894
- - `-p, --preview` - Deploy to preview environment
895
- - `--events` - Deploy events handler instead of web handler
896
- - `app status` - Show deployment status
897
- - `app undeploy` - Remove app from platform
898
- - `-p, --preview` - Remove from preview environment
899
- - `--events` - Remove events handler instead of web handler
900
- - `--delete-data` - Permanently delete all associated data (requires confirmation)
901
- - `--force` - Skip confirmation prompts (use with `--delete-data` for automation)
902
- - `app dev` - Start the worker runtime for local development
903
- - `--sp, --server-port <port>` - Server simulation port (default: `8787`)
904
- - `--ep, --events-port <port>` - Events handler port (default: `8791`)
905
- - `-w, --web` - Run only the web handler
906
- - `-e, --events` - Run only the events handler
907
-
908
- > **Note:** `sync` and `deploy` are independent operations. Use `sync` to update your app's URLs in Bkper (required for webhooks and menu integration). Use `deploy` to push code to Cloudflare. For a typical deployment workflow, run both: `bkper app sync && bkper app deploy`
909
-
910
- #### App Installation
911
-
912
- - `app install <appId> -b <bookId>` - Install an app on a book
913
- - `app uninstall <appId> -b <bookId>` - Uninstall an app from a book
914
-
915
- #### Secrets Management
916
-
917
- - `app secrets put <name>` - Store a secret
918
- - `-p, --preview` - Set in preview environment
919
- - `app secrets list` - List all secrets
920
- - `-p, --preview` - List from preview environment
921
- - `app secrets delete <name>` - Delete a secret
922
- - `-p, --preview` - Delete from preview environment
923
-
924
- </details>
164
+ [Full App Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/app-management.md)
925
165
 
926
166
  ---
927
167