bkper 4.17.3 → 4.18.1

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.
Files changed (53) hide show
  1. package/README.md +89 -56
  2. package/lib/agent/agent-command-runner.d.ts +3 -0
  3. package/lib/agent/agent-command-runner.d.ts.map +1 -0
  4. package/lib/agent/agent-command-runner.js +25 -0
  5. package/lib/agent/agent-command-runner.js.map +1 -0
  6. package/lib/agent/agent-entry.d.ts +3 -0
  7. package/lib/agent/agent-entry.d.ts.map +1 -0
  8. package/lib/agent/agent-entry.js +7 -0
  9. package/lib/agent/agent-entry.js.map +1 -0
  10. package/lib/agent/core-concepts-preload.d.ts +1 -1
  11. package/lib/agent/core-concepts-preload.d.ts.map +1 -1
  12. package/lib/agent/core-concepts-preload.js +6 -6
  13. package/lib/agent/core-concepts-preload.js.map +1 -1
  14. package/lib/agent/run-agent-mode.d.ts +15 -1
  15. package/lib/agent/run-agent-mode.d.ts.map +1 -1
  16. package/lib/agent/run-agent-mode.js +42 -4
  17. package/lib/agent/run-agent-mode.js.map +1 -1
  18. package/lib/agent/skill-distribution.d.ts +28 -0
  19. package/lib/agent/skill-distribution.d.ts.map +1 -0
  20. package/lib/agent/skill-distribution.js +120 -0
  21. package/lib/agent/skill-distribution.js.map +1 -0
  22. package/lib/agent/system-prompt.d.ts.map +1 -1
  23. package/lib/agent/system-prompt.js +28 -4
  24. package/lib/agent/system-prompt.js.map +1 -1
  25. package/lib/cli.js +15 -2
  26. package/lib/cli.js.map +1 -1
  27. package/lib/commands/apps/get.d.ts +9 -0
  28. package/lib/commands/apps/get.d.ts.map +1 -0
  29. package/lib/commands/apps/get.js +23 -0
  30. package/lib/commands/apps/get.js.map +1 -0
  31. package/lib/commands/apps/index.d.ts +1 -0
  32. package/lib/commands/apps/index.d.ts.map +1 -1
  33. package/lib/commands/apps/index.js +2 -0
  34. package/lib/commands/apps/index.js.map +1 -1
  35. package/lib/commands/apps/register.d.ts.map +1 -1
  36. package/lib/commands/apps/register.js +8 -1
  37. package/lib/commands/apps/register.js.map +1 -1
  38. package/lib/docs/{app-management.md → cli/app-management.md} +4 -0
  39. package/lib/docs/{data-management.md → cli/data-management.md} +1 -1
  40. package/lib/docs/index.md +12 -9
  41. package/lib/docs/{taxes.md → reporting/taxes.md} +1 -1
  42. package/lib/utils/node-version.d.ts +4 -0
  43. package/lib/utils/node-version.d.ts.map +1 -0
  44. package/lib/utils/node-version.js +44 -0
  45. package/lib/utils/node-version.js.map +1 -0
  46. package/package.json +6 -5
  47. package/lib/docs/cli-reference.md +0 -204
  48. /package/lib/docs/{accountant-recommendations.md → advisory/accountant-recommendations.md} +0 -0
  49. /package/lib/docs/{app-building.md → apps/app-building.md} +0 -0
  50. /package/lib/docs/{core-concepts.md → core/core-concepts.md} +0 -0
  51. /package/lib/docs/{financial-statements.md → reporting/financial-statements.md} +0 -0
  52. /package/lib/docs/{bkper-api-types.md → sdk/bkper-api-types.md} +0 -0
  53. /package/lib/docs/{bkper-js.md → sdk/bkper-js.md} +0 -0
@@ -1,204 +0,0 @@
1
- [Developer Docs]: https://bkper.com/docs
2
- [App Template]: https://github.com/bkper/bkper-app-template
3
- [Pi]: https://pi.dev/
4
-
5
- A unified **interface for [Bkper](https://bkper.com)**. Use `bkper` in two complementary modes:
6
-
7
- - **Interactive mode** — run `bkper` or `bkper agent` to open the Bkper Agent TUI
8
- - **Command mode** — run `bkper <command>` for explicit CLI workflows, scripts, and automation
9
-
10
- With one tool, you can build and deploy Bkper apps, and manage financial data -- books, accounts, transactions, and balances.
11
-
12
- [![npm](https://img.shields.io/npm/v/bkper?color=%235889e4)](https://www.npmjs.com/package/bkper)
13
-
14
- ## Install & Authenticate
15
-
16
- ### Prerequisites
17
-
18
- - [Node.js](https://nodejs.org/) >= 22
19
-
20
- ### Install (choose one)
21
-
22
- ```bash tab="bun"
23
- bun add -g bkper
24
- ```
25
-
26
- ```bash tab="npm"
27
- npm i -g bkper
28
- ```
29
-
30
- ```bash tab="pnpm"
31
- pnpm add -g bkper
32
- ```
33
-
34
- ```bash tab="yarn"
35
- yarn global add bkper
36
- ```
37
-
38
- ### Authenticate with Bkper
39
-
40
- ```bash
41
- bkper auth login
42
- ```
43
-
44
- `bkper auth login` connects the CLI to your Bkper account. It prints a Google verification URL and one-time code. Open the URL in any browser, enter the code, and the CLI stores credentials locally. When you are done working, run `bkper auth logout` to clear local credentials.
45
-
46
- ---
47
-
48
- ## Get started
49
-
50
- ### Interactive mode (recommended)
51
-
52
- ```bash
53
- bkper
54
- ```
55
-
56
- `bkper agent` starts the same interactive experience. Bare `bkper` only opens the TUI in an interactive terminal; in non-interactive contexts it prints CLI help instead.
57
-
58
- ![Bkper CLI Agent TUI](https://raw.githubusercontent.com/bkper/bkper-cli/main/assets/bkper-agent-cli.png)
59
-
60
- On first launch, type `/login` and select a provider. `/login` connects the agent to an AI model provider; it is separate from `bkper auth login`, which connects the CLI to your Bkper account. We recommend [OpenCode Go](https://opencode.ai/go) for open-weights models and [OpenCode Zen](https://opencode.ai/zen) for frontier models — both give you access to high-quality models with no extra setup.
61
-
62
- Good starting prompts:
63
-
64
- - `What are the main account types in Bkper?`
65
- - `How do I query transactions using the CLI?`
66
- - `What files are in this project?`
67
- - `Help me create a script that lists all accounts in my book`
68
-
69
- → See [Interactive Mode](#interactive-mode-powered-by-pi) below for passthrough flags and advanced usage.
70
-
71
- ### Command mode
72
-
73
- ```bash
74
- # List your books
75
- bkper book list
76
-
77
- # Show CLI help
78
- bkper --help
79
- ```
80
-
81
- Pick a book and create your first transaction:
82
-
83
- ```bash
84
- bkper transaction create -b <bookId> --description "Office supplies 123.78"
85
- ```
86
-
87
- > Run `bkper --help` or `bkper <command> --help` for built-in documentation on any command.
88
-
89
- → See [Data Management](#data-management) and [App Management](#app-management) below for full command references.
90
-
91
- ---
92
-
93
- ## Interactive Mode (powered by Pi)
94
-
95
- Bkper's agent mode is intentionally a **thin wrapper** around [Pi][Pi]:
96
-
97
- - Pi provides the core agent runtime and TUI
98
- - bkper adds Bkper-specific domain context and startup maintenance behavior
99
-
100
- ### Startup maintenance (non-blocking)
101
-
102
- On each agent startup, bkper performs a background CLI auto-update check. Normal command-mode invocations do not auto-update; use `bkper upgrade` when you want to upgrade explicitly.
103
-
104
- ### Pi passthrough
105
-
106
- Use Pi CLI features directly through bkper:
107
-
108
- ```bash
109
- bkper agent <pi-args>
110
- ```
111
-
112
- If no Pi arguments are provided, `bkper agent` starts the interactive Bkper Agent experience.
113
- A bare `bkper` command is a convenience shortcut for the same TUI when run in an interactive terminal.
114
- If Pi arguments are provided, everything after `bkper agent` is passed through to Pi.
115
-
116
- Examples:
117
-
118
- ```bash
119
- bkper agent -p "Summarize this repository"
120
- bkper agent --model openai/gpt-4o -c
121
- bkper agent install <pi-package-source>
122
- bkper agent --help
123
- ```
124
-
125
- `bkper agent` keeps Bkper defaults (including the Bkper system prompt) unless you explicitly pass `--system-prompt`.
126
- Use `bkper help agent` for the Bkper CLI command help, and `bkper agent --help` for Pi help.
127
-
128
- For all available passthrough flags and commands, see the Pi CLI reference:
129
- https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent#cli-reference
130
-
131
- Pi-specific extensions are loaded from Pi extension folders (for example `.pi/extensions` and `~/.pi/agent/extensions`).
132
-
133
- ---
134
-
135
- ## Data Management
136
-
137
- Manage books, files, accounts, transactions, and balances.
138
-
139
- ```bash
140
- bkper book list
141
- bkper account list -b <bookId>
142
- bkper file list -b <bookId> --limit 100
143
- bkper transaction list -b <bookId> -q 'on:2025' --format csv
144
- bkper balance list -b <bookId> -q 'on:2025-12-31' --format csv
145
- ```
146
-
147
- → [Full Data Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/data-management.md)
148
-
149
- ---
150
-
151
- ## App Management
152
-
153
- Build, deploy, and manage Bkper apps.
154
-
155
- ```bash
156
- bkper app init my-app
157
- bkper app dev
158
- bkper app sync && bkper app deploy
159
- bkper app logs --last 50
160
- bkper app logs my-app --level error
161
- ```
162
-
163
- `bkper app logs` reads recent app logs kept for 15 days. Run it inside an app directory, or pass an app id like `bkper app logs my-app`. Use `--level warn` or `--level error` to focus on requests with warnings or errors. The default output is human-readable, and JSON is available with `--json`.
164
-
165
- → [Full App Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/app-management.md)
166
-
167
- ---
168
-
169
- ## Programmatic access
170
-
171
- ### Access Token
172
-
173
- Use the access token for direct API calls from any tool.
174
- This requires a prior `bkper auth login`, and `bkper auth token` does not start an interactive login flow:
175
-
176
- ```bash
177
- # Print the current access token
178
- TOKEN=$(bkper auth token)
179
-
180
- # Use it with curl, httpie, or any HTTP client
181
- curl -s -H "Authorization: Bearer $TOKEN" \
182
- https://api.bkper.app/v5/books | jq '.items[].name'
183
- ```
184
-
185
- ### Library
186
-
187
- The `getOAuthToken` function returns a Promise that resolves to a valid OAuth token, for use with the [`bkper-js`](https://github.com/bkper/bkper-js) library:
188
-
189
- ```javascript
190
- import { Bkper } from 'bkper-js';
191
- import { getOAuthToken } from 'bkper';
192
-
193
- Bkper.setConfig({
194
- oauthTokenProvider: async () => getOAuthToken(),
195
- });
196
- ```
197
-
198
- ---
199
-
200
- ## Next steps
201
-
202
- - [Developer Docs][Developer Docs] — full platform documentation
203
- - [App Template][App Template] — scaffold a Bkper app in minutes
204
- - [Full CLI reference](https://github.com/bkper/bkper-cli/tree/main/docs) — data management, app building, taxes, and financial statements
File without changes